wulawangda
wulawangda
2020-04-10 23:09

在搭建hadoop+zookeeper集群,初始化zkfc报错,连接不上从节点,求指导是哪里的问题。

  • apache
  • oracle
  • linux
  • centos

本人新手,学习搭建hadoop+zookeeper的集群,hadoop版本3.2.1,zookeeper版本3.6.0,用的virtualbox建了5个虚拟机,装的centos7带gnome,网络设置为hostonly。

5个节点分别是nna(主节点),nns(备用),dn1,dn2,dn3是三个worker。

hosts里面配置了

192.168.56.101 nna
192.168.56.102 nns
192.168.56.103 dn1
192.168.56.104 dn2
192.168.56.105 dn3

hostname,network里相关的内容都已修改,myid,workers文件也设置了,5个虚拟机的ip地址设置为自动获取。

zoo.cfg里面配置了:

server.1=dn1:2888:3888
server.2=dn2:2888:3888
server.3=dn3:2888:3888

core-site.xml hdfs-site.xml等等这些配置文件里相应的ha.zookeeper.quorum值也设置为了dn1:2181,dn2:2181,dn3:2181,空格之类的也都检查过了。

我按顺序先启动zookeeper(zkServer.sh status显示1个leader2个follower),然后从主节点nna启动worker上的journalnode(jps显示启动成功),再在主节点nna上格式化namenode也成功了。

接着格式化zkfc:hdfs zkfc -formatZk,显示失败,报错信息如下:

2020-04-07 17:43:53,517 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server dn3/<unresolved>:2181. Will not attempt to authenticate using SASL (unknown error)

2020-04-07 17:43:53,517 WARN org.apache.zookeeper.ClientCnxn: Session 0x0 for server dn3/<unresolved>:2181, unexpected error, closing socket connection and attempting reconnect

java.nio.channels.UnresolvedAddressException

at java.base/sun.nio.ch.Net.checkAddress(Net.java:139)
at java.base/sun.nio.ch.SocketChannelImpl.checkRemote(SocketChannelImpl.java:727)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:741)
at org.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect(ClientCnxnSocketNIO.java:277)
at org.apache.zookeeper.ClientCnxnSocketNIO.connect(ClientCnxnSocketNIO.java:287)
at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1021)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1064)

显然是没找到各节点的ip地址,求高手指教是哪里的配置不对,万分感谢!

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答