cm管理hadoop集群hdfs切换用户

使用CDH和CM管理hadoop集群切换用户

CDH和CM管理hadoop集群后,创建很多用户hdfs、hive、hue等等,上传文件到hdfs发现登陆不了hdfs用户。

[root@node01 localData]# su - hdfs
This account is currently not available.

查看hdfs的帐号信息

[root@node01 localData]# cat /etc/passwd|grep hdfs
hdfs:x:985:978:Hadoop HDFS:/var/lib/hadoop-hdfs:/sbin/nologin

发现它的shell是“/sbin /nologin”,需要将其改成“/bin/bash”

[root@node01 localData]# vim /etc/passwd

cm管理hadoop集群hdfs切换用户_第1张图片
保存退出,su - hdfs试试。

[root@node01 localData]# su hdfs -c "hadoop dfs -mkdir /user/root"
WARNING: Use of this script to execute dfs is deprecated.
WARNING: Attempting to execute replacement "hdfs dfs" instead.
[root@node01 localData]# su hdfs -c "hadoop dfs -ls /user"
WARNING: Use of this script to execute dfs is deprecated.
WARNING: Attempting to execute replacement "hdfs dfs" instead.

Found 5 items
drwxrwxrwx   - mapred hadoop              0 2020-04-23 16:05 /user/history
drwxrwxr-t   - hive   hive                0 2020-04-23 16:48 /user/hive
drwxrwxr-x   - hue    hue                 0 2020-04-23 16:54 /user/hue
drwxr-xr-x   - hdfs   supergroup          0 2020-04-24 11:06 /user/root
drwxr-xr-x   - hdfs   supergroup          0 2020-04-23 15:54 /user/yarn

你可能感兴趣的:(大数据,运维)