我正在尝试在我的amazon实例上设置hadoop,在2个节点的集群上。每个实例都有一个公共dns,我用它来引用它们。因此,在两台机器上的/etc/hosts文件中,我添加了如下行:
{public dns of 1st instance} node1
{public dns of 2st instance} node2我还可以通过简单的操作从另一个实例ssh到另一个实例中:
ssh {public dns of the other instance}在第一个实例文件的hadoop/conf/slaves中,我有:
localhost
node2当我启动脚本bin/ start -dfs.sh时,它能够启动主服务器上的namenode、datanode和辅助namenode,但它显示:
node2: ssh: Could not resolve hostname node2: Name or service not known如果我尝试一下,它会打印出相同的结果:
ssh node2我猜问题是我如何告诉它将node2与第二个实例的公共域名相关联。是否仅将
{public dns of 2st instance} node2行添加到/etc/hosts文件?是否需要重启实例?
发布于 2013-08-09 03:23:15
当您没有与IP地址相关联实际DNS时,/etc/hosts的行为有点像本地DNS。
如果您可以在从文件和主文件中直接使用{第一个实例的公共dns },那么您真的需要{public dns of 1st instance} node1映射吗?
此外,最好使用amazon实例的内网IP地址,而不是使用公网IP地址。您可以在每个实例的终端执行ifconfig操作,并确定其内网IP地址(如果有)。它们可能基本上会从10.x.x.x/172.x.x.x/192.x.x.x开始?然后,您可能可以将它们映射到每个amazon实例的/etc/hosts中。
因此,每台机器中的/etc/hosts应该类似于-
机器-1:
{IP_address_1st_instance} node1
{IP_address_2st_instance} node2机器-2:
{IP_address_1st_instance} node1
{IP_address_2st_instance} node2而且,这是为了让Amazon实例(机器)可以相互解析,如果您计划映射它们的话。
https://stackoverflow.com/questions/18134231
复制相似问题