首先我們假定兩臺機器,機器名和ip地址分別如下
xcat masterhostname: xcatip: 192.168.31.102xcat nodehostname: xcat1ip: 192.168.31.251
具體操作步驟如下:
### 配置xCAT基本信息
~~~
chtab key=master site.value=192.168.31.102
chtab key=domain site.value=xcatdomain # 根據具體情況配置,這個屬性最后會被寫到每個node的/etc/resolv.conf文件里
chtab key=nameservers site.value=192.168.31.102 # 根據具體情況配置,這個屬性最后會被寫到每個node的/etc/resolv.conf文件里
chtab key=forwarders site.value=192.168.31.1
~~~
另外用”tabdump networks”命令來檢查一下networks表信息是否和上面site表的信息一致,如果不一致可以使用下面的命令修改
~~~
chtab netname=192_168_31_0-255_255_255_0 \
networks.net=192.168.31.0 \
networks.mask=255.255.255.0 \
networks.gateway=192.168.31.1 \
networks.dhcpserver=192.168.31.102 \
networks.tftpserver=192.168.31.102 \
networks.nameservers=192.168.31.102 \
networks.ntpservers=192.168.31.102
~~~
### 配置Password
可以使用“tabdump passwd”查看
~~~
chtab key=system passwd.username=root passwd.password=Letmein
~~~
### 配置Host
~~~
makehosts
~~~
配置后/etc/hosts文件內容大致如下
~~~
127.0.0.1 localhost
192.168.31.102 xcat xcat.xcatdomain
~~~
- 注意xcat master必須配置進去,因為 makedns 命令要求管理節點必須是domain的一部分,所以如果沒有需要手動添加。
### 配置DNS
~~~
makedns -n
service named restart
~~~
### 配置DHCP
~~~
makedhcp -n
~~~
- 如果此時dhcp服務不能啟動,編輯/etc/init.d/dhcpd文件,將
~~~
user=dhcpd
group=dhcpd
改為
user=root
group=root
~~~
然后重新啟動dhcpd服務
~~~
/etc/init.d/dhcpd restart
~~~
### 創建本地操作系統安裝文件
~~~
copycds -n centos5.11 -a x86_64 CentOS-5.11-x86_64-bin-DVD-1of2.iso CentOS-5.11-x86_64-bin-DVD-2of2.iso
copycds -n centos6.6 -a x86_64 CentOS-6.6-x86_64-bin-DVD1.iso CentOS-6.6-x86_64-bin-DVD2.iso
copycds /appstore/iso/rhel-server-6.5-x86_64-dvd.iso
~~~
添加完成后可以使用下面命令來查看
~~~
lsdef -t osdistro
lsdef -t osimage
~~~
### 配置節點
~~~
nodeadd xcat1 \
groups=compute,all \
mac.interface=eth0 \
mac.mac=08:00:27:2C:30:8C \
hosts.ip=192.168.31.251 \
noderes.netboot=pxe \
noderes.xcatmaster=192.168.31.102 \
noderes.installnic=eth0 \
noderes.primarynic=eth0 \
noderes.nfsserver=192.168.31.102 \
nodetype.os=centos6.6 \
nodetype.arch=x86_64 \
nodetype.profile=compute \
nodetype.nodetype=osi
~~~
添加完成后可以使用下面的命令來查看各種信息
~~~
tabdump nodelist
tabdump nodetype
tabdump noderes
tabdump mac
tabdump hosts
~~~
然后運行下面命令
~~~
makehosts xcat1
makedhcp xcat1
~~~
### 設置部署系統
~~~
nodeset xcat1 osimage=centos5.11-x86_64-install-compute
~~~
由于使用的是虛擬機做測試,沒有IPMI功能,所以我們只能手動啟動xcat1機器,然后就會發現xcat1進入自動安裝系統了。
如果有物理機支持IPMI功能,可以參考我前面發的另一篇博客
[xCAT 通過 IPMI 遠程部署安裝操作系統](http://blog.csdn.net/kongxx/article/details/44181711)
轉載請以鏈接形式標明本文地址
本文地址:[http://blog.csdn.net/kongxx/article/details/44572255](http://blog.csdn.net/kongxx/article/details/44572255)