大家好,欢迎来到IT知识分享网。
一、配置信息
实验环境VMware Workstation
主机名
|
IP地址
|
网口/MAC
|
xcat
|
192.168.10.10
|
ens33 |
node01 |
192.168.10.11
|
eth1 (00:0C:29:ED:E9:8E)
|
二、xcat环境安装配置
首先需要xcat安装好操作系统
1、禁用selinux、防火墙
sed -i ‘s/=enforcing/=disabled/’ /etc/sysconfig/selinux
systemctl disable firewalld
systemctl stop firewalld
2、创建目录上传xcat安装包
[root@xcat ~]#mkdir /app
3、创建本地yum
[root@xcat ~]# mount /dev/cdrom /mnt
[root@xcat ~]# cat /etc/yum.repos.d/local.repo
[local_base]
name=rhel7
baseurl=file:///mnt
enabled=1
gpgkey=file:///mnt/RPM-GPG-KEY-redhat-release
gpgcheck=0
[root@xcat ~]# yum clean all
[root@xcat ~]# yum makecache
4、安装bzip2工具,解压xcat安装包
[root@xcat ~]# yum install -y bzip2
[root@xcat ~]# tar -jxf xcat-core-2.14.5-linux.tar.bz2
[root@xcat ~]# tar -jxf xcat-dep-201811190436.tar.bz2
5、生成xcat的repo文件,并安装
[root@xcat xcat-core]# pwd
/app/xcat-core
[root@xcat xcat-core]# ./mklocalrepo.sh
/app/xcat-core/
[root@xcat x86_64]# pwd
/app/xcat-dep/rh7/x86_64
[root@xcat x86_64]# ./mklocalrepo.sh
/app/xcat-dep/rh7/x86_64
[root@xcat ~]# yum install xCAT
安装如下图,输入2次y确认。
6、确认xcat安装是否正常
[root@xcat ~]# source /etc/profile.d/xcat.sh
[root@xcat ~]# tabdump site
#key,value,comments,disable
“blademaxp”,”64″,,
“fsptimeout”,”0″,,
“installdir”,”/install”,,
“ipmimaxp”,”64″,,
“ipmiretries”,”3″,,
“ipmitimeout”,”2″,,
“consoleondemand”,”no”,,
“master”,”10.1.1.11″,, # 应该为xcat的ip
“nameservers”,”10.1.1.11″,, # 应该为xcat的ip
“maxssh”,”8″,,
“ppcmaxp”,”64″,,
“ppcretry”,”3″,,
“ppctimeout”,”0″,,
“powerinterval”,”0″,,
“syspowerinterval”,”0″,,
“sharedtftp”,”1″,,
“SNsyncfiledir”,”/var/xcat/syncfiles”,,
“tftpdir”,”/tftpboot”,,
“xcatdport”,”3001″,,
“xcatiport”,”3002″,,
“xcatconfdir”,”/etc/xcat”,,
“timezone”,”America/Los_Angeles”,,
“useNmapfromMN”,”no”,,
“enableASMI”,”no”,,
“db2installloc”,”/mntdb2″,,
“databaseloc”,”/var/lib”,,
“sshbetweennodes”,”ALLGROUPS”,,
“dnshandler”,”ddns”,,
“vsftp”,”n”,,
“cleanupxcatpost”,”no”,,
“dhcplease”,”43200″,,
7、配置xcat的相关服务(集群服务包括:network服务、NTP服务、DNS服务、集群管理服务)
# 配置networks表
[root@xcat ~]# tabdump networks
#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable
“192_168_10_0-255_255_255_0″,”192.168.10.0″,”255.255.255.0″,”ens33″,”192.168.10.1″,”192.168.10.10″,”192.168.10.10″,,”192.168.10.10″,”192.168.10.10″,,,,,,,,”1500”,,
//注:直接用tabedit networks修改
# 配置NTP(网络时间同步)
yum install -y ntp
systemctl enable ntpd
systemctl restart ntpd
[root@xcat ~]# cat /etc/ntp.conf
server 192.168.10.10
fudge 192.168.10.10 stratum 10
我们需要将ntp服务器记录到site表里:
[root@xcat ~]# chtab key=ntpservers site.value=10.1.1.11
执行tabdump site查看确认
如果希望xcat安装的节点也自动设置好NTP服务,需要在postscripts表中加入setupntp的脚本:
[root@xcat ~]# tabdump postscripts
#node,postscripts,postbootscripts,comments,disable
“xcatdefaults”,”syslog,remoteshell,syncfiles”,”otherpkgs”,,
“service”,”servicenode”,,,
[root@xcat ~]# chtab node=xcatdefaults postscripts.postscripts=syslog,remoteshell,setupntp
# 设置DNS
如果系统中安装了bind-chroot的软件包,会与想xCAT冲突,所以如果安装了bind-chroot需要把它卸载掉:
[root@xcat ~]# rpm -qa |grep bind-chroot
[root@xcat ~]# rpm -e bind-chroot
在site表中定义DNS服务器Ip地址为192.168.10.10,域名为cluster.com
[root@xcat ~]# cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=xcat
DOMAINNAME=cluster.com
//设置开机启动完成后自动设置域名
[root@xcat ~]# cat /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 cluster.com
[root@xcat ~]# chtab key=domain site.value=cluster.com
配置DNS解析,编辑/etc/hosts,把集群中所有节点都加进去:
[root@xcat ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.10 xcat
192.168.10.11 node01
执行DNS配置生成命令:
[root@xcat ~]# makedns -n
Handling localhost in /etc/hosts.
Handling localhost in /etc/hosts.
Handling master in /etc/hosts.
Handling node01 in /etc/hosts.
Getting reverse zones, this may take several minutes in scaling cluster.
Completed getting reverse zones.
Updating zones.
Completed updating zones.
Starting named complete
Restarting named
Restarting named complete
Updating DNS records, this may take several minutes in scaling cluster.
Completed updating DNS records.
named has been enabled on boot.
DNS setup is completed
配置/etc/resolv.conf,把nameserver指向管理服务器自己
[root@xcat ~]# vi /etc/resolv.conf
search cluster.com
nameserver 10.1.1.11
启动DNS服务,并设置开机自启动
[root@xcat ~]# systemctl restart named
[root@xcat ~]# systemctl enable named
运行nslookup node01来检查能否正常解析:
[root@xcat ~]# nslookup node01
Server: 10.1.1.11
Address: 10.1.1.11#53
Name: node01.cluster.com
Address: 10.1.1.12
定义计算节点
[root@xcat ~]# tabdump nodelist
#node,groups,status,statustime,appstatus,appstatustime,primarysn,hidden,comments,disable
[root@xcat ~]# chtab node=node01 nodelist.groups=compute,all
[root@xcat ~]# tabdump nodelist
#node,groups,status,statustime,appstatus,appstatustime,primarysn,hidden,comments,disable
“node01″,”compute,all”,,,,,,,,
添加MAC表
[root@xcat ~]# tabdump mac
#node,interface,mac,comments,disable
[root@xcat ~]# nodeadd node01 groups=compute,all mac.interface=eth1 hosts.ip=192.168.10.11 mac.mac=00:0C:29:ED:E9:8E nodehm.mgt=ipmi nodehm.power=ipmi
[root@xcat ~]# tabdump mac
#node,interface,mac,comments,disable
“node01″,”eth1″,”00:0C:29:ED:E9:8E”,,
[root@xcat ~]# tabdump hosts
#node,ip,hostnames,otherinterfaces,comments,disable
“node01″,”192.168.10.11”,,,,
[root@xcat ~]# makehosts
[root@xcat ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.10 xcat
192.168.10.11 node01 node01.cluster.com # 多加了这个
[root@xcat ~]# makehosts -n
Renamed existing dhcp configuration file to /etc/dhcp/dhcpd.conf.xcatbak
The dhcp server must be restarted for OMAPI function to work
Warning: [xcat]: No dynamic range specified for 192.168.10.0. If hardware discovery is being used, a dynamic range is required.
[root@xcat ~]# cat /etc/hosts
127.0.0.1 localhost
192.168.10.11 node01 node01.cluster.com
[root@xcat ~]#systemctl enable dhcpd
设置noders表,在noders表中,定义计算节点node01的引导方式是pxe,管理节点是192.168.10.10,安装使用的网卡是ens33,系统的主网卡也是ens33,nfs服务器是192.168.10.10
[root@xcat ~]# tabdump noderes
#node,servicenode,netboot,tftpserver,tftpdir,nfsserver,monserver,nfsdir,installnic,primarynic,discoverynics,cmdinterface,xcatmaster,current_osimage,next_osimage,nimserver,routenames,comments,disable
[root@xcat ~]# chtab node=node01 noderes.netboot=pxe noderes.xcatmaster=192.168.10.10 noderes.installnic=ens33 noderes.primarynic=ens33 noderes.nfsserver=192.168.10.10
[root@xcat ~]# tabdump noderes
#node,servicenode,netboot,tftpserver,tftpdir,nfsserver,monserver,nfsdir,installnic,primarynic,discoverynics,cmdinterface,xcatmaster,current_osimage,next_osimage,nimserver,routenames,nameservers,proxydhcp,syslog,comments,disable
“node01″,,”pxe”,,,”192.168.10.10″,,,”ens33″,”ens33″,,,”192.168.10.10″,,,,,,,,,
设置nodetype表,定义计算节点node01的操作系统是rhels7.4,架构是x86_64,使用的profile是computer
[root@xcat ~]# tabdump nodetype
#node,os,arch,profile,provmethod,supportedarchs,nodetype,comments,disable
[root@xcat ~]# chtab node=node01 nodetype.os=rhels7.4 nodetype.arch=x86_64 nodetype.profile=compute nodetype.nodetype=osi
[root@xcat ~]# tabdump nodetype
#node,os,arch,profile,provmethod,supportedarchs,nodetype,comments,disable
“node01″,”rhels7.4″,”x86_64″,”compute”,,,”osi”,,
定义postscripts表
[root@xcat ~]# chtab node=xcatdefaults postscripts.postscripts=”syslog,remoteshell,syncfiles,setupntp”
[root@xcat ~]# chtab node=compute postscripts.postscripts=”hardeths,configRSH,configService,configNFS”
[root@xcat ~]# tabdump postscripts
#node,postscripts,postbootscripts,comments,disable
“xcatdefaults”,”syslog,remoteshell,syncfiles,setupntp”,”otherpkgs”,,
“service”,”servicenode”,,,
“compute”,”hardeths,configRSH,configService,configNFS”,,,
[root@xcat ~]# chtab node=compute postscripts.postscripts=”setupGang,reboot”
[root@xcat ~]# tabdump postscripts
#node,postscripts,postbootscripts,comments,disable
“xcatdefaults”,”syslog,remoteshell,syncfiles,setupntp”,”otherpkgs”,,
“service”,”servicenode”,,,
“compute”,”setupGang,reboot”,,,
配置passwd表
[root@xcat ~]# chtab key=system passwd.username=root passwd.password=123.asd
[root@xcat ~]# chtab key=blade passwd.username=USERID passwd.password=PASSWORD
[root@xcat ~]# chtab key=ipmi passwd.username=USERID passwd.password=PASSWORD
# 注:我觉着可以不用,因为在虚拟机下没有管理模块,blade(刀片)、ipmi(智能平台管理接口),如果是IBM的机架和刀片服务器就可以用了
[root@xcat ~]# tabdump passwd
#key,username,password,cryptmethod,comments,disable
“omapi”,”xcat_key”,”cmhVQUdPcXR2OXVZbHlUQW9jZXlpclRKSW9wb0NIQnc=”,,,
“system”,”root”,”123.asd”,,,
“blade”,”USERID”,”PASSWORD”,,,
“ipmi”,”USERID”,”PASSWORD”,,,
配置DHCP
[root@xcat ~]# chtab key=dhcpinterfaces site.value=’192.168.10.10|ens33′
[root@xcat ~]# makedhcp compute
[root@xcat ~]# systemctl restart dhcpd
复制安装文件
[root@xcat ~]# copycds rhel-server-7.4-x86_64-dvd.iso
Copying media to /install/rhels7.4/x86_64
0.00%
0.02%
……
99.98%
Media copy operation successful
开启http服务
[root@xcat ~]# systemctl restart httpd
实现定制安装,修改/opt/xcat/share/xcat/install/rh/compute.tmpl,确定如下几项
[root@xcat ~]# cat /opt/xcat/share/xcat/install/rh/compute.tmpl
#egan@us.ibm.com
#
#cmdline //注释掉该行
lang en_US
langsupport en_US
network –bootproto dhcp
#
# Where’s the source?
# nfs –server hostname.of.server or IP –dir /path/to/RH/CD/image
#
#nfs –server #XCATVAR:INSTALL_NFS# –dir #XCATVAR:INSTALL_SRC_DIR#
#url –url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch#
#INSTALL_SOURCES#
#device ethernet e100
keyboard “us”
#
# Clear the MBR
#
zerombr yes
#
# Wipe out the disk
#
clearpart –all –initlabel
#clearpart –linux
key –skip
#
# Customize to fit your needs
#
#XCAT_PARTITION_START#
#No RAID
#/boot really significant for this sort of setup nowadays?
#part /boot –size 50 –fstype ext3
part swap –size 1024
part / –size 1 –grow –fstype ext3
#XCAT_PARTITION_END#
#RAID 0 /scr for performance
#part / –size 1024 –ondisk sda
#part swap –size 512 –ondisk sda
#part /var –size 1024 –ondisk sdb
#part swap –size 512 –ondisk sdb
#part raid.01 –size 1 –grow –ondisk sda
#part raid.02 –size 1 –grow –ondisk sdb
#raid /scr –level 0 –device md0 raid.01 raid.02
#Full RAID 1 Sample
#part raid.01 –size 50 –ondisk sda
#part raid.02 –size 50 –ondisk sdb
#raid /boot –level 1 –device md0 raid.01 raid.02
#
#part raid.11 –size 1024 –ondisk sda
#part raid.12 –size 1024 –ondisk sdb
#raid / –level 1 –device md1 raid.11 raid.12
#
#part raid.21 –size 1024 –ondisk sda
#part raid.22 –size 1024 –ondisk sdb
#raid /var –level 1 –device md2 raid.21 raid.22
#
#part raid.31 –size 1024 –ondisk sda
#part raid.32 –size 1024 –ondisk sdb
#raid swap –level 1 –device md3 raid.31 raid.32
#
#part raid.41 –size 1 –grow –ondisk sda
#part raid.42 –size 1 –grow –ondisk sdb
#raid /scr –level 1 –device md4 raid.41 raid.42
#
# bootloader config
# –append <args>
# –useLilo
# –md5pass <crypted MD5 password for GRUB>
#
bootloader
#
# install or upgrade
#
install
#
# text mode install (default is graphical)
#
text
#
# firewall
#
firewall –disabled
#
# mouse selection
#
#mouse genericps/2 –emulthree
mouse none
#
# Select a zone
# Add the –utc switch if your hardware clock is set to GMT
#
#timezone US/Hawaii
#timezone US/Pacific
#timezone US/Mountain
#timezone US/Central
#timezone US/Eastern
timezone –utc “#TABLE:site:key=timezone:value#”
#
# Don’t do X
#
skipx
#
# To generate an encrypted root password use:
#
# perl -e ‘print crypt(“blah”,”Xa”) . “\n”;’p
# openssl passwd -apr1 -salt xxxxxxxx password
#
# where “blah” is your root password.
#
#rootpw –iscrypted XaLGAVe1C41x2
#rootpw XaLGAVe1C41x2 –iscrypted
rootpw –iscrypted #CRYPT:passwd:key=system,username=root:password#
#
# NIS setup: auth –enablenis –nisdomain sensenet
# –nisserver neptune –useshadow –enablemd5
#
# OR
auth –useshadow –enablemd5
#
# SE Linux
#
selinux –disabled
#
# Reboot after installation
#
reboot
#
#end of section
#
%packages –resolvedeps
#INCLUDE_DEFAULT_PKGLIST#
%pre
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh#
%post
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
修改kickstart文件
[root@xcat rh]# pwd
/opt/xcat/share/xcat/install/rh
[root@xcat rh]# cp compute.rhels7.tmpl compute.rhels7.4.tmpl
[root@xcat rh]# cp compute.rhels7.pkglist compute.rhels7.4.pkglist
开始分发
[root@xcat rh]# lsdef -t osimage
rhels7.4-x86_64-install-compute (osimage)
rhels7.4-x86_64-install-service (osimage)
rhels7.4-x86_64-netboot-compute (osimage)
rhels7.4-x86_64-stateful-mgmtnode (osimage)
rhels7.4-x86_64-statelite-compute (osimage)
[root@xcat rh]# nodeset node01 osimage=rhels7.4-x86_64-install-compute
node01: install rhels7.4-x86_64-compute
查看node节点的安装状态
[root@master ~]# nodestat node01
node01: sshd # 说明安装成功
备注:由于是虚拟机,没有IPMI功能,可手动重启,开始进入自动安装状态。
df -h可看到/dev/mapper/system-root
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/30379.html