본문 바로가기
HPC/클러스터

xCAT 2.16.1 on CentOS 7.8 으로 ubuntu 16.04.1 Desktop 배포하기

by mirhenge 2020. 12. 8.

 

xCAT 2.16.1 on CentOS 7.8

 

환경

xCAT 서버 버전 : CentOS Linux release 7.9.2009 (Core)

[root@xcatmgt01 /]# uname -a

Linux xcatmgt01 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

[root@xcatmgt01 /]#

외부 IP : 192.168.70.21/24

내부 관리 IP : 10.10.10.21/24

 

Ubuntu Desktop 버전 정보

root@node04:~# uname -a

Linux node04 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

root@node04:~# lsb_release -a

No LSB modules are available.

Distributor ID:     Ubuntu

Description:        Ubuntu 16.04.1 LTS

Release: 16.04

Codename:        xenial

root@node04:~#

 

Required rpm list

- dhcp, 
- bind (not bind-chroot), 
- httpd, 
- nfs-utils,
- perl-XML-Parser

Disable Service

NetworkManager Disable

Selinux Disable

 

 

1.     xCAT 설치에 필요한 환경구성

l  Package 설치

yum install dhcp bind httpd nfs-utils perl-XML-Parser -y

l  Local repo 구성

-      CentOS 의 경우 외부 인터넷 라인이 연결 되었을 경우 별도 필요 없음

l  호스트파일 설정

[root@xcatmgt01 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 

10.10.10.21 xcatmgt xcatmgt.dell.net

[root@xcatmgt01 ~]#

 

l  xCAT 파일 설치

[root@xcatmgt01 xCAT]# ls

xcat-core-2.16.1-linux.tar.bz2  xcat-dep-2.16.1-linux.tar.bz2

[root@xcatmgt01 xCAT]#

[root@xcatmgt01 xCAT]# tar jxf xcat-core-2.16.1-linux.tar.bz2

[root@xcatmgt01 xCAT]# tar jxf xcat-dep-2.16.1-linux.tar.bz2

[root@xcatmgt01 xCAT]#

[root@xcatmgt01 xCAT]# cd xcat-dep/rh

rh7/ rh8/

[root@xcatmgt01 xCAT]# cd xcat-dep/rh7/x86_64/

[root@xcatmgt01 x86_64]# ./mklocalrepo.sh

/root/xCAT/xcat-dep/rh7/x86_64

[root@xcatmgt01 ~]# cd xCAT/xcat-core/

[root@xcatmgt01 xcat-core]#

[root@xcatmgt01 xcat-core]# yum clean metadata

Loaded plugins: fastestmirror, langpacks

Cleaning repos: base extras updates xcat-dep

12 metadata files removed

8 sqlite files removed

0 metadata files removed

[root@xcatmgt01 xcat-core]# ./mklocalrepo.sh

/root/xCAT/xcat-core

[root@xcatmgt01 xcat-core]# yum install xCAT -y

2.     xCAT 환경 설정

[root@xcatmgt01 xcat-core]# source /etc/profile.d/xcat.sh

[root@xcatmgt01 xcat-core]# systemctl stop firewalld

[root@xcatmgt01 xcat-core]# systemctl start xcatd

[root@xcatmgt01 ~]# chdef -t site domain=dell.net

1 object definitions have been created or modified.

[root@xcatmgt01 ~]# chdef -t site forwarders=1.2.3.4,1.2.5.6

1 object definitions have been created or modified.

[root@xcatmgt01 ~]# ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever

2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:da:4b:e2 brd ff:ff:ff:ff:ff:ff

    inet 192.168.70.21/24 brd 192.168.70.255 scope global ens33

       valid_lft forever preferred_lft forever

    inet6 fe80::20c:29ff:feda:4be2/64 scope link

       valid_lft forever preferred_lft forever

3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:0c:29:da:4b:ec brd ff:ff:ff:ff:ff:ff

    inet 10.10.10.21/24 brd 10.10.10.255 scope global ens34

       valid_lft forever preferred_lft forever

    inet6 fe80::20c:29ff:feda:4bec/64 scope link

       valid_lft forever preferred_lft forever

4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000

    link/ether 52:54:00:a6:19:4b brd ff:ff:ff:ff:ff:ff

    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

       valid_lft forever preferred_lft forever

5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000

    link/ether 52:54:00:a6:19:4b brd ff:ff:ff:ff:ff:ff

 

l  site tab 설정변경

[root@xcatmgt01 ~]# chdef -t site master=10.10.10.21 nameservers=10.10.10.21 dhcpinterfaces=ens34

1 object definitions have been created or modified.

[root@xcatmgt01 ~]# tabdump site

#key,value,comments,disable

"blademaxp","64",,

"fsptimeout","0",,

"installdir","/install",,

"ipmimaxp","64",,

"ipmiretries","3",,

"ipmitimeout","2",,

"consoleondemand","no",,

"master","10.10.10.21",,

"forwarders","1.2.3.4,1.2.5.6",,

"nameservers","10.10.10.21",,

"maxssh","8",,

"ppcmaxp","64",,

"ppcretry","3",,

"ppctimeout","0",,

"powerinterval","0",,

"syspowerinterval","0",,

"sharedtftp","1",,

"SNsyncfiledir","/var/xcat/syncfiles",,

"nodesyncfiledir","/var/xcat/node/syncfiles",,

"tftpdir","/tftpboot",,

"xcatdport","3001",,

"xcatiport","3002",,

"xcatconfdir","/etc/xcat",,

"timezone","Asia/Seoul",,

"useNmapfromMN","no",,

"enableASMI","no",,

"db2installloc","/mntdb2",,

"databaseloc","/var/lib",,

"sshbetweennodes","ALLGROUPS",,

"dnshandler","ddns",,

"vsftp","n",,

"cleanupxcatpost","no",,

"dhcplease","43200",,

"auditnosyslog","0",,

"auditskipcmds","ALL",,

"domain","dell.net",,

"dhcpinterfaces","ens34",,

[root@xcatmgt01 ~]# tabdump networks

#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable

"10_10_10_0-255_255_255_0","10.10.10.0","255.255.255.0","ens34","<xcatmaster>",,"<xcatmaster>",,,,,,,,,,,"1500",,

"192_168_70_0-255_255_255_0","192.168.70.0","255.255.255.0","ens33","192.168.70.3",,"<xcatmaster>",,,,,,,,,,,"1500",,

"192_168_122_0-255_255_255_0","192.168.122.0","255.255.255.0","virbr0","<xcatmaster>",,"<xcatmaster>",,,,,,,,,,,"1500",,

[root@xcatmgt01 ~]#

 

l  Networks tab 수정

[root@xcatmgt01 ~]# chdef -t network -o "10_10_10_0-255_255_255_0" net=10.10.10.0 mask=255.255.255.0 mgtifname=ens34 dhcpserver=10.10.10.21 tftpserver=10.10.10.21 nameservers=10.10.10.21 staticrange=10.10.10.22-10.10.10.40

1 object definitions have been created or modified.

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# tabdump networks

#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable

"10_10_10_0-255_255_255_0","10.10.10.0","255.255.255.0","ens34","<xcatmaster>","10.10.10.21","10.10.10.21","10.10.10.21",,,,"10.10.10.22-10.10.10.40",,,,,,"1500",,

"192_168_70_0-255_255_255_0","192.168.70.0","255.255.255.0","ens33","192.168.70.3",,"<xcatmaster>",,,,,,,,,,,"1500",,

"192_168_122_0-255_255_255_0","192.168.122.0","255.255.255.0","virbr0","<xcatmaster>",,"<xcatmaster>",,,,,,,,,,,"1500",,

[root@xcatmgt01 ~]#

 

l  Postscripts tab 수정

[root@xcatmgt01 ~]# tabdump postscripts

#node,postscripts,postbootscripts,comments,disable

"xcatdefaults","syslog,remoteshell,syncfiles","otherpkgs",,

"service","servicenode",,,

[root@xcatmgt01 ~]# chdef -p -t group xcatdefaults postscripts=syslog,remoteshell,syncfiles,setupntp,confignics,hardeths

 

1 object definitions have been created or modified.

New object definitions 'xcatdefaults' have been created.

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# tabdump postscripts

#node,postscripts,postbootscripts,comments,disable

"xcatdefaults","syslog,remoteshell,syncfiles,setupntp,confignics,hardeths","otherpkgs",,

"service","servicenode",,,

[root@xcatmgt01 ~]#

 

l  Passwd tab 변경

[root@xcatmgt01 ~]# chtab passwd.key=system passwd.username=root passwd.password=cluster

[root@xcatmgt01 ~]# chtab passwd.key=ipmi passwd.username=USERID passwd.password=PASSW0RD

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# tabdump passwd

#key,username,password,cryptmethod,authdomain,comments,disable

"system","root","cluster",,,,

"ipmi","USERID","PASSW0RD",,,,

[root@xcatmgt01 ~]#

 

3.     Client 노드 추가

 

[root@xcatmgt01 ~]# nodeadd node[01-10] groups=ipmi,dell,compute,all

[root@xcatmgt01 ~]# chdef -t node -o node01 ip="10.10.10.32" hostnames="node01"

1 object definitions have been created or modified.

[root@xcatmgt01 ~]# chdef -t node node01 nfsserver=10.10.10.21 tftpserver=10.10.10.21 nfsserver=10.10.10.21 netboot=pxe installnic=00:0C:29:42:24:16 primarynic=00:0C:29:42:24:16

1 object definitions have been created or modified.

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# chtab node=node01 mac.mac=00:0C:29:42:24:16

[root@xcatmgt01 ~]# tabdump mac

#node,interface,mac,comments,disable

"node01",,"00:0C:29:42:24:16",,

[root@xcatmgt01 ~]#

 

4.     OS image 추가

[root@xcatmgt01 ~]# ls

anaconda-ks.cfg  Documents  initial-setup-ks.cfg  Pictures  Templates                        Videos

Desktop          Downloads  Music                 Public    ubuntu-16.04.1-server-amd64.iso  xCAT

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# copycds ubuntu-16.04.1-server-amd64.iso

Copying media to /install/ubuntu16.04.1/x86_64

Media copy operation successful

[root@xcatmgt01 ~]#

 

5.     Client 노드 OS 이미지 지정

 

[root@xcatmgt01 ~]# cat /etc/resolv.conf

search dell.net

nameserver 10.10.10.21

nameserver 168.126.63.1

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# nslookup node01

Server:              10.10.10.21

Address: 10.10.10.21#53

 

Name:   node01.dell.net

Address: 10.10.10.32

 

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# makedns -n

Handling localhost in /etc/hosts.

Handling xcatmgt in /etc/hosts.

Handling localhost in /etc/hosts.

Getting reverse zones, this may take several minutes for a large cluster.

Completed getting reverse zones.

Updating zones.

Completed updating zones.

Restarting named

Restarting named complete

Updating DNS records, this may take several minutes for a large cluster.

Completed updating DNS records.

DNS setup is completed

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# makedhcp -n

Renamed existing dhcp configuration file to  /etc/dhcp/dhcpd.conf.xcatbak

 

The dhcp server must be restarted for OMAPI function to work

Warning: [xcatmgt01]: No dynamic range specified for 10.10.10.0. If hardware discovery is being used, a dynamic range is required.

[root@xcatmgt01 ~]#

 

[root@xcatmgt01 ~]# makehosts

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# tabdump osimage

#imagename,groups,profile,imagetype,description,provmethod,rootfstype,osdistroname,osupdatename,cfmdir,osname,osvers,osarch,synclists,postscripts,postbootscripts,serverrole,isdeletable,kitcomponents,environvar,comments,disable

"ubuntu16.04.1-x86_64-install-compute",,"compute","linux",,"install",,,,,"Linux","ubuntu16.04.1","x86_64",,,,,,,,,

"ubuntu16.04.1-x86_64-install-service",,"service","linux",,"install",,,,,"Linux","ubuntu16.04.1","x86_64",,"servicenode",,,,,,,

"ubuntu16.04.1-x86_64-netboot-compute",,"compute","linux",,"netboot",,,,,"Linux","ubuntu16.04.1","x86_64",,,,,,,,,

[root@xcatmgt01 ~]#

 

6.     Template 파일 수정

l  Prescript 위치 : /opt/xcat/share/xcat/install/scripts

l  Ubuntu template 파일 위치 : /opt/xcat/share/xcat/install/scripts

l  Postscripts 파일 위치 : /install/postscripts

 

/opt/xcat/shar/xcat/install/scripts/compute.tmpl 파일에 “### Boot loader installation” 부분에 “d-i grub-installer/bootdev string /dev/sda” 추가 <#중요>

 

7.     Client 노드 설치 (우분투 서버)

[root@xcatmgt01 ~]# nodeset node01 osimage=ubuntu16.04.1-x86_64-install-compute

Warning: [xcatmgt01]: rcons may not work since no serialport is specified for node01

node01: install ubuntu16.04.1-x86_64-compute

[root@xcatmgt01 ~]#

 

l  Client 노드 설치 과정

 

l  Package 설치과정

 

 

 

l  Ubuntu 클라이언트 설치후 버전확인

[root@xcatmgt01 ~]# ssh node01

Warning: Permanently added 'node01,10.10.10.32' (ECDSA) to the list of known hosts.

Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-31-generic x86_64)

 

 * Documentation:  https://help.ubuntu.com

 * Management:     https://landscape.canonical.com

 * Support:        https://ubuntu.com/advantage

Last login: Wed Dec  2 08:56:22 2020

root@node01:~#

root@node01:~# uname -a

Linux node01 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

root@node01:~# cat /etc/issue

Ubuntu 16.04.1 LTS \n \l

root@node01:~# df -h

Filesystem      Size  Used Avail Use% Mounted on

udev            4.9G     0  4.9G   0% /dev

tmpfs           999M  8.9M  990M   1% /run

/dev/sda5        38G 1006M   35G   3% /

tmpfs           4.9G     0  4.9G   0% /dev/shm

tmpfs           5.0M     0  5.0M   0% /run/lock

tmpfs           4.9G     0  4.9G   0% /sys/fs/cgroup

/dev/sda1       232M   51M  165M  24% /boot

tmpfs           999M     0  999M   0% /run/user/0

root@node01:~#

 

1.     Ubuntu Desktop 배포 이미지 만들기

l  Desktop Package 설치하기 :

-      ubuntu 서버와 Desktop Package 는 동일하는 설치 ISO 파일의 형식이 다르기 때문에 xCAT tftp boot image 를 생성하여 설치 할수 없는 제약이 있다. 이에 ubuntu server ISO 이미지와 별도의 Desktop Package 를 다운로드 받아 배포하는 방법이 있다.

root@node01:~#

 

l  ubuntu server 를 수동으로 설치 후 Desktop Package 다운로드

 

root@node01:~# apt-get update

파일을 설치하면 파일이 지워지지 않고 “var/cache/apt/archives” 디렉토리에 남음 아래 명령어로 Desktop 에 필요한 Package 를 설치

 

 

 

 

------

 

=========================================================

2.      xCAT 서버에서 ubuntu 16.04.1 Desktop 버전 배포판 만들기

 

l  ubuntu Desktop Package 만들기

다운로드된 Desktop Package 파일의 catalog file 을 생성한다.

1.     DVD 로 설치된 우분투 서버에서 apt-get install -y ubuntu-desktop 설치

2.     기타 필요한 Package 설치 apt-get install language-pack-en-base

3.     다운로드된 package 파일을 가지고 catalog file 만들기

4.     # dpkg-scanpackages amd64 | gzip -9c > amd64/Packages.gz

        [amd64] ubuntu-dekstop package 가 있는 디렉토리  

 

기타 :

xCAT 서버의 디렉토리 구조

[root@xcatmgt01 html]# pwd

/var/www/html

[root@xcatmgt01 html]# ls

debs  ubuntu

[root@xcatmgt01 html]#

 

xCAT Client 의 디렉토리 구조

root@node04:/# cat /etc/apt/sources.list

deb http://10.10.10.21/ubuntu xenial main restricted

http://192.168.203.128/debs/ amd64/

 

l  ubuntu 16.04.1 server ISO 이미지를 mount 하여 xCAT 서버의 “/var/www/html/ubuntu Copy (ubuntu 디렉토리 생성필요)

[root@xcatmgt01 ~]# mount -o loop ubuntu-16.04.1-server-amd64.iso /mnt

mount: /dev/loop0 is write-protected, mounting read-only

[root@xcatmgt01 ~]#

[root@xcatmgt01 ~]# mkdir /var/www/html/ubuntu

[root@xcatmgt01 ~]#

[root@xcatmgt01 /]# cp -ar /mnt/* /var/www/html/

[root@xcatmgt01 /]#

 

3.     ubuntu 16.04.1 Desktop 설치 스크립트 작성

 

[root@xcatmgt01 /]# cat /install/postscripts/dt

#!/bin/sh

 

# apt source.list

mv /etc/apt/sources.list /etc/apt/sources.list.org

 

echo "deb http://10.10.10.21/ubuntu xenial main restricted

deb http://10.10.10.21/debs/ amd64/" > /etc/apt/sources.list

 

cp -a /etc/rc.local /etc/rc.local.org

echo '#!/bin/bash

 

apt-get update

 

apt-get -y --force-yes install ca-certificates openssl python vim ubuntu-desktop unity libslp1

 

rm -f /etc/rc.local

cp -a /etc/rc.local.org /etc/rc.local

rm -f /root/install_desktop.sh' > /root/install_desktop.sh

 

chmod 755 /root/install_desktop.sh

 

echo '/root/install_desktop.sh

sleep 5

/sbin/reboot

exit 0' > /etc/rc.local

[root@xcatmgt01 /]#

[root@xcatmgt01 /]#

[root@xcatmgt01 /]# cd /install/postscripts/

[root@xcatmgt01 postscripts]# chmod +x desktop.sh

 

l  중요 Postscripts desktop.sh 등록

[root@xcatmgt01 /]# tabedit postscripts

[root@xcatmgt01 /]# tabdump postscripts

#node,postscripts,postbootscripts,comments,disable

"xcatdefaults","syslog,remoteshell,syncfiles,setupntp,confignics,hardeths,dt","otherpkgs",,

"service","servicenode",,,

[root@xcatmgt01 /]#

 

<xCAT Desktop 설치 끝>

 

#부록 : Desktop Package postbootscripts 로 설치하는 방법

[root@xcatmgt01 /]# tabdump postscripts

#node,postscripts,postbootscripts,comments,disable

"xcatdefaults","syslog,remoteshell,syncfiles,setupntp,confignics,hardeths,dt","otherpkgs",,

"service","servicenode",,,

"node03",,"diy/run_final.sh",,

 

아래와 같이 별도의 스크립트를 만들어 OS 를 설치하는 방법도 있다.

[root@xcatmgt01 /]#

[root@xcatmgt01 /]# cat /install/postscripts/diy/run_final.sh

#!/bin/bash

mount 10.10.10.21:/data /mnt

sh /mnt/desktop.sh

echo "done final scripts"

[root@xcatmgt01 /]#

[root@xcatmgt01 /]#

[root@xcatmgt01 /]# cat /data/desktop.sh

#!/bin/bash

echo "###############################################################"

echo "###               Run Desktop install                                                         ###"

echo "###############################################################"

sed -i 's/$#PermitRootLogin/PermitRootLogin/g' /etc/ssh/sshd_config

sed -i 's/prohibit-password/yes/g' /etc/ssh/sshd_config 

echo "#### START SYSLOG ####"

echo '*.=info;*.=notice;*.=warn;\' >> /etc/rsyslog.d/50-default.conf

echo 'auth,authpriv.none;\' >> /etc/rsyslog.d/50-default.conf

echo 'cron,daemon.none;\' >> /etc/rsyslog.d/50-default.conf

echo 'mail,news.none          -/var/log/messages' >> /etc/rsyslog.d/50-default.conf

useradd haruri

mkdir -p /home/haruri

chown haruri:haruri /home/haruri

#echo 'haruri:dellUser!@' | chpasswd

echo "#### START DESKTOP ####"

mkdir -p /etc/lightdm/lightdm.conf.d/

echo '[SeatDefaults]' > /etc/lightdm/lightdm.conf.d/50-no-guest.conf

echo 'allow-guest=false' >> /etc/lightdm/lightdm.conf.d/50-no-guest.conf

#mount 10.10.10.21:/data/amd64 /mnt

dpkg -i /mnt/amd64/*.deb

 

sleep 5

umount /mnt

sleep 5

 

sed -i 's/LANG=en_US/LANG=en_US.UTF-8/g' /etc/default/locale

dpkg-reconfigure --frontend noninteractive locales

 

sleep 10

 

[root@xcatmgt01 /]#

 

 

xCAT 설치 가이드 20201208 마지막.docx
0.44MB
xcat-docs-readthedocs-io-en-latest_xcat ibm.pdf
2.80MB

'HPC > 클러스터' 카테고리의 다른 글

ganglia 설치 CentOS7.8  (0) 2020.12.15
ubuntu 14.06.01 netboot bug, libc6-udeb  (0) 2020.12.14
Memory Becnchmark [stream]  (0) 2018.01.18