解決
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小同學
個人網站