说明:本文为面向AIX 修改主机名的指导手册
标签:AIX、修改主机名、P780、AIX 7
注意:文中删去了不需要的多余部分,让初学者一目了然一学就会
相关工具:smit为AIX自带的字符图形化管理工具
温馨提示:如果您发现本文哪里写的有问题或者有更好的写法请留言或私信我进行修改优化
★ 本文用于
举例和修复AIX下修改主机名异常导致的部分应用异常的情况
★ 修改主机名(为了方便对比,这个是错误的修改方法)
※ 旧主机名:P780_001
※ 新主机名:zzt_2009
※ 修改主机名的命令(错误命令举例)
smit hostname 永久修改
vi /etc/hosts 修改hosts文件
hostname xxx 设置当前环境
★ 调用VNC安装Oracle数据库异常
【步骤①】 成功修改主机名前的状态(使用上述命令“修改”了主机名)
※ grid用户开了6个vncserver窗口均异常,提示如下
zzt_2009:/home/grid$vncserver
xauth: (argv):6: 1356-352 bad display name "P780_001:6" in "add" command
New 'X' desktop is P780_001:6
Starting applications specified in /home/grid/.vnc/xstartup
Log file is /home/grid/.vnc/P780_001:6.log
※ 查看VNC报错日志,发现无法分配旧主机名的窗口,但是此时已经“修改”了主机名
zzt_2009:/home/grid$cat /home/grid/.vnc/P780_001:6.log
xxx Xvnc version 3.3.3r2
xxx Copyright (C) AT&T Laboratories Cambridge.
xxx All Rights Reserved.
xxx See http://www.uk.research.att.com/vnc for information on VNC
xxx Desktop name 'X' (zzt_2009:6)
xxx Protocol version supported 3.3
xxx Listening for VNC connections on TCP port 5906
xxx Listening for HTTP connections on TCP port 5806
xxx URL http://zzt_2009:5806
Font directory '/usr/lib/X11/fonts/ibm850/' not found - ignoring
_X11TransSocketINETConnect() can't get address for P780_001:6006: Hostname and service name not provided or found
xrdb: Invalid argument
xrdb: Can't open display 'P780_001:6'
_X11TransSocketINETConnect() can't get address for P780_001:6006: Hostname and service name not provided or found
1356-265 xsetroot: Unable to open display: P780_001:6.
_X11TransSocketINETConnect() can't get address for P780_001:6006: Hostname and service name not provided or found
xterm Xt error: Can't open display: P780_001:6
_X11TransSocketINETConnect() can't get address for P780_001:6006: Hostname and service name not provided or found
twm: unable to open display "P780_001:6"
【步骤②】成功修改主机名前的状态(将新旧主机名都添加到/etc/hosts文件中)
※ 虽然在hosts里面添加旧主机名后VNC执行成功,但是topas或调用Oracle安装时仍然显示主机名为旧主机名
zzt_2009:/home/grid/.vnc$vncserver
New 'X' desktop is P780_001:2
Starting applications specified in /home/grid/.vnc/xstartup
Log file is /home/grid/.vnc/P780_001:2.log
【步骤③】成功修改主机名后的状态(正宗命令见文末“Change System's hostname in AIX”)
※ 翻阅AIX官方文档,终于get到修改主机名的正宗步骤,一顿操作后成功修改主机名。然后将旧主机名从/etc/hosts文件中永久剔除
zzt_2009:/home/grid$vncserver
New 'X' desktop is zzt_2009:9
Starting applications specified in /home/grid/.vnc/xstartup
Log file is /home/grid/.vnc/zzt_2009:9.log
★ Change System's hostname in AIX
① smit hostname
② vi /etc/hosts
③ /etc/rc.net
④ hostname xxx
★ 总结
百度、Google搜来搜去,最后发现还是官方文档最好用,不过就是有点大海捞针……
★ 后记
AIX主机名至此成功修改完成,VNC也成功拉起,Oracle RAC也成功安装部署……一切都是那么美好~
※ 如果您觉得文章写的还不错, 别忘了在文末给作者点个赞哦 ~
over