docker - 设置 Apache Airflow 时无法执行脚本 docker-compose

标签 docker docker-compose yaml airflow

我正在使用 Docker Compose 来设置 Apache Airflow,并且在我使用时

docker-compose up airflow-init

我收到此错误:

Traceback (most recent call last):
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
  FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requests/adapters.py", line 449, in send
  File "urllib3/connectionpool.py", line 727, in urlopen
  File "urllib3/util/retry.py", line 403, in increment
  File "urllib3/packages/six.py", line 734, in reraise
  File "urllib3/connectionpool.py", line 677, in urlopen
  File "urllib3/connectionpool.py", line 392, in _make_request
  File "http/client.py", line 1252, in request
  File "http/client.py", line 1298, in _send_request
  File "http/client.py", line 1247, in endheaders
  File "http/client.py", line 1026, in _send_output
  File "http/client.py", line 966, in send
  File "docker/transport/unixconn.py", line 43, in connect
  urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file   or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker/api/client.py", line 205, in _retrieve_server_version
  File "docker/api/daemon.py", line 181, in version
  File "docker/utils/decorators.py", line 46, in inner
  File "docker/api/client.py", line 228, in _get
  File "requests/sessions.py", line 543, in get
  File "requests/sessions.py", line 530, in request
  File "requests/sessions.py", line 643, in send
  File "requests/adapters.py", line 498, in send
  requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bin/docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 123, in perform_command
  File "compose/cli/command.py", line 69, in project_from_options
  File "compose/cli/command.py", line 132, in get_project
  File "compose/cli/docker_client.py", line 43, in get_client
  File "compose/cli/docker_client.py", line 170, in docker_client
  File "docker/api/client.py", line 188, in __init__
  File "docker/api/client.py", line 213, in _retrieve_server_version
  docker.errors.DockerException: Error while fetching server API version: ('Connection   aborted.', FileNotFoundError(2, 'No such file or directory'))
[81] Failed to execute script docker-compose

这是我正在使用的 yaml 文件:https://airflow.apache.org/docs/apache-airflow/stable/docker-compose.yaml

这是我正在遵循的教程:https://www.youtube.com/watch?v=aTaytcxy2Ck&t=398s

最佳答案

也许您已经安装了 docker,但它没有运行,或者您的用户未配置为访问它。

这与此处描述的错误相同:

https://github.com/docker/compose/issues/7896

您可以通过运行docker ps来仔细检查它。如果它没有显示任何进程(但没有出错),那么您的 docker 正在运行并且配置正确。

另一件事是要检查您的用户是否已正确配置为访问 docker。在 Linux 上,您应该确保您的用户已添加到 docker 组。请参阅https://docs.docker.com/engine/install/linux-postinstall/

关于docker - 设置 Apache Airflow 时无法执行脚本 docker-compose,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68793915/

相关文章:

postgresql - 如何在 Kubernetes 上实现 Postgres 备份?

docker - 端到端测试期间 OpenShift "Failed to get ' appData 路径上的 Cypress (Electron) 错误”

cassandra - Docker - Cassandra 与身份验证

docker - 如何使用 docker 文件路径连接到 firebird 的 docker 镜像?

range - 如何在 docker-compose.yml 文件中公开端口范围(如 "3000-4000:3000-4000")

yaml - 如何在 kubernetes 复制 Controller yaml 文件中使用环境变量

java - Grails 3.1.2 无法运行错误 org.hibernate.hbm2ddl.schemaupdate - hhh000388

docker - 无法使用 Ctrl-C 停止我的 Docker 容器

php - 服务器上的Nginx无法连接到docker php-fpm

kubernetes - 定义集合时添加新闻行