解决
1.首先查看虚拟机hadoop是否已经启动服务
2.查看虚拟机防火墙是否开启
systemctl status iptables
出现:
Unit iptables.service could not be found.
因为CentOS7没有iptables.service,安装一下即可:
yum install iptables-services
然后再次查看。如果如下,需要先关闭防火墙:
systemctl stop iptables
此时再看状态:
接下来就可以访问,ip:8088 、 ip:50070 、ip:50090 。
但是将ip替换成hostname,还是会失败,此时需要再本机的/etc/hosts 文件中添加映射
虚拟机ip 虚拟机hostname
然后将ip替换成hostname即可访问。
下面命令暂时没有使用,等虚拟机重启,看看防火墙是否自动开启,如果是,则使用以下命令永久关闭。
//永久关闭防火墙
chkconfig iptables off
//永久关闭后启用
chkconfig iptables on
后续
在启动第二台虚拟机之后,通过上面排查,发现 iptables 防火墙确实已经关闭,但是死活无法访问hdfs文件系统,万万没想到还有 firewall 防火墙!!!关闭之后就可以了。
1.查看防火墙状态
firewall-cmd --state
2.停止firewall
systemctl stop firewalld.service
3.禁止firewall开机启动
systemctl disable firewalld.service
=================================================================
个人博客
Github
个人公众号:Flutter小同学
个人网站