无法运行气流并访问它

6l7fqoea  于 2022-10-15  发布在  PostgreSQL
关注(0)|答案(1)|浏览(285)

我从他的官方网站上下载了Airflow的docker-compose.yaml,输入到我的文件夹中,运行了sudo docker compose up airflow-init,运行得很好。当我运行sudo docker compose up来运行服务器并尝试在localhost:8080中访问时,我无法访问。以下是我运行sudo docker compose up时的日志:

WARN[0000] The "AIRFLOW_UID" variable is not set. Defaulting to a blank string. 
WARN[0000] The "AIRFLOW_UID" variable is not set. Defaulting to a blank string. 
[+] Running 7/0
 ⠿ Container airflow-docker-redis-1              Created                                                      0.0s
 ⠿ Container airflow-docker-postgres-1           Created                                                      0.0s
 ⠿ Container airflow-docker-airflow-init-1       Created                                                      0.0s
 ⠿ Container airflow-docker-airflow-scheduler-1  Created                                                      0.0s
 ⠿ Container airflow-docker-airflow-webserver-1  Created                                                      0.0s
 ⠿ Container airflow-docker-airflow-triggerer-1  Created                                                      0.0s
 ⠿ Container airflow-docker-airflow-worker-1     Created                                                      0.0s
Attaching to airflow-docker-airflow-init-1, airflow-docker-airflow-scheduler-1, airflow-docker-airflow-triggerer-1, airflow-docker-airflow-webserver-1, airflow-docker-airflow-worker-1, airflow-docker-postgres-1, airflow-docker-redis-1
airflow-docker-redis-1              | 1:C 12 Oct 2022 15:20:30.213 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
airflow-docker-redis-1              | 1:C 12 Oct 2022 15:20:30.213 # Redis version=7.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
airflow-docker-redis-1              | 1:C 12 Oct 2022 15:20:30.213 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.214 * monotonic clock: POSIX clock_gettime
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.217 * Running mode=standalone, port=6379.
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.217 # Server initialized
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.217 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.218 * Loading RDB produced by version 7.0.5
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.218 * RDB age 6 seconds
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.218 * RDB memory usage when created 0.85 Mb
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.218 * Done loading RDB, keys loaded: 0, keys expired: 0.
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.218 * DB loaded from disk: 0.001 seconds
airflow-docker-redis-1              | 1:M 12 Oct 2022 15:20:30.218 * Ready to accept connections
airflow-docker-postgres-1           | 
airflow-docker-postgres-1           | PostgreSQL Database directory appears to contain a database; Skipping initialization
airflow-docker-postgres-1           | 
airflow-docker-postgres-1           | 2022-10-12 15:20:30.319 UTC [1] LOG:  starting PostgreSQL 13.8 (Debian 13.8-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
airflow-docker-postgres-1           | 2022-10-12 15:20:30.320 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
airflow-docker-postgres-1           | 2022-10-12 15:20:30.320 UTC [1] LOG:  listening on IPv6 address "::", port 5432
airflow-docker-postgres-1           | 2022-10-12 15:20:30.323 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
airflow-docker-postgres-1           | 2022-10-12 15:20:30.330 UTC [26] LOG:  database system was shut down at 2022-10-12 15:20:24 UTC
airflow-docker-postgres-1           | 2022-10-12 15:20:30.340 UTC [1] LOG:  database system is ready to accept connections
airflow-docker-airflow-init-1       | /home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:367: FutureWarning: The auth_backends setting in [api] has had airflow.api.auth.backend.session added in the running config, which is needed by the UI. Please update your config before Apache Airflow 3.0.
airflow-docker-airflow-init-1       |   FutureWarning,
airflow-docker-airflow-init-1       | 
airflow-docker-airflow-init-1       | WARNING!!!: AIRFLOW_UID not set!
airflow-docker-airflow-init-1       | If you are on Linux, you SHOULD follow the instructions below to set 
airflow-docker-airflow-init-1       | AIRFLOW_UID environment variable, otherwise files will be owned by root.
airflow-docker-airflow-init-1       | For other operating systems you can get rid of the warning with manually created .env file:
airflow-docker-airflow-init-1       |     See: https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html#setting-the-right-airflow-user
airflow-docker-airflow-init-1       | 
airflow-docker-airflow-init-1       | The container is run as root user. For security, consider using a regular user account.
airflow-docker-airflow-init-1       | 
airflow-docker-airflow-init-1       | /home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:367: FutureWarning: The auth_backends setting in [api] has had airflow.api.auth.backend.session added in the running config, which is needed by the UI. Please update your config before Apache Airflow 3.0.
airflow-docker-airflow-init-1       |   FutureWarning,
airflow-docker-airflow-init-1       | DB: postgresql+psycopg2://airflow:***@postgres/airflow
airflow-docker-airflow-init-1       | Performing upgrade with database postgresql+psycopg2://airflow:***@postgres/airflow
airflow-docker-airflow-init-1       | [2022-10-12 15:20:40,747] {migration.py:204} INFO - Context impl PostgresqlImpl.
airflow-docker-airflow-init-1       | [2022-10-12 15:20:40,748] {migration.py:211} INFO - Will assume transactional DDL.
airflow-docker-airflow-init-1       | [2022-10-12 15:20:40,847] {db.py:1531} INFO - Creating tables
airflow-docker-airflow-init-1       | INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
airflow-docker-airflow-init-1       | INFO  [alembic.runtime.migration] Will assume transactional DDL.
airflow-docker-airflow-init-1       | Upgrades done
airflow-docker-airflow-init-1       | /home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:367: FutureWarning: The auth_backends setting in [api] has had airflow.api.auth.backend.session added in the running config, which is needed by the UI. Please update your config before Apache Airflow 3.0.
airflow-docker-airflow-init-1       |   FutureWarning,
airflow-docker-airflow-init-1       | [2022-10-12 15:20:55,367] {providers_manager.py:211} INFO - Optional provider feature disabled when importing 'airflow.providers.google.leveldb.hooks.leveldb.LevelDBHook' from 'apache-airflow-providers-google' package
airflow-docker-airflow-init-1       | [2022-10-12 15:20:57,136] {providers_manager.py:211} INFO - Optional provider feature disabled when importing 'airflow.providers.google.leveldb.hooks.leveldb.LevelDBHook' from 'apache-airflow-providers-google' package
airflow-docker-airflow-init-1       | airflow already exist in the db
airflow-docker-airflow-init-1       | /home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:367: FutureWarning: The auth_backends setting in [api] has had airflow.api.auth.backend.session added in the running config, which is needed by the UI. Please update your config before Apache Airflow 3.0.
airflow-docker-airflow-init-1       |   FutureWarning,
airflow-docker-airflow-init-1       | 2.4.1
airflow-docker-airflow-init-1 exited with code 0

我已经寻找并尝试了一些解决方案,但没有一个效果很好。我只想跑去8080号港。我能做什么?

egmofgnx

egmofgnx1#

在运行Docker Compose之前,您需要第一次运行以下命令。

echo -e "AIRFLOW_UID=$(id -u)" > .env

请参阅此link上的初始化环境

相关问题