十二、hdfs配置

12.1 配置/etc/hosts,添加所有namenode和datanode的主机名不ip对应关系
[root@nfsgw ~]# vim /etc/hosts
192.168.0.10 nn01
192.168.0.11 node1
192.168.0.12 node2
192.168.0.21 node3
192.168.0.22 node4
192.168.0.16 nfsgw
12.2 配置代理用户
- 在namenode和nfsgw上添加代理用户,代理用户的uid gid用户名必须完全相同
-如果因特殊原因客户端的用户和NFS网关的用户uid不能保持一致需要我们配置nfs.map的静态映射关系
[root@nfsgw ~]# groupadd -g 200 test
[root@nfsgw ~]# useradd -u 200 -g 200 test
[root@nfsgw ~]# id test
uid=200(test) gid=200(test) 组=200(test)
这两个命令在在namenode(nn01)上执行一遍
[root@nn01 ~]# groupadd -g 200 test
[root@nn01 ~]# useradd -u 200 -g 200 test
[root@nn01 ~]# id test
uid=200(test) gid=200(test) 组=200(test)
12.3 在配置core-site.xml之前停止集群
[root@nn01 ~]# cd /usr/local/hadoop/
[root@nn01 hadoop]# ./sbin/stop-all.sh
12.4 配置core-site.xml文件(增加以前不变)
[root@nn01 ~]# cd /usr/local/hadoop/etc/hadoop/
–hadoop.proxyuser.{代理用户}.groups
–hadoop.proxyuser.{代理用户}.hosts
–这里的{代理用户}是你机器上真实运行nfs3的用户
–在非安全模式,运行nfs网关的用户为代理用户
–groups为挂载点用户所使用的组
–hosts为挂载点主机地址
[root@nn01 hadoop]# vim core-site.xml
<property>
<name>hadoop.proxyuser.test.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.test.hosts</name>
<value>*</value>
</property>
配置完成后同步到所有主机
[root@nn01 hadoop]# scp ./core-site.xml node1:/usr/local/hadoop/etc/hadoop/
core-site.xml 100% 1136 1.1MB/s 00:00
[root@nn01 hadoop]# scp ./core-site.xml node2:/usr/local/hadoop/etc/hadoop/
core-site.xml 100% 1136 813.6KB/s 00:00
[root@nn01 hadoop]# scp ./core-site.xml node3:/usr/local/hadoop/etc/hadoop/
core-site.xml 100% 1136 1.1MB/s 00:00
[root@nn01 hadoop]# scp ./core-site.xml node4:/usr/local/hadoop/etc/hadoop/
core-site.xml
12.5 配置完成过后启动集群
[root@nn01 ~]# cd /usr/local/hadoop/
[root@nn01 hadoop]# ./sbin/start-all.sh
[root@nn01 hadoop]# ./bin/hdfs dfsadmin -report

posted @ 2021-09-08 15:39  落樰兂痕  阅读(185)  评论(0)    收藏  举报