Airflow无法识别我的S3连接设置

问题描述 投票:0回答:1

我正在使用带有Kubernetes执行器的Airflow并在本地进行测试(使用minikube),虽然能够启动并运行它,但似乎无法将日志存储在S3中。我已经尝试了所有描述的解决方案,但仍收到以下错误,

*** Log file does not exist: /usr/local/airflow/logs/example_python_operator/print_the_context/2020-03-30T16:02:41.521194+00:00/1.log
*** Fetching from: http://examplepythonoperatorprintthecontext-5b01d602e9d2482193d933e7d2:8793/log/example_python_operator/print_the_context/2020-03-30T16:02:41.521194+00:00/1.log
*** Failed to fetch log file from worker. HTTPConnectionPool(host='examplepythonoperatorprintthecontext-5b01d602e9d2482193d933e7d2', port=8793): Max retries exceeded with url: /log/example_python_operator/print_the_context/2020-03-30T16:02:41.521194+00:00/1.log (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd00688a650>: Failed to establish a new connection: [Errno -2] Name or service not known'))

我实现了此answer中提到的自定义Logging类,但还是没有运气。

我的airflow.yaml看起来像这样

airflow:
  image:
     repository: airflow-docker-local
     tag: 1

  executor: Kubernetes

  service:
    type: LoadBalancer

  config:
    AIRFLOW__CORE__EXECUTOR: KubernetesExecutor
    AIRFLOW__CORE__TASK_LOG_READER: s3.task
    AIRFLOW__CORE__LOAD_EXAMPLES: True
    AIRFLOW__CORE__FERNET_KEY: ${MASKED_FERNET_KEY}
    AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://postgres:airflow@airflow-postgresql:5432/airflow
    AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://postgres:airflow@airflow-postgresql:5432/airflow
    AIRFLOW__CELERY__BROKER_URL: redis://:airflow@airflow-redis-master:6379/0

    # S3 Logging
    AIRFLOW__CORE__REMOTE_LOGGING: True
    AIRFLOW__CORE__REMOTE_LOG_CONN_ID: s3://${AWS_ACCESS_KEY_ID}:${AWS_ACCESS_SECRET_KEY}@S3
    AIRFLOW__CORE__REMOTE_BASE_LOG_FOLDER: s3://${BUCKET_NAME}/logs
    AIRFLOW__CORE__S3_LOG_FOLDER: s3://${BUCKET_NAME}/logs
    AIRFLOW__CORE__LOGGING_LEVEL: INFO
    AIRFLOW__CORE__LOGGING_CONFIG_CLASS: log_config.LOGGING_CONFIG
    AIRFLOW__CORE__ENCRYPT_S3_LOGS: False
    # End of S3 Logging

    AIRFLOW__WEBSERVER__EXPOSE_CONFIG: True
    AIRFLOW__WEBSERVER__LOG_FETCH_TIMEOUT_SEC: 30
    AIRFLOW__KUBERNETES__WORKER_CONTAINER_REPOSITORY: airflow-docker-local
    AIRFLOW__KUBERNETES__WORKER_CONTAINER_TAG: 1
    AIRFLOW__KUBERNETES__WORKER_CONTAINER_IMAGE_PULL_POLICY: Never
    AIRFLOW__KUBERNETES__WORKER_SERVICE_ACCOUNT_NAME: airflow
    AIRFLOW__KUBERNETES__DAGS_VOLUME_CLAIM: airflow
    AIRFLOW__KUBERNETES__NAMESPACE: airflow
    AIRFLOW__KUBERNETES__DELETE_WORKER_PODS: True
    AIRFLOW__KUBERNETES__KUBE_CLIENT_REQUEST_ARGS: '{\"_request_timeout\":[60,60]}'

persistence:
  enabled: true
  existingClaim: ''
  accessMode: 'ReadWriteMany'
  size: 5Gi

logsPersistence:
  enabled: false

workers:
  enabled: true

postgresql:
  enabled: true

redis:
  enabled: true

[我尝试通过UI设置连接并通过airflow.yaml创建连接,但似乎没有任何效果,我已经尝试了3天了,但是没有运气,任何帮助将不胜感激。

我已附上截图以供参考,

enter image description hereenter image description here

kubernetes airflow kubernetes-helm kubernetesexecutor
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.