大家,我在构建Hadoop集群时遇到了一个小问题
我的节点安装了CentOS 6.5,java1.7.60和hadoop 2.2.0

我想建立一个主人和三个奴隶
我尝试像this一样构建它
但是最后,我尝试启动我的namenode和datanode

我的/ etc / hosts像这样:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.10.10.10 master
10.10.10.11 slave1
10.10.10.12 slave2
10.10.10.13 slave3

就像这样当我键入:
$ hadoop namenode -fromat:

java.net.UnknownHostException: hadoop01.hadoopcluster: hadoop01.hadoopcluster
    at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
    at org.apache.hadoop.net.DNS.resolveLocalHostname(DNS.java:264)
    at org.apache.hadoop.net.DNS.<clinit>(DNS.java:57)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.newBlockPoolID(NNStorage.java:914)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.newNamespaceInfo(NNStorage.java:550)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:144)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:837)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1213)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1320)
Caused by: java.net.UnknownHostException: hadoop01.hadoopcluster
    at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
    ... 8 more
14/07/01 16:50:46 WARN net.DNS: Unable to determine address of the host-falling back to "localhost" address
java.net.UnknownHostException: hadoop01.hadoopcluster: hadoop01.hadoopcluster
    at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
    at org.apache.hadoop.net.DNS.resolveLocalHostIPAddress(DNS.java:287)
    at org.apache.hadoop.net.DNS.<clinit>(DNS.java:58)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.newBlockPoolID(NNStorage.java:914)
    at org.apache.hadoop.hdfs.server.namenode.NNStorage.newNamespaceInfo(NNStorage.java:550)
    at org.apache.hadoop.hdfs.server.namenode.FSImage.format(FSImage.java:144)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.format(NameNode.java:837)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1213)
    at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1320)
Caused by: java.net.UnknownHostException: hadoop01.hadoopcluster
    at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
    ... 8 more

并尝试发出start-dfs.sh和start-yarn.sh:
$ start-dfs.sh
14/07/01 16:55:23 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [master]
master: namenode running as process 2395. Stop it first.
slave2: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-hadoop03.hadopcluster.out
slave1: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-hadoop02.hadopcluster.out
slave3: starting datanode, logging to /opt/hadoop/logs/hadoop-hadoop-datanode-hadoop04.hadopcluster.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: secondarynamenode running as process 2564. Stop it first.
14/07/01 16:55:31 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable


$ start-yarn.sh
starting yarn daemons
starting resourcemanager, logging to /opt/hadoop/logs/yarn-hadoop-resourcemanager-hadoop01.hadoopcluster.out
slave1: starting nodemanager, logging to /opt/hadoop/logs/yarn-hadoop-nodemanager-hadoop02.hadopcluster.out
slave3: starting nodemanager, logging to /opt/hadoop/logs/yarn-hadoop-nodemanager-hadoop04.hadopcluster.out
slave2: starting nodemanager, logging to /opt/hadoop/logs/yarn-hadoop-nodemanager-hadoop03.hadopcluster.out

并输入jps:
$ jps
2564 SecondaryNameNode
5591 Jps
2395 NameNode

我只是这样,没有DataNode,NodeManager,ResourceManger ...等,
设置时哪里有问题?
任何人都可以建议我一些东西,谢谢!

最佳答案

DHCP (动态主机配置协议(protocol))

它是部署在IP网络上的服务器,用于为其客户端分配IP地址。因此,您必须在服务器和客户端上都配置DHCP。

在服务器端:

  • 获取软件包:isc-dhcp-server
  • 编辑/ etc/network接口(interface)来配置接口(interface),为DHCP服务器选择静态IP地址
  • 指定DHCP将侦听的本地网络接口(interface)(/etc/default/isc-dhcp-server)
  • 编辑配置文件/etc/dhcp/dhcpd.conf以选择本地网络将使用的IP地址,定义DNS服务器

  • 在客户端:
  • 编辑/ etc / network接口(interface)以配置接口(interface)

  • 您可以确保已正确安装和配置它,可以使用ifconfigping命令。

    DNS (域名系统)
  • 安装bind9
  • 编辑/etc/bind/named.conf以添加主机

  • 祝好运。

    关于hadoop - 在hadoop 2.2.0上,我的datanode无法启动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24506332/

    10-16 17:47