xCAT 是一个集群管理工具,xCAT 能提供云、集群、HPC、系统网络、数据中心、在线游戏基础设施的管理。
xCAT 使管理员能够:
1 发现硬件服务器
2 执行远程系统管理
3 在物理机或虚拟机上配置操作系统
4 准备机器的 Diskful(有状态)和 Diskless(无状态)
5 安装和配置用户应用程序
6 并行系统管理
IPADDR hostname 介绍
192.168.3.30 master 主节点 Centos7.9系统
192.168.3.201 node01 从节点 Centos7.9 系统
wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat
chmod +x /tmp/go-xcat
/tmp/go-xcat install
可以通过以下步骤快速验证xCAT安装:
获取配置文件以将xCAT命令添加到您的路径中:
source /etc/profile.d/xcat.sh
lsxcatd -a
tabdump site
service xcatd start
systemctl start xcatd.service
tabprune networks -a #删除初始数据
chtab netname= 192_168_3_0-255_255_255_0 networks.net=192.168.3.0 networks.mask=255.255.255.0 networks.gateway=192.168.3.1 networks.dhcpserver=192.168.3.1 networks.tftpserver=192.168.3.1 networks.nameservers=192.168.3.1 networks.ntpservers=192.168.3.1
Note:以上这条巨长的命令是连着的,不要乱加回车
mv /etc/ntp.conf /etc/ntp.conf.bak
vi /etc/ntp.conf
以下内容粘贴进去
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
server 127.127.1.0 #使用本地的时间
fudge 127.127.1.0 stratum 10 #服务器的层级。作为局域网的时间同步
restrict ::1
includefile /etc/ntp/crypto/pwkeys
/etc/ntp/keys
disable monitor
server 192.168.3.1 # added by /sbin/dhclient-script
systemctl enable ntpd.service
service ntpd restart
ntpdate -u 192.168.3.30
Note:出问题查https://blog.csdn.net/weixin_34618526/article/details/112577185
chtab key=ntpservers site.value=192.168.3.30
chtab key=domain site.value=test.com
chtab key=nameservers site.value=192.168.3.30
#根据具体情况配置,这个属性最后会被写到每个node的/etc/resolv.conf文件里
chtab key=forwarders site.value=192.168.3.1
tabdump site
tabdump postscripts
chtab node=xcatdefaults postscripts.postscripts="syslog,remoteshell,syncfiles,setupntp"
chtab node=compute postscripts.postscripts="hardeths,configRSH,configService,configNFS,setupGang,reboot "
Note:设置 DNS 如果系统中安装了 bind-chroot 的软件包,会与想 xCAT 冲突,所以如果安装了 bind-chroot 需要把它卸载掉:
rpm -qa | grep bind-chroot
rpm -e bind-chroot
配置network表
vi /etc/sysconfig/network
将以下内容粘贴进去:
# Created by anaconda
NETWORKING=yes
HOSTNAME=master
DOMAINNAME=test.com
配置rc.loacl表
vi /etc/rc.local
将以下内容粘贴进去
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
/bin/domainname test.com
配置hosts表
vi /etc/hosts
127.0.0.1 localhost
192.168.3.30 master master.test.com
192.168.3.201 node01 node01.test.com
配置resolv.conf
vi /etc/resolv.conf
#Generated by NetworkManager
search test.com
nameserver 192.168.3.30
重启named服务
systemctl restart named
chkconfig named on
nslookup node01
结果:
192.168.3.30 master master.test.com
192.168.3.201 node01 node01.test.com
Server: 192.168.3.30
Address: 192.168.3.30#53
Name: node01.test.com
Address: 192.168.3.201
3.4 定义计算节点
chtab node=node01 nodelist.groups=compute,all
nodeadd node01 groups=compute,all mac.interface=ens33 hosts.ip=192.168.3.201 mac.mac=00:0c:29:dd:cd:34 nodehm.mgt=ipminodehm.power=ipmi
makehosts -n
makedhcp -n
chkconfig dhcpd on
设置 noderes 表
chtab node=node01 noderes.netboot=pxe noderes.xcatmaster=192.168.3.30 noderes.installnic=ens33 noderes.primarynic=ens33 noderes.nfsserver=192.168.3.30
设置 nodetype 表
chtab node=node01 nodetype.os=centos7.9 nodetype.arch=x86_64 nodetype.profile=compute nodetype.nodetype=osi
配置passwd表
chtab key=system passwd.username=root passwd.password=Admin@123
chtab key=blade passwd.username=USERID passwd.password=PASSWORD
chtab key=ipmi passwd.username=USERID passwd.password=PASSWORD
配置 DHCP
chtab key=dhcpinterfaces site.value='192.168.3.30|ens33'
makedhcp compute
systemctl restart dhcpd
实现定制安装
vim /opt/xcat/share/xcat/install/rh/compute.tmpl
确定如下配置注释掉
#cmdline
#langsupport en_US
# firewall –disabled
#mouse none
# selinux –disabled
# %packages ### 删掉 –resolvedeps
修改 kickstart 文件
cd /opt/xcat/share/xcat/install/rh
cp compute.rhels7.tmpl compute.centos7.9.tmpl
cp compute.rhels7.pkglist compute.centos7.9.pkglist
复制安装文件
cd /mnt/iso/
copycds CentOS-7-x86_64-DVD-2009.iso
第4章 系统分发安装
4.1分发安装
nodeset node01 osimage=centos7.9-x86_64-install-compute
至此,xcat分发部署节点1完成
4.2 测试安装
nodestat node01
node01: sshd ##说明安装成功
Centos系统镜像:http://mirrors.aliyun.com/centos/7/isos/x86_64/
Xcat官方文档:https://xcat-docs.readthedocs.io/en/stable/overview/index.html
常见报错_NTP同步常见报错之no server suitable for synchrnization found
ntp server 配置参数_安装配置NTP服务器详解
搭建linux时钟同步服务器,Linux时间同步服务器搭建
使用xcat部署系统_使用xCAT和TORQUE进行动态服务器配置
XCAT在虚拟机上部署系统
xcat 安装(liunx高性能刀片集群管理软件)
xCAT安装指南
利用xCAT在kylin系统上自动批量部署系统
PXE高效批量网络装机