完成安装后,遵照此过程可更改群集节点的专用主机名。
在第一次安装群集时会指定缺省的专用主机名。 缺省专用主机名的格式为 clusternode<nodeid>-priv,例如:clusternode3-priv。 只有在专用主机名已经在域中使用的情况下,才应更改它。
请勿为新的专用主机名指定 IP 地址。 群集软件将予以指定。
在群集内的所有节点上,禁用任何"数据服务"资源和其他可能高速缓存专用主机名的应用程序。
# scswitch -n -j resource1, resource2 |
禁用的应用程序应包括:
HA-DNS 和 HA-NFS 服务(如果已配置)。
任何定制配置为使用专用主机名的应用程序。
客户机通过专用互连使用的任何应用程序。
有关使用 scswitch 命令的信息,请参阅 scswitch(1M) 手册页和《Sun Cluster 3.0 12/01 Data Services Installation and Configuration Guide》。
关闭群集中每个节点上的网络时间协议 (NTP) 守护程序。
有关 NTP 守护程序的详细信息,请参阅 xntpd 手册页。
# /etc/init.d/xntpd stop |
确定您正要更改其专用主机名的那个节点的名称。
# scconf -p | grep node |
运行 scsetup 实用程序以更改专用主机名。
只需在群集中的一个节点上执行此操作。
选择新的专用主机名时,请确保该名称对群集节点是唯一的。
从"Main Menu"上选择 5, Private Hostnames。
从 "Private Hostnames Menu" 上选择 1, Change a Private Hostname。
按照提示回答问题。 将询问您其专用主机名正在更改中的节点的名称 (clusternode<nodeid>-priv),以及新的专用主机名。
刷新名称服务高速缓存。
在群集中的每个节点上执行此操作。 这样可以避免群集应用程序和数据服务访问旧的专用主机名。
# nscd -i hosts |
在每个节点上编辑 ntp.conf 文件,将专用主机名更改为新的名称。
使用任意一种编辑工具均可。
如果是在安装时执行此编辑操作,则还要切记删除所配置的节点的名称。缺省模板中预先配置了八个节点。 通常情况下,每个群集节点上的 ntp.conf 文件完全相同。
检验是否能成功地从所有群集节点 ping 新的专用主机名。
重新启动 NTP 守护程序。
在群集中的每个节点上执行此操作。
# /etc/init.d/xntpd start |
启用在步骤 1 中禁用的所有"数据服务"资源和其他应用程序。
# scswitch -e -j resource1, resource2 |
有关使用 scswitch 命令的信息,请参阅 scswitch(1M) 手册页和《Sun Cluster 3.0 12/01 Data Services Installation and Configuration Guide》。
以下示例显示了在节点 phys-schost-2 上将专用主机名从 clusternode2-priv 更改为 clusternode4-priv 的过程。
[Disable all applications and data services as necessary.] phys-schost-1# /etc/init.d/xntpd stop phys-schost-1# scconf -p | grep node ... Cluster nodes: phys-schost-1 phys-schost-2 phys- schost-3 Cluster node name: phys-schost-1 Node private hostname: clusternode1-priv Cluster node name: phys-schost-2 Node private hostname: clusternode2-priv Cluster node name: phys-schost-3 Node private hostname: clusternode3-priv ... phys-schost-1# scsetup phys-schost-1# nscd -i hosts phys-schost-1# vi /etc/inet/ntp.conf ... peer clusternode1-priv peer clusternode4-priv peer clusternode3-priv phys-schost-1# ping clusternode4-priv phys-schost-1# /etc/init.d/xntpd start [Enable all applications and data services disabled at the beginning of the procedure.] |