我想使用传感器来检查hdfs中文件的到达情况。我使用了hdfs传感器,但是我无法安装蛇咬伤,因为它需要python2,而且我正在python3上运行。作为另一种选择,我正在使用webhdfs传感器。当我试图实现时,我得到了以下错误
ERROR - b'<html>\n<head>\n<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>\n<title>Error 401 Authentication required</title>\n</head>\n<body><h2>HTTP ERROR 401</h2>\n<p>Problem accessing /webhdfs/v1/. Reason:\n<pre> Authentication required</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/> [2021-07-15 12:01:30,948] {taskinstance.py:1128} ERROR - Read operations failed on the namenodes below:xxxxx
请你让我知道如何使用这个传感器,因为我找不到多少关于如何使用它的信息。或者,请建议任何替代方案来检查文件是否到达hdfs。谢谢您的答复。
请查找以下代码:
source_data_sensor = WebHdfsSensor(
task_id='source_data_sensor',
filepath='filepath',
timeout=120,
webhdfs_conn_id='webhdfs_default',
poke_interval=10,
dag=dag,
env={
'JAVA_HOME': '/usr/bin/java'})发布于 2021-07-15 12:10:04
来自正式文件:它需要apache-airflow版本>=2.1.0和snakebite-py3。尝试安装snakebite-py3而不是snakebite,或者只在气流2.1+上使用pip install apache-airflow-providers-apache-hdfs
https://stackoverflow.com/questions/68392006
复制相似问题