我已经多次写过有关网络安装管理器备用磁盘迁移(nimadm)工具的信息(请参阅本文的“ 相关主题”部分)。 每次,我都讨论了如何使用该工具从AIX的一个版本迁移到另一个版本。 直到最近,如果您想使用此工具来迁移网络安装管理(NIM)客户端,则需要在客户端系统上启用rshd。 对于某些客户来说,这是一个问题。 由于其组织严格的安全策略,即使在很短的时间内,他们也无法或完全禁止启用此服务。 结果,一些对安全敏感的站点不得不寻找其他方式和方法来迁移到新版本的AIX。
从AIX 6.1 TL8和AIX 7.1 TL2开始,nimadm工具现在支持NIM服务处理程序(nimsh)协议。 使用此协议可以在不启用NIM客户机上的rshd的情况下执行AIX迁移。 本文介绍如何将nimsh与nimadm一起使用以迁移到AIX版本7.1。
什么是NIM服务处理程序?
信不信由你,尼姆什已经存在了将近十年。 它是作为AIX 5L V5.2 ML 07和AIX 5L V5.3的新功能首次引入的(2004年)。 此新功能称为NIM服务处理程序(NIMSH)。 这项新服务消除了NIM客户端通信期间对经典“ r”命令的需求。 对于标准rsh协议不够安全的环境,使用nimsh被认为是最佳实践,已得到广泛实施。
NIM服务处理程序为NIM命令提供了一个“包装器”。 只有在nimsh中注册的命令(位于/usr/lpp/bos.sysmgt/nim/methods目录中)才能以root用户身份运行; 其他任何事情都被拒绝执行。 尽管nimsh消除了对rsh的需求,但在默认配置中,它不提供基于密钥加密的可信身份验证。 通过将nimsh配置为使用OpenSSL,可以在nimsh中使用加密身份验证。 在NIM客户端上安装OpenSSL时,在nimsh服务身份验证期间会建立安全套接字层(SSL)套接字连接。 启用OpenSSL提供了SSL密钥生成和包括SSL版本3支持所有的加密套件,请参阅相关的主题部分,获取详细信息配置nimsh来使用OpenSSL。
NIM客户端守护程序(nimsh)作为bos.sysmgt.nim.client文件集的一部分安装。 nimsh客户端守护程序会将数据记录到/var/adm/ras/nimsh.log文件。
nimsh通信涉及两个端口。 这些端口称为主要(端口3901)和次要(端口3902)端口。 主端口侦听服务请求。 巧合的是,SAP还更喜欢使用与nimsh相同的端口号。 请参阅有关nimsh和SAP的Chris的AIX博客,以获取有关此内容以及如何处理这种情况的更多信息。
nimsh子系统已在系统资源控制器(SRC)中注册。 SRC组名称为nimclient,定义的子系统称为nimsh。
可以使用rshd或nimsh混合使用NIM客户端。 但是,最好将nimsh用于所有NIM客户端通信,并完全避免使用rshd。
配置nimsh
如果您过去没有将AIX系统配置为使用nimsh,则可能需要执行以下步骤,以便NIM客户端可以通过nimsh与NIM主服务器通信。 在NIM客户端上执行以下步骤以重新配置NIM客户端。 首先,将所有先前的(旧)/ etc / niminfo配置文件移开,然后使用niminit
命令重新配置NIM客户端,并启用nimsh作为NIM客户端使用的通信协议。 最后,我们确认nimsh子系统现在处于活动状态。
# mv /etc/niminfo /etc/niminfo.old
# niminit -a master=nim1 -a name=`hostname # stopsrc -s nimsh
# smit nim_config_services
* Communication Protocol used by client [nimsh] +
# lssrc -s nimsh
Subsystem Group PID Status
nimsh nimclient 6029524 active
在NIM主服务器上,验证NIM客户端连接节现在显示了nimsh而不是shell。
# lsnim -l aix61
aixlpar61:
class = machines
type = standalone
locked = 9502758
connect = nimsh
platform = chrp
netboot_kernel = 64
if1 = network1 aixlpar61 0
cable_type1 = N/A
Cstate = alt_disk_mig operation is being performed
prev_state = ready for a NIM operation
Mstate = currently running
lpp_source = aix71
spot = aix71spot
cpuid = 00C8E4244C00
control = master
Cstate_result = reset
使用nim –o showlog
命令验证NIM主机可以通过nimsh与NIM主机通信。 此命令应在NIM客户端上返回NIM安装日志文件(/var/adm/ras/nim.installp)的内容。
# nim -o showlog aix61
BEGIN:Thu Mar 24 01:29:36 2011:032401293611
Command line is:
/usr/sbin/installp -u -e /var/adm/ras/nim.installp -b -f \
/tmp/.workdir.3014756.2686976_1/.genlib.installp.list.2686976
+-----------------------------------------------------------------------------+
Pre-deinstall Verification...
+-----------------------------------------------------------------------------+
done
…etc…
Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
bos.sysmgt.nim.master 6.1.0.0 USR DEINSTALL SUCCESS
END:Thu Mar 24 01:29:49 2011:032401294911
如果nimsh在NIM客户端上不起作用,那么您将收到类似于以下示例的错误。
# nim -o showlog aix61
0042-001 nim: processing error encountered on "master":
0042-006 m_showlog: (From_Master) connect
A remote host did not respond within the timeout period.
nconn: connect() failed, errno is 78
aix61: A remote host did not respond within the timeout period.
在nimadm中使用nimsh
在本节中,我们将使用nimsh和nimadm将AIX版本6.1系统迁移到AIX版本7.1。 已安装以下AIX版本,级别和修订:
NIM Master: 7100-02-01-1245 + IV46746m2c (Allow NIMADM with NIMSH and NIM CACHE)*
NIM Client: 6100-08-01-1245
注意:您需要安装临时修订IV46746m2c才能正常工作。 没有它,nimadm操作将失败。 临时修订仅安装在NIM主服务器上。 您需要与IBM支持中心联系以获取修订。
root@nim1[/tmp] # emgr -e IV46746m2c.130826.epkg.Z
root@nim1[/tmp] # emgr -l
ID STATE LABEL INSTALL TIME UPDATED BY ABSTRACT
=== ===== ========== ================= ========== ======================================
1 S IV46746m2c 08/27/13 12:39:55 Allow NIMADM with NIMSH and NIM CACHE
NIM客户端与AIX 6.1 TL8 SP1一起安装。 备用磁盘可用于迁移。 nimsh子系统处于活动状态。
root@aix61[/] # oslevel -s
6100-08-01-1245
root@aix61[/] # lspv
hdisk0 00c8e424e56b6006 rootvg active
hdisk1 00f6050a2cd79ef8 None
root@aix61[/] # lssrc -s nimsh
Subsystem Group PID Status
nimsh nimclient 3539094 active
NIM主服务器与AIX 7.1 TL2 SP1一起安装。 NIM客户端定义将nimsh作为连接协议。 NIM主机能够使用nimsh与NIM客户端进行通信。
root@nim1[/] # oslevel -s
7100-02-01-1245
root@nim1[/] # lsnim -l aix61
aix61:
class = machines
type = standalone
connect = nimsh
platform = chrp
netboot_kernel = 64
if1 = network1 aix61 0
cable_type1 = N/A
Cstate = ready for a NIM operation
prev_state = ready for a NIM operation
Mstate = currently running
cpuid = 00C8E4245C00
Cstate_result = reset
root@nim1[/] # nim -o showlog aix61
BEGIN:Thu Mar 24 01:29:36 2011:032401293611
Command line is:
/usr/sbin/installp -u -e /var/adm/ras/nim.installp -b -f \
/tmp/.workdir.3014756.2686976_1/.genlib.installp.list.2686976
+-----------------------------------------------------------------------------+
Pre-deinstall Verification...
+-----------------------------------------------------------------------------+
done
…etc…
Installation Summary
--------------------
Name Level Part Event Resul
-------------------------------------------------------------------------------
bos.sysmgt.nim.master 6.1.0.0 USR DEINSTALL SUCCESS
END:Thu Mar 24 01:29:49 2011:032401294911
在NIM客户端上禁用了rshd(shell)守护程序。 根用户的主目录(/)中没有.rhosts文件,并且shell服务在/etc/inetd.conf中被注释掉。 这样可以防止NIM主服务器使用rsh连接到NIM客户端。
root@aix61[/] # ls -ltr .rhosts
ls: 0653-341 The file .rhosts does not exist.
root@aix61[/] # grep rshd /etc/inetd.conf
#shell stream tcp6 nowait root /usr/sbin/rshd rshd
root@nim1[/] # rsh aix61 date
aix61: A remote host refused an attempted connect operation.
我使用nimadm如下将NIM客户端从AIX 6.1 TL8 SP1迁移到AIX 7.1 TL2 SP1。
root@nim1[/] # nimadm -j nimvg -c aix61 -s aix71spot -l aix71 -d
hdisk1 -Y
Initializing the NIM master.
Initializing NIM client aix61.
Verifying alt_disk_migration eligibility.
Initializing log: /var/adm/ras/alt_mig/aix61_alt_mig.log
Starting Alternate Disk Migration.
+-----------------------------------------------------------------------------+
Executing nimadm phase 1.
+-----------------------------------------------------------------------------+
Cloning altinst_rootvg on client, Phase 1.
Client alt_disk_install command: alt_disk_copy -j -M 7.1 -P1 -d "hdisk1"
Calling mkszfile to create new /image.data file.
Checking disk sizes.
LOGICAL_VOLUME= hd11admin
FS_LV= /dev/hd11admin
Creating cloned rootvg volume group and associated logical volumes.
...etc...
Generating a list of files
for backup and restore into the alternate file system...
Phase 1 complete.
+-----------------------------------------------------------------------------+
Executing nimadm phase 2.
+-----------------------------------------------------------------------------+
Creating nimadm cache file systems on volume group nimvg.
Checking for initial required migration space.
Creating cache file system /aix61_alt/alt_inst
...etc...
+-----------------------------------------------------------------------------+
Executing nimadm phase 3.
+-----------------------------------------------------------------------------+
Syncing client data to cache ...
+-----------------------------------------------------------------------------+
Executing nimadm phase 4.
+-----------------------------------------------------------------------------+
nimadm: There is no user customization script specified for this phase.
+-----------------------------------------------------------------------------+
Executing nimadm phase 5.
+-----------------------------------------------------------------------------+
Saving system configuration files.
Checking for initial required migration space.
Setting up for base operating system restore.
/aix61_alt/alt_inst
Restoring base operating system.
Merging system configuration files.
...etc...
+-----------------------------------------------------------------------------+
Executing nimadm phase 6.
+-----------------------------------------------------------------------------+
Installing and migrating software.
Updating install utilities.
+-----------------------------------------------------------------------------+
Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...
...etc...
install_all_updates: Checking for recommended maintenance level 7100-02.
install_all_updates: Executing /usr/bin/oslevel -rf, Result = 7100-02
install_all_updates: Verification completed.
install_all_updates: Log file is /var/adm/ras/install_all_updates.log
install_all_updates: Result = SUCCESS
Known Recommended Maintenance Levels
------------------------------------
Restoring device ODM database.
+-----------------------------------------------------------------------------+
Executing nimadm phase 7.
+-----------------------------------------------------------------------------+
nimadm: There is no user customization script specified for this phase.
+-----------------------------------------------------------------------------+
Executing nimadm phase 8.
+-----------------------------------------------------------------------------+
Creating client boot image.
bosboot: Boot image is 53248 512 byte blocks.
Writing boot image to client's alternate boot disk hdisk1.
+-----------------------------------------------------------------------------+
Executing nimadm phase 9.
+-----------------------------------------------------------------------------+
Adjusting client file system sizes ...
Adjusting size for /
...etc...
+-----------------------------------------------------------------------------+
Executing nimadm phase 10.
+-----------------------------------------------------------------------------+
Unmounting client mounts on the NIM master.
forced unmount of /aix61_alt/alt_inst/var
...etc...
Removing cache file system /aix61_alt/alt_inst/var
+-----------------------------------------------------------------------------+
Executing nimadm phase 11.
+-----------------------------------------------------------------------------+
Cloning altinst_rootvg on client, Phase 3.
Client alt_disk_install command: alt_disk_copy -j -M 7.1 -P3 -d "hdisk1"
## Phase 3 ###################
Verifying altinst_rootvg...
Modifying ODM on cloned disk.
forced unmount of /alt_inst/var
...etc...
Bootlist is set to the boot disk: hdisk1 blv=hd5
+-----------------------------------------------------------------------------+
Executing nimadm phase 12.
+-----------------------------------------------------------------------------+
Cleaning up alt_disk_migration on the NIM master.
Cleaning up alt_disk_migration on client aix61.
nimadm操作完成后,我们在其alternaterootvg磁盘上重新启动了NIM客户端。 客户端按预期方式重新启动并运行AIX 7.1 TL2 SP1。
root@aix61[/] # oslevel -s
6100-08-01-1245
root@aix61[/] # lspv
hdisk0 00c8e424e56b6006 rootvg active
hdisk1 00f6050a2cd79ef8 altinst_rootvg
root@aix61[/] # shutdown -Fr
root@aix61[/] # lspv
hdisk0 00c8e424e56b6006 old_rootvg
hdisk1 00f6050a2cd79ef8 rootvg active
root@aix61[/] # oslevel -s
7100-02-01-1245
总体而言,这与任何其他nimadm操作都没有太大区别。 您需要检查的唯一项目是您是否安装了正确的AIX级别(和必要的临时修订),以及NIM主服务器是否可以通过nimsh与NIM客户端通信。
NIM主服务器上的nimadm日志文件仍位于同一位置,在您需要对迁移进行故障排除时可以参考该文件。 在NIM客户端上,您可以查看/var/adm/ras/nimsh.log文件,以获取NIM主服务器与客户端之间所有nimsh通信的审核跟踪。 例如:
root@aix61[/] # tail –f /var/adm/ras/nimsh.log
Mon Aug 26 23:50:25 2013 success: we got 1st write query is 0
Mon Aug 26 23:50:25 2013 success: we got 2nd write local id is 00C8E4244C00
Mon Aug 26 23:50:25 2013 success: we got 3rd write remote id is 00F604884C00
Mon Aug 26 23:50:25 2013 success: we got 4th write command is cd /alt_inst/var &&
/usr/sbin/restore -xqf /alt_inst/tmp/alt_mig.tmpbackup.6291574 > /dev/null ||
> /alt_inst/alt_disk_mig_rfail.6291574
Mon Aug 26 23:50:25 2013 passing OpenSSL setting of 0
Mon Aug 26 23:50:25 2013 authenticated client using standard host methods
Mon Aug 26 23:50:25 2013 sending ack to client
Mon Aug 26 23:50:25 2013 setting descriptors to include 2nd port
Mon Aug 26 23:50:25 2013 command to exec __ cd /alt_inst/var &&
/usr/sbin/restore -xqf /alt_inst/tmp/alt_mig.tmpbackup.6291574 > /dev/null ||
> /alt_inst/alt_disk_mig_rfail.6291574
Mon Aug 26 23:50:26 2013 file descriptor is 5
Mon Aug 26 23:50:26 2013 file descriptor is : 5
Mon Aug 26 23:50:26 2013 family is : 24 (AF_INET6)
Mon Aug 26 23:50:26 2013 source port is : 1023
Mon Aug 26 23:50:26 2013 source addr is : ::ffff:172.29.154.111
Mon Aug 26 23:50:26 2013 source hostname is: nim1 (FQDN)
Mon Aug 26 23:50:26 2013 source hostname is: nim1 (node-only)
Mon Aug 26 23:50:26 2013 getting 2nd port
根据我的测试,与rsh相比,使用nimsh会使总体迁移时间增加约20分钟。 您的里程可能会有所不同。
NIMSH + NIMADM
============
开始时间:2013年8月30日星期五14:37 EET
结束:2013年8月30日星期五15:47
1小时10分钟
外壳+尼玛
============
开始于:2013年9月1日星期日20:01 EET
结束:2013年9月1日星期日20:53 EET
52分钟
翻译自: https://www.ibm.com/developerworks/aix/library/au-nim_service_handler/index.html