相关疑难解决方法(0)

为气流中的日志设置s3

我正在使用docker-compose来设置可扩展的气流群集.我的解决方案基于这个Dockerfile https://hub.docker.com/r/puckel/docker-airflow/

我的问题是将日志设置为从s3写入/读取.当一个dag完成后,我得到这样的错误

*** Log file isn't local.
*** Fetching here: http://ea43d4d49f35:8793/log/xxxxxxx/2017-06-26T11:00:00
*** Failed to fetch log file from worker.

*** Reading remote logs...
Could not read logs from s3://buckets/xxxxxxx/airflow/logs/xxxxxxx/2017-06-
26T11:00:00
Run Code Online (Sandbox Code Playgroud)

我在这个airflow.cfg文件中设置了一个新的部分

[MyS3Conn]
aws_access_key_id = xxxxxxx
aws_secret_access_key = xxxxxxx
aws_default_region = xxxxxxx
Run Code Online (Sandbox Code Playgroud)

然后在远程日志部分中指定s3路径 airflow.cfg

remote_base_log_folder = s3://buckets/xxxx/airflow/logs
remote_log_conn_id = MyS3Conn
Run Code Online (Sandbox Code Playgroud)

我是否正确设置了这个并且有错误?这里有成功的秘诀吗?

- 更新

我尝试以URI和JSON格式导出,似乎都不起作用.然后我导出了aws_access_key_id和aws_secret_access_key,然后气流开始捡起它.现在我在工作日志中得到了他的错误

6/30/2017 6:05:59 PMINFO:root:Using connection to: s3
6/30/2017 6:06:00 PMERROR:root:Could not read logs from s3://buckets/xxxxxx/airflow/logs/xxxxx/2017-06-30T23:45:00
6/30/2017 6:06:00 PMERROR:root:Could not write logs to s3://buckets/xxxxxx/airflow/logs/xxxxx/2017-06-30T23:45:00
6/30/2017 6:06:00 …
Run Code Online (Sandbox Code Playgroud)

python amazon-s3 airflow

33
推荐指数
3
解决办法
2万
查看次数

使用 s3 连接和 s3 hook 在 Airflow 上创建 boto3 s3 客户端

我正在尝试将我的 python 代码移至 Airflow。我有以下代码片段:

    s3_client = boto3.client('s3', 
                        region_name="us-west-2", 
                        aws_access_key_id=aws_access_key_id,
                        aws_secret_access_key=aws_secret_access_key)
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用 Aiflow 的 s3 挂钩和 s3 连接重新创建此 s3_client,但无法在任何文档中找到一种方法来执行此操作,而无需直接在代码中指定 aws_access_key_id 和 aws_secret_access_key 。

任何帮助,将不胜感激

amazon-s3 airflow

5
推荐指数
1
解决办法
7691
查看次数

标签 统计

airflow ×2

amazon-s3 ×2

python ×1