xCat 完整使用方法

xCat 使用方法

新装centos74 作为xcat master, 关闭selinux。
ip:192.168.18.28 hostname:centos74

这里使用的virtualbox虚拟机。

xcat 安装:

  1. 下载安装包:
https://xcat.org/files/xcat/xcat-dep/2.x_Linux/xcat-dep-2.14.2-linux.tar.bz2 
https://xcat.org/files/xcat/xcat-core/2.14.x_Linux/xcat-core/xcat-core-2.14.2-linux.tar.bz2 
  1. 解压:
tar jxvf xcat-core-2.14.2-linux.tar.bz2 
tar jxvf xcat-dep-2.14.2-linux.tar.bz2 
  1. 添加yum源:(根据自己的linux环境选择,我的是redhat6,64位)
cd /root/xcat-dep/rh6/x86_64; ./mklocalrepo.sh
cd /root/xcat-core; ./mklocalrepo.sh
  1. 开始安装:
yum clean metadata
yum install -y xCAT
  1. 检查xCAT是否安装正确:
source /etc/profile.d/xcat.sh
tabdump site

xcat 配置:

配置xcat服务器:

chtab key=master site.value=192.168.18.28  
chtab key=domain site.value=HPC # 根据具体情况配置,这个属性最后会被写到每个node的/etc/resolv.conf文件里 (必须配置)
chtab key=nameservers site.value=192.168.18.28 # 根据具体情况配置,这个属性最后会被写到每个node的/etc/resolv.conf文件里  
chtab key=forwarders site.value=192.168.0.1   

tabdump networks 命令来检查一下networks表信息, 不一致则修改:

chtab netname=192_168_18_0-255_255_255_0 \
    networks.net=192.168.18.0 \
    networks.mask=255.255.255.0 \
    networks.gateway=192.168.0.1 \
    networks.dhcpserver=192.168.18.28 \
    networks.tftpserver=192.168.18.28 \
    networks.nameservers=192.168.18.28 \
    networks.ntpservers=192.168.18.28 

tabdump passwd 查看密码:

chtab key=system passwd.username=root passwd.password=test
chtab key=system passwd.username=Administrator passwd.password=test

配置hosts,可以查看/etc/hosts:

makehosts #配置hosts 
127.0.0.1 localhost  
192.168.18.22 centos74   centos74.HPC

配置DNS:

makedns -n  
service named restart  

配置dhcp,编辑/etc/dhcp/dhcpd.conf文件:

user=dhcpd  
group=dhcpd  
改为  
user=root  
group=root
重启服务:
systemctl restart dhcpd.service 
makedhcp -n

注意:如果存在windows节点,则需要xcat master上配置samba,安装过程需要。

安装samba: yum install samba.
修改/etc/samba/smb.conf的[global]段: security = share。
注意: samba4 设置(需要设置install目录及下所有权限为777):

security = user
map to guest = Bad User 

并增加

[install]
path = /install
public = yes
writable = yes
guest ok = yes 
chkconfig smb on
service smb restart 

新增节点

centos7.4:

hostname: test ip: 192.168.18.29 mac: 080027D59856 内存大于1G

  1. 添加节点:
nodeadd test \
    groups=compute,all \
    mac.interface=enp0s3  \
    mac.mac=08:00:27:D5:98:56 \
    hosts.ip=192.168.18.29 \
    noderes.netboot=pxe \
    noderes.xcatmaster=192.168.18.28 \
    noderes.installnic=enp0s3  \
    noderes.primarynic=enp0s3  \
    noderes.nfsserver=192.168.18.28 \
    nodetype.os=centos7.4 \
    nodetype.arch=x86_64 \
    nodetype.profile=compute \
    nodetype.nodetype=osi 

使用lsdef test查看配置信息。

  1. 添加镜像:
[root@centos74 init.d]# copycds -n centos7 /media/sf_VData/xCat/CentOS-7-x86_64-DVD-1708.iso 
Copying media to /install/centos7/x86_64
Media copy operation successful 

使用lsdef -t osimage 查看, 根据需求修改模板

chdef -t osimage centos7-x86_64-install-compute template=/media/sf_VData/xCat/template/centos7.4/compute.centos7.tmpl
pkglist=/media/sf_VData/xCat/template/centos7.4/compute.centos7.pkglist
  1. 配置其他信息:
makehosts //添加/etc/hosts
makedns test //添加dns
makedhcp test // 配置dhcp
  1. 添加后处理:
tabdump postscripts  //查看后处理配置
添加compute后处理类型:
chtab node=compute  postscripts.postscripts="install_test"
lsdef test可查看是否改变。
创建后处理需要用到的文件目录:
cp * /install/postscripts
权限修改为755
  1. 安装系统:
    nodeset test osimage=centos7-x86_64-install-compute

win7:

hostname: wtest ip: 192.168.18.30 mac: 080027299B89

  1. 添加节点:
nodeadd wtest \
    groups=compute,all \
    mac.interface=enp0s3  \
    mac.mac=08:00:27:29:9B:89 \
    hosts.ip=192.168.18.30 \
    noderes.netboot=pxe \
    noderes.xcatmaster=192.168.18.28 \
    noderes.installnic=enp0s3  \
    noderes.primarynic=enp0s3  \
    noderes.nfsserver=192.168.18.28 \
    nodetype.os=win7 \
    nodetype.arch=x86_64 \
    nodetype.profile=compute \
    nodetype.nodetype=osi
再执行:chdef wtest kernel=Boot/pxeboot.0

使用lsdef wtest查看配置信息。

  1. 添加镜像:
 copycds -n win7 /media/sf_VData/xCat/cn_windows_7_ultimate_x64_dvd_x15-66043.iso 
Copying media to /install/win7/x86_64
Media copy operation successful 
chdef -t osimage win7-x86_64-install-compute \
imagetype=windows \
osarch=x86_64 \
osname=Windows \
osvers=win7 \
profile=ultimate \
provmethod=install \
template=/media/sf_VData/xCat/template/win7/ultimate.win7.x86_64.tmpl

使用lsdef -t osimage 查看

  1. boot程序(之前提前已经做好,不同windows需要制作对应版本boot,需要添加网络驱动,参照官网)
[root@centos74 tftpboot]# ls /media/sf_VData/xCat/template/win7/startBoot/*
/media/sf_VData/xCat/template/win7/startBoot/bootmgr.exe
/media/sf_VData/xCat/template/win7/startBoot/Boot:
BCD     BCD.64.LOG   BCD.64.LOG2   bootmgr.efi  Fonts      wdsmgfw.efi
BCD.64  BCD.64.LOG1  bootmgfw.efi  boot.sdi     pxeboot.0  WinPE_64.wim 
[root@centos74 tftpboot]# cp /media/sf_VData/xCat/template/win7/startBoot/* . -r

注意修改权限为755.

  1. 配置其他信息:
makehosts //添加/etc/hosts
makedns test //添加dns
makedhcp test // 配置dhcp
  1. 添加后处理:
创建后处理需要用到的文件目录:
cp * /install/winpostscripts
权限修改为755
  1. 添加驱动:
    将驱动拷贝到/install/drivers/
  2. 安装系统:
    nodeset test osimage=win7-x86_64-install-compute

  3. /install/autoinst目录下,对应的$IP.cmd 需要添加:
...
copy %instdrv%\winpostscripts\* c:\xcatpost\^M
copy %instdrv%\mypostscripts\mypostscript.htest c:\xcatpost\^M
goto up
:SKIPPOST^M
reg load HKLM\csystem c:\windows\system32\config\system^M 
...

问题总结:

  1. bios需要启用pxe boot并且设置从网路启动
  2. 提示succeed to downloadn NBP file。但是没有执行安装而正常启动,则需要开启legacy mode。

猜你喜欢

转载自www.cnblogs.com/fanxiaowei/p/9505200.html
今日推荐