现在vmware上建立管理节点mgmt,内网ip设为192.168.1.1,对应网卡为eth1,外网ip设为192.168.8.50,对应网卡为eth0
然后下载xcat的两个包,
xcat-core-2.6.10.tar.bz2 xcat-dep-201202211937.tar.bz2
上传到服务器上,解压缩之后。
cd xcat-dep/rh5/x86_64 ./mklocalrepo.sh cd http://www.cnblogs.com/.. cd xcat-core/ ./mklocalrepo.sh
建立本地的安装源,然后挂载系统镜像到cdrom,通过yum install xCAT.x86_64安装xcat。安装完以后
source /etc/profile.d/xcat.sh
导入xcat环境变量,并且通过
tabedit site #key,value,comments,disable "xcatdport","3001",, "xcatiport","3002",, "tftpdir","/tftpboot",, "master","(xcat_int_ip)",, "domain","(cluster_dom)",, "installdir","/install",, "timezone","America/Denver",, "nameservers","(xcat_int_ip)",, "forwarders","(dns_ext_ip)" "dhcpinterfaces","eth1" "ntpservers","(xcat_int_ip)"
来修正参数
之后,通过
tabedit networks #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,dynamicrange,nodehostname,ddnsdomain,vlanid,domain,comments,disable internal,"192.168.1.1","255.255.255.0","eth1","192.168.1.1","192.168.1.1","192.168.1.1","192.168.1.1",,,"192.168.1.200-192.168.1.250",,,,"chess",, external,"192.168.8.0","255.255.255.0","eth0",,,,"192.168.8.50",,,,,,
来设定内外网环境。
设完网络环境之后,设置机器组的参数,包括启动方式,root及密码,还有安装的系统等等。
chdef -t group -o compute netboot=pxe tftpserver=(xcat_int_ip) nfsserver=(xcat_int_ip) installnic=eth1 primarynic=eth1 chtab key=system passwd.username=root passwd.password=cluster chdef -t group -o compute os=centos5 arch=x86_64 profile=compute nodetype=osi chdef -t group -o compute chain="runcmd=standby" ondiscover=nodediscover
设置ntp服务器
service ntpd restart chkconfig ntpd --level 345 on
将ntp服务器设置添加进安装脚本中
chdef -p -t group -o compute postscripts=setupntp
随后逐台添加,由于虚拟机上没有ipmi,所以必须手动添加每台机器。
nodeadd node01 groups=compute,all mac.interface=eth1 hosts.ip=x.x.x.x mac.mac=00:00:00:00:00:00 nodehm.mgt=ipmi nodehm.power=ipmi
然后更新hosts文件,
makehosts all
创建及更新dhcp文件
makedhcp -n makedhcp all service dhcpd restart
将dhcpd设为默认启动
chkconfig --level 345 dhcpd on
添加管理节点的dns服务器
vi /etc/resolv.conf search (xcat_dom) nameserver (xcat_int_ip),8.8.8.8
并且在管理节点上开启dns服务器
makedns -n
makedns makedns all service named restart
并且设为默认启动
chkconfig --level 345 named on
最后,将iso复制出来
copycds -n rhel5.7 -a x86_64 rhel-server-5.7-x86_64-dvd.iso
设置tftp启动用的文件
mknb x86_64
然后,由于虚拟机没有ipmi,没法通过rinstall node01安装节点,所以必须手动启动该机器。但接下去都是自动完成的。
开启路由功能
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE