首先我們假定兩臺機器,機器名和ip地址分別如下
~~~
xcat master
hostname: xcat
ip: 192.168.31.102
xcat node
hostname: xcat1
ip: 192.168.31.251
~~~
具體操作步驟如下:
1. 創建本地操作系統安裝文件
~~~
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
~~~
2. 配置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
~~~
3. 配置password,可以使用“tabdump passwd”查看
~~~
chtab key=system passwd.username=root passwd.password=Letmein
~~~
4. 配置節點
~~~
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
~~~
5. 配置host
~~~
makehosts
~~~
配置后/etc/hosts文件內容大致如下
~~~
127.0.0.1 localhost
192.168.31.102 xcat
192.168.31.251 xcat1
~~~
* 注意xcat master必須配置進去,因為 makedns 命令要求管理節點必須是domain的一部分,所以如果沒有需要手動添加。
6. 配置dns
~~~
makedns -n
service named restart
~~~
7. 配置DHCP
~~~
makedhcp -n
~~~
* 編輯/etc/init.d/dhcpd文件,將
~~~
user=dhcpd
group=dhcpd
改為
user=root
group=root
~~~
然后重新啟動dhcpd服務
~~~
/etc/init.d/dhcpd restart
~~~
8. 設置部署系統
~~~
nodeset xcat1 osimage=centos5.11-x86_64-install-compute
~~~
此時可以看到類似下面的輸出結果,說明xcat1機器將會安裝centos6.6-x86_64-compute
~~~
xcat1: install centos6.6-x86_64-compute
~~~
如果我們需要修改安裝的系統可以使用下面的命令來修改
~~~
chtab node=xcat1 \
nodetype.os=centos5.11 \
nodetype.arch=x86_64 \
nodetype.profile=compute \
nodetype.nodetype=osi
nodeset xcat1 install
~~~
此時可以看到xcat1機器將會安裝centos5.11-x86_64-compute
~~~
xcat1: install centos5.11-x86_64-compute
~~~
9. 由于使用的是虛擬機做測試,沒有IPMI功能,所以我們只能手動啟動xcat1機器,然后就會發現xcat1進入自動安裝系統了。