安装相关包
要配置 NIM Server,首先需要安装必需的 filesets,安装以下几个包:
bos.sysmgt.nim.master bos.sysmgt.nim.client bos.sysmgt.nim.spot
我们可以从系统光盘 DVD 1 中来安装这几个包。首先在空间足够大的文件系统中创建目录,来作为挂载点,然后创建 loopback 的 device,通过 loopback device 将 DVD 1 挂载到创建好的目录之下:
bash:/ # mkdir /opt/iso bash:/ # mkdev -c loopback -s node -t loopback loop2 Available bash:/ # loopmount -i /opt/AIX_7.1_Base_Operating_System_TL_7100-03-00_DVD_1_of_2_112013.iso -l loop2 -o "-V cdrfs -o ro" -m /opt/iso bash:/ #
挂载好之后通过 installp 命令来安装相关的包:
bash:/ # installp -acgXd /opt/iso bos.sysmgt.nim +-----------------------------------------------------------------------------+ Summaries: +-----------------------------------------------------------------------------+ Pre-installation Failure/Warning Summary ---------------------------------------- Name Level Pre-installation Failure/Warning ------------------------------------------------------------------------------- bos.sysmgt.nim.client 7.1.3.0 Already installed Installation Summary -------------------- Name Level Part Event Result ------------------------------------------------------------------------------- bos.sysmgt.nim.spot 7.1.3.0 USR APPLY SUCCESS bos.sysmgt.nim.master 7.1.3.0 USR APPLY SUCCESS
以上省略了一些输出信息,可以看到 client 包已经安装了,另外为我们安装了 spot 和 master 包。
初始化 NIM Server
相关 filesets 安装好之后,通过 smitty nim 菜单来初始化 NIM Server。
bash:/ # smitty nim => Configure the NIM environment => Advanced configuration => Initialize the NIM master only
Configure Network Installation Management Master Fileset Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Network Name [master_net] * Primary Network Install Interface [en0] + Allow Machines to Register Themselves as Clients? [yes] + Alternate Port Numbers for Network Communications (reserved values will be used if left blank) Client Registration [] # Client Communications [] # IP Protocol Version Preference [] +# F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
上面的 Network Name 填写任意容易识别的名称,而 Primary Network Install Interface 填写公网网卡即可。可以通过 lsnim -l master 命令来确认 NIM Master 已经正常工作。
bash:/ # lsnim -l master master: class = machines type = master max_nimesis_threads = 20 if_defined = chrp.64.ent comments = machine which controls the NIM environment platform = chrp netboot_kernel = 64 if1 = master_net_v6 fe80::ecc6:77ff:fe25:6402 fe80::ecc6:77ff:fe25:6402 if2 = master_net_v4 aix116099.cdc.veritas.com EEC677256402 cable_type1 = N/A cable_type2 = N/A Cstate = ready for a NIM operation prev_state = information is missing from this object's definition Mstate = currently running serves = boot serves = nim_script master_port = 1058 registration_port = 1059 reserved = yes
配置 LPP_SOURCE
现在来配置 LPP_SOURCE,首先创建文件系统来存放相关文件,这里我们从 rootvg 上创建一个 5G 的文件系统,路径为 /opt/nim/lpp_source。
bash:/ # crfs -v jfs2 -g rootvg -m /opt/nim/lpp_source -a size=5G File system created successfully. 5242516 kilobytes total disk space. New File System size is 10485760 bash:/ #
通过 smitty nim 菜单来创建 LPP_SOURCE:
bash:/ # smitty nim => Perform NIM Administration Tasks => Manage Resources => Define a Resource => lpp_source
Define a Resource Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Resource Name [7103_lpp] * Resource Type lpp_source * Server of Resource [master] + * Location of Resource [/opt/nim/lpp_source/7103] / NFS Client Security Method [] + NFS Version Access [] + Architecture of Resource [] + Source of Install Images [/opt/iso] +/ Names of Option Packages [all] Show Progress [yes] + Comments [7103 lpp_source] F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
上面的 Resource Name 填写容易识别的名字,Server of Resource 填写 master,Location of Resource 填写上一步专门为 LPP_SOURCE 创建的文件系统下面的路径,Source of Install Images 填写 DVD 1 的挂载路劲, Names of Option Packages 填写 all,表示所有的包,Comments 可以填写任意容易识别的名称。点击 Enter,一段时间后 LPP_SOURCE 就创建好了,这取决于包的多少和机器的性能。
也可以不使用 smitty,而使用命令行的方式来创建 LPP_SOURCE:
bash:/ # nim -o define -t lpp_source -a location=/opt/nim/lpp_source/7103 -a server=master -a comments='7103 lpp_source' -a multi_volume=yes -a source=/opt/iso -a packages=all 7103_lpp
LPP_SOURCE 创建好后,通过 lsnim 命令来验证:
bash:/ # lsnim -l 7103_lpp 7103_lpp: class = resources type = lpp_source comments = 7103 lpp_source arch = power Rstate = ready for use prev_state = unavailable for use location = /opt/nim/lpp_source/7103 simages = yes alloc_count = 0 server = master
配置 NIM Client
在 Client 机器上,首先确保 bos.sysmgt.nim.client 包已经安装,如果没有安装,通过 installp 命令从 DVD 1 安装。
然后通过 smitty nim 菜单来配置 NIM Client:
bash:/ # smitty nim => Configure Network Installation Management Client Fileset
Configure Network Installation Management Client Fileset Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * Machine Name [client_name] * Primary Network Install Interface [en0] + * Host Name of Network Install Master [nim_server_ip] Hardware Platform Type chrp Kernel to use for Network Boot [64] + Communication Protocol used by client [] + Ethernet Interface Options Network Speed Setting [] + Network Duplex Setting [] + VLAN Tag Priority (0 to 7) [] # VLAN Tag Identifier (0 to 4094) [] # Comments [] [MORE...4] F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
上面 Machine Name 填写容易识别的名称,Primary Network Install Interface 填写公网网卡即可,Host Name of Network Install Master 填写前面所配置的 NIM Server 的 IP 地址。点击 Enter即可。可以看到 /etc 目录下生成了 niminfo 文件:
bash:/ # cat /etc/niminfo #------------------ Network Install Manager --------------- # warning - this file contains NIM configuration information # and should only be updated by NIM export NIM_NAME=client_name export NIM_HOSTNAME=client_host_name export NIM_CONFIGURATION=standalone export NIM_MASTER_HOSTNAME=nim_server_host_name export NIM_MASTER_PORT=1058 export NIM_REGISTRATION_PORT=1059 export NIM_SHELL="shell" export NIM_MASTERID=00C22A854C00 export NIM_BOS_IMAGE=/SPOT/usr/sys/inst.images/installp/ppc/bos export NIM_BOS_FORMAT=rte
配置好 NIM Client 后我们就可以通过 NIM Server 在 Client 上安装我们需要的包了。
技术性的问题我很少懂但是我可以上云队站长论坛做做外链