经过一下午的尝试,终于把这个集群的搭建好了,搭完感觉也没有太大的必要,就当是学习了吧,为之后搭建真实环境做基础。
以下搭建的是一个Ha-Federation-hdfs+Yarn的集群部署。
首先讲一下我的配置:
四个节点上的启动的分别是:
1.linuxidc117:active namenode,
2.linuxidc118 standby namenode ,journalnode,datanode
3.linuxidc119 active namenode ,journalnode,datanode
4.linuxidc120 standby namenode ,journalnode,datanode
这样做纯粹是因为电脑hold不住那么虚拟机了,其实这里所有的节点都应该在不同的服务器上。简单的说,就是117和119做active namenode,118和120做standby namenode,在118.119.120上分别放datanode和journalnode。
此处省略一万字,各种配置好之后。。遇到的问题和记录如下:
1.启动 journalnode,这个journalnode话说我也不是太明白他是干嘛的~~,后续研究吧。在各个节点上启动journalnode:
[linuxidc@linuxidc118 Hadoop-2.6.0]$ sbin/hadoop-daemon.sh start journalnode
starting journalnode, logging to /home/linuxidc/hadoop-2.6.0/logs/hadoop-linuxidc-journalnode-linuxidc118.linuxidc.out
[linuxidc@linuxidc118 hadoop-2.6.0]$ jps
11447 JournalNode
11485 Jps
2. 格式化namenode时报错:(最后查出来是没有关防火墙。。。免密码登陆不代表不用关防火墙)
15/08/20 02:12:45 INFO ipc.Client: Retrying connect to server: linuxidc119/192.168.75.119:8485. Already tried 8 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
15/08/20 02:12:46 INFO ipc.Client: Retrying connect to server: linuxidc118/192.168.75.118:8485. Already tried 8 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
15/08/20 02:12:46 INFO ipc.Client: Retrying connect to server: linuxidc120/192.168.75.120:8485. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
15/08/20 02:12:46 INFO ipc.Client: Retrying connect to server: linuxidc119/192.168.75.119:8485. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
15/08/20 02:12:46 WARN namenode.NameNode: Encountered exception during format:
org.apache.hadoop.hdfs.qjournal.client.QuorumException: Unable to check if JNs are ready for formatting. 2 exceptions thrown:
192.168.75.120:8485: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to linuxidc120:8485 failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see:
192.168.75.119:8485: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to linuxidc119:8485 failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see:
at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:81)
at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:223)
at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:232)
at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:884)
at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:171)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:937)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1379)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1504)
15/08/20 02:12:47 INFO ipc.Client: Retrying connect to server: linuxidc118/192.168.75.118:8485. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)
15/08/20 02:12:47 FATAL namenode.NameNode: Failed to start namenode.
org.apache.hadoop.hdfs.qjournal.client.QuorumException: Unable to check if JNs are ready for formatting. 2 exceptions thrown:
192.168.75.120:8485: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to linuxidc120:8485 failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see:
192.168.75.119:8485: No Route to Host from 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43 to linuxidc119:8485 failed on socket timeout exception: java.net.NoRouteToHostException: No route to host; For more details see:
at org.apache.hadoop.hdfs.qjournal.client.QuorumException.create(QuorumException.java:81)
at org.apache.hadoop.hdfs.qjournal.client.QuorumCall.rethrowException(QuorumCall.java:223)
at org.apache.hadoop.hdfs.qjournal.client.QuorumJournalManager.hasSomeData(QuorumJournalManager.java:232)
at org.apache.hadoop.hdfs.server.common.Storage.confirmFormat(Storage.java:884)
at org.apache.hadoop.hdfs.server.namenode.FSImage.confirmFormat(FSImage.java:171)
at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:937)
at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1379)
at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1504)
15/08/20 02:12:47 INFO util.ExitUtil: Exiting with status 1
15/08/20 02:12:47 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at 43.49.49.59.broad.ty.sx.dynamic.163data.com.cn/59.49.49.43
格式化成功!
[linuxidc@linuxidc117 hadoop-2.6.0]$ bin/hdfs namenode -format -clusterId hadoop-cluster