前文:如果格式化完之后,使用jps命令发现进程都已经启动,但是使用web页面打不开hadoop的网页,可能原因就是防火墙没关或者是哪个配置过程配错了。
一般最好是关闭防火墙比较关闭。 systemctl stop firewalld.service 关闭防火墙; 禁止自动启动就用 systemctl disable firewalld.service . 就可以了。
还有个防火墙是selinux: 要设置为 vi /etc/selinux.config
关闭再重新访问网页还是不行,需要检查配置是否出错。
(我在配置的过程中是因为忘记把hdfs-site.xml.template文件重命名为hdfs-site.xml)。
每次格式化后,名称结点 的clusterID(集群ID)会被新建,而数据结点的clusterID还是原来的,造成名称结点和数据节点的clusterID不一致。
$ stop-all.sh
[root@zhf123 tmp]# pwd /opt/module/cdh/hadoop-2.5.0-cdh5.3.6/data/tmp [root@zhf123 tmp]# ls dfs nm-local-dir [root@zhf123 tmp]# rm -rf ./*
$ cd $HADOOP_HOME $ ls bin include libexec logs README.txt share etc lib LICENSE.txt NOTICE.txt sbin tmp $ rm -rf logs tmp
$ hdfs namenode -format
$ start-all.sh
$ jps 7366 NameNode 8278 Jps 7640 SecondaryNameNode 7849 ResourceManager 7482 DataNode 7967 NodeManager
OK,没问题了,大功告成。
参考链接:
https://blog.csdn.net/qq_42881421/article/details/82958839
https://blog.csdn.net/hylpeace/article/details/88371411
原文:https://www.cnblogs.com/zhf123/p/12033601.html