# -*- coding:utf8 -*-
from hdfs.client import Client
client = Client("http://192.168.37.100:50070")
def hdfs_status():
# 查看hdfs状态
print(client.status("/"))
def hdfs_mkdirs():
client.makedirs('/input',permission=None)
if __name__ == '__main__':
hdfs_mkdirs()
cat_hdfs_file()
报下面错误
hdfs.util.HdfsError: Failed to obtain user group information: org.apache.hadoop.security.authorize.A
可以通过修改 hdfs-site.xml 文件配置,添加权限设置就可以
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>