目前由jobtracker&namenode生成的url会返回像bubbles.local这样的主机名,或者只是气泡。 除非客户端机器在/ etc / hosts文件中指定了这些端口,否则这些端口不会被parsing。
当我在这些机器上运行hostname命令时,它会返回一个完整的域名(EG bubbles.example.com)
在这些机器上运行一个小的Javatesting
InetAddress addr = InetAddress.getLocalHost(); byte[] ipAddr = addr.getAddress(); String hostname = addr.getHostName(); System.out.println(hostname);
像hostname命令一样产生输出。
还有什么地方可以抓住一个主机名来使用它的jobtracker / namenode用户界面?
这发生在8月初Hadoop 1.0.3和1.0.4-SNAPSHOT的集群中。 这些机器运行CentOS版本5.8(最终)。
我所指的生成的URL是这样的
http://example:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=/
或http://example.local:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=/
通过执行以下操作,我设法让WebUI使用完整的主机名。
在每个从节点和主节点上, /etc/hosts文件被修改为如下所示:
127.0.0.1 machine1.example.com machine1 localhost #These 4 lines appear on all of the machines 1.2.3.3 machine1.example.com machine1 1.2.3.4 machine2.example.com machine2 1.2.3.5 machine3.example.com machine3 1.2.3.6 machine4.example.com machine4
现在,当我点击任务跟踪器或hdfs web工具中的URL时,它们包含节点的完整主机名和parsing。
还有什么地方可以抓住一个主机名来使用它的jobtracker / namenode用户界面?
conf/core-site.xml
<property> <name>fs.default.name</name> <value>hdfs://hmaster90:9000</value> <description> The name of the default file system. Either the literal string "local" or a host:port for NDFS. </description> </property>
conf/mapred-site.xml
<property> <name>mapred.job.tracker</name> <value>hmaster90:9001</value> </property>