[英]airflow initdb in directory other than AIRFLOW_HOME?
Question for Apache Airflow / Docker users. Apache Airflow / Docker 用户的问题。 I have a Docker airflow image I've built and I'm trying to use a simple SequentialExecutor / sqlite metadata database, but I'd like to persist the metadata database every time a new container is run.
我有一个 Docker airflow 图像我已经构建,我正在尝试使用一个简单的 SequentialExecutor / sqlite 元数据数据库,但我每次运行一个新的容器就像运行元数据数据库一样。 I'd like to do this by mounting to a drive on the local machine, and having it so initdb initializes the database somewhere other than AIRFLOW_HOME.
我想通过安装到本地机器上的驱动器来做到这一点,并让 initdb 在 AIRFLOW_HOME 以外的地方初始化数据库。 Is this possible / configurable somehow or does anyone have a better solution?
这是可能的/可配置的,还是有人有更好的解决方案?
Basically the desired state is:基本上所需的 state 是:
AIRFLOW_HOME: contains airflow.cfg, dags, scripts, logs whatever
some_other_dir: airflow.db
I know this is possible with logs, so why not the database?我知道这对日志是可能的,那么为什么不是数据库呢?
Thanks!谢谢!
I think the best option is to use docker-compose with a container as metadata database, like this: https://github.com/apache/airflow/issues/8605#issuecomment-623182960我认为最好的选择是将 docker-compose 与容器一起用作元数据数据库,如下所示: https://github.com/apache/airflow/issues/8605#issuecomment-623182960
I use this approach, along with git branches and it works very well.我使用这种方法以及 git 分支,并且效果很好。 The data persists unless you explicitly remove the containers with
make rm
除非您使用
make rm
显式删除容器,否则数据将持续存在
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.