稻草人的高粱地 2013-10-23
环境如下:
两台RedHat6.4服务器,主机名分别为UAPTEST-WEB1-214.chinaclear.com、UAPTEST-WEB2-215.chinaclear.com
主机UAPTEST-WEB1-214.chinaclear.com的/etc/hosts配置如下:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.61.214 UAPTEST-WEB1-214.chinaclear.com 192.168.61.215 UAPTEST-WEB2-215.chinaclear.com
主机UAPTEST-WEB2-215.chinaclear.com的/etc/hosts配置如下:
127.0.0.1 UAPTEST-WEB2-215.chinaclear.com localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 UAPTEST-WEB2-215.chinaclear.com localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.61.214 UAPTEST-WEB1-214.chinaclear.com 192.168.61.215 UAPTEST-WEB2-215.chinaclear.com
主机UAPTEST-WEB1-214.chinaclear.com上面创建DMGR管理节点,启动正常,相关端口详细信息如下:
[root@UAPTEST-WEB1-214 classes]# cat /opt/IBM/WebSphere/AppServer/profiles/Dmgr01/logs/AboutThisProfile.txt Application server environment to create: Management Location: /opt/IBM/WebSphere/AppServer/profiles/Dmgr01 Disk space required: 30 MB Profile name: Dmgr01 Make this profile the default: True Node name: UAPTEST-WEB1-214CellManager01 Cell name: UAPTEST-WEB1-214Cell01 Host name: UAPTEST-WEB1-214.chinaclear.com Enable administrative security (recommended): True Administrative console port: 9060 Administrative console secure port: 9043 Management bootstrap port: 9809 Management SOAP connector port: 8879 Run Management as a service: False
在主机UAPTEST-WEB2-215.chinaclear.com上面使用addNode命令添加集群节点:
[root@UAPTEST-WEB2-215 AppSrv01]# pwd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01 [root@UAPTEST-WEB2-215 AppSrv01]# ./bin/addNode.sh UAPTEST-WEB1-214.chinaclear.com 8879 -username admin
出现下述错误:
ADMU0036E: The Deployment Manager cannot lookup by name host UAPTEST-WEB2-215.chinaclear.com at address 127.0.0.1
分析提示就是说DM通过DNS找不到要添加的Node节点主机名,仔细检查了一下两台主机的hosts配置,都没发现问题,而且两台主机互相可以ping通,主机UAPTEST-WEB1-214.chinaclear.com的8879端口也是可以telnet通的,通过查找相关资料,才找到了问题的解决方法,比较官方的解释如下:
Note: The default Red Hat installation creates an association between the hostname of the machine and the loopback address -- 127.0.0.1. In addition, the /etc/nsswitch.conf file is set up to use /etc/hosts before trying to look up the server using a name server. This can cause failures when trying to add or administrate nodes when the deployment manager or application server is running on Red Hat.
If your deployment manager or your application server is running on Red Hat, perform the following operations on your Red Hat machines to ensure that you can successfully add and administrate nodes:
1Remove the 127.0.0.1 mapping to the local host in /etc/hosts
2Edit /etc/nsswitch.conf so that the hosts line reads:
hosts: dns files
最后的解决办法是在使用addNode命令之前,修改两台主机的/etc/hosts配置文件,都注释掉包含127.0.0.1的整个条目,例如,主机UAPTEST-WEB1-214.chinaclear.com的/etc/hosts配置修改成如下:
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 #::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.61.214 UAPTEST-WEB1-214.chinaclear.com 192.168.61.215 UAPTEST-WEB2-215.chinaclear.com
同理,修改UAPTEST-WEB2-215.chinaclear.com的/etc/hosts配置
最后别忘了,添加完节点之后,改回/etc/hosts配置,否则会影响SSH图形界面登录等等