레이블이 CentOS인 게시물을 표시합니다. 모든 게시물 표시
레이블이 CentOS인 게시물을 표시합니다. 모든 게시물 표시

2020년 4월 1일 수요일

LSF HPC Suite v10.2 설치 - CentOS 7.6 (ppc64le, IBM POWER8) 환경


LSF HPC Suite v10.2를 CentOS 7.6 (ppc64le, IBM POWER8) 환경에서 설치하는 과정을 정리했습니다.

먼저 LSF 설치에 필요한 사전 준비를 합니다.  Password를 넣지 않고 ssh가 되도록 하는 것이 관건입니다.  저는 일단 root user로도 ssh가 가능하도록 아래와 같이 설정했습니다.  여기서는 p628-kvm1~3 총 3대의 가상서버가 있습니다.

[cecuser@p628-kvm1 ~]$ sudo yum install -y openssh-clients

[cecuser@p628-kvm1 ~]$ ssh-keygen

[cecuser@p628-kvm1 ~]$ ssh-copy-id p628-kvm1

[cecuser@p628-kvm1 ~]$ ssh-copy-id p628-kvm2

[cecuser@p628-kvm1 ~]$ ssh-copy-id p628-kvm3

[cecuser@p628-kvm1 ~]$ sudo vi /etc/ssh/sshd_config
#PermitRootLogin yes
PermitRootLogin yes

[cecuser@p628-kvm1 ~]$ sudo systemctl restart sshd

[cecuser@p628-kvm1 ~]$ su -
Password:

-bash-4.2# ssh-keygen

-bash-4.2# ssh-copy-id p628-kvm1

-bash-4.2# ssh-copy-id p628-kvm2

-bash-4.2# ssh-copy-id p628-kvm3


이제 LSF HPC Suite의 installation bin file을 수행합니다.  이 파일이 수행하는 것은 LSF를 설치하는 것이 아니라, 그 설치를 위한 ansible 기반의 installer를 설치 및 구성하는 것입니다.

[cecuser@p628-kvm1 ~]$ sudo ./lsfshpc10.2.0.9-ppc64le.bin

Installing LSF Suite for HPC 10.2.0.9 deployer ...

Checking prerequisites ...
httpd is not installed.
Installing httpd ...
createrepo is not installed.
Installing createrepo ...
Installed Packages
rsync.ppc64le                      3.1.2-6.el7_6.1                      @updates
Installed Packages
curl.ppc64le                         7.29.0-51.el7                         @base
Installed Packages
python-jinja2.noarch                   2.7.2-3.el7_6                    @updates
Installed Packages
yum-utils.noarch                       1.1.31-50.el7                       @base
httpd is not running. Trying to start httpd ...
Copying LSF Suite for HPC 10.2.0.9 deployer files ...
Installing Ansible ...
Spawning worker 0 with 1 pkgs
,,,,
Gathering deployer information ...
Creating LSF Suite repository ...
LSF Suite for HPC 10.2.0.9 deployer installed

To deploy LSF Suite to a cluster:
 - Change directory to "/opt/ibm/lsf_installer/playbook"
 - Edit the "lsf-inventory" file with lists of machines and their roles in the cluster
 - Edit the "lsf-config.yml" file with required parameters
 - Run "ansible-playbook -i lsf-inventory lsf-deploy.yml"

Installing ibm-jre ...

Connecting to IBM Support: Fix Central to query the latest fix pack level ...
This is the latest available fix pack.

이제 아래와 같이 lsf-inventory 파일 속의 hostname 등을 등록합니다.  여기서는 p628-kvm1  p628-kvm2  p628-kvm3의 총 3대 중에서, p628-kvm1이 master 역할을 함과 동시에 compute host 역할까지 하는 것으로 설정했습니다.  p628-kvm1에서는 연산작업을 하지 않고 master 역할만 하기를 원한다면 [LSF_Servers]에서는 p628-kvm1이 빠져야 합니다.

[cecuser@p628-kvm1 ~]$ cd /opt/ibm/lsf_installer/playbook

[cecuser@p628-kvm1 playbook]$ sudo vi lsf-inventory
[LSF_Masters]
p628-kvm1
[LSF_Servers]
p628-kvm[1:3]     # p628-kvm1  p628-kvm2  p628-kvm3을 쉽게 표현한 것입니다

같은 directory의  lsf-config.yml도 필요시 수정합니다만, 여기서는 일단 하지 않겠습니다.

[cecuser@p628-kvm1 playbook]$ sudo vi  lsf-config.yml
(필요시)
  my_cluster_name: myCluster   # 이것이 default cluster name입니다.  여기서는 굳이 cluster 이름을 수정하지 않았습니다.
  HA_shared_dir: none  # High-Availability를 위한 directory로서, 설정하면 여기에 configuration file들과 work directory가 copy됩니다.
  NFS_install_dir: none  # 여기에 NFS mount point를 등록하면 그 directory에  LSF master, server & client binary file들과 config file들이 설치되어 cluster 내에서 공유됩니다

수정이 끝났으면 다음과 같이 문법에 오류가 없는지 테스트를 해봅니다.

[cecuser@p628-kvm1 playbook]$  sudo ansible-playbook -i lsf-inventory lsf-config-test.yml
...
TASK [Check if Private_IPv4_Range is valid] ************************************

TASK [Check if Private_IPv4_Range IP address is available] *********************

PLAY RECAP *********************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=0
p628-kvm1                  : ok=16   changed=0    unreachable=0    failed=0
p628-kvm2                  : ok=11   changed=0    unreachable=0    failed=0
p628-kvm3                  : ok=11   changed=0    unreachable=0    failed=0

원래 manual에는 아래와 같이  lsf-predeploy-test.yml를 이용해서 추가 검증 테스트를 해보라고 되어 있는데, 해보면 아래와 같이 remote 서버 2대에서만 엉뚱한 error가 납니다.  아무리 이것저것 해봐도 계속 같은 오류가 나던데, 그냥 무시하셔도 될 것 같습니다.  저는 무시하고 그냥 진행했는데, 결과적으로는 문제가 없었습니다.

[cecuser@p628-kvm1 playbook]$ sudo ansible-playbook -i lsf-inventory lsf-predeploy-test.yml
...
TASK [debug deployer] **********************************************************
fatal: [p628-kvm2]: FAILED! => {"failed": true, "msg": "The conditional check 'LSF.Private_IPv4_Range is defined and LSF.Private_IPv4_Range != 'none' and LSF.Private_IPv4_Range is not none' failed. The error was: error while evaluating conditional (LSF.Private_IPv4_Range is defined and LSF.Private_IPv4_Range != 'none' and LSF.Private_IPv4_Range is not none): 'LSF' is undefined\n\nThe error appears to have been in '/opt/ibm/lsf_installer/playbook/roles/config/tasks/check_private_ips.yml': line 8, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: debug {{ target_role }}\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes.  Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}

이제 다음과 같이 ansible-playbook으로 실제 설치를 수행합니다.  이 명령 하나로 3대의 서버에 모두 LSF HPC Suite가 설치되는 것입니다.  위의 test 오류에도 불구하고, 설치는 전혀 이상없이 잘 됩니다.  서버 및 네트워크 사양에 따라 다르겠지만 시간은 꽤 많이 걸립니다.  저는 1시간 정도 걸렸습니다.   아래와 같이 끝 부분에 IBM Spectrum Application Center를 열 수 있는 URL이 주어집니다.  접속해보면 실제로 잘 열립니다.

[cecuser@p628-kvm1 playbook]$ sudo ansible-playbook -i lsf-inventory lsf-deploy.yml
...
PLAY [Summary] *****************************************************************

TASK [debug] *******************************************************************
ok: [p628-kvm1 -> localhost] => {
    "msg": [
        "LSF Suite for HPC 10.2.0.9 deployment is done",
        "Open IBM Spectrum Application Center with the following URL: http://p628-kvm1.cecc.ihost.com:8080"
    ]
}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0
p628-kvm1                  : ok=296  changed=127  unreachable=0    failed=0
p628-kvm2                  : ok=107  changed=48   unreachable=0    failed=0
p628-kvm3                  : ok=107  changed=48   unreachable=0    failed=0





** 혹시 위의 설치 과정에서 뭔가 실수 등으로 잘못되어 다시 설치하고자 한다면, 그냥 다시 하면 안되고 다음과 같이 uninstall 하고 진행해야 합니다.  그러지 않을 경우 "Check if an installation was made before" 등의 error가 나면서 fail 합니다.

[cecuser@p628-kvm1 playbook]$ sudo ansible-playbook -i lsf-inventory lsf-uninstall.yml

이제 다음과 같이 lsf.conf에서 RSH이나 RCP 대신 ssh, scp를 쓰도록 설정합니다.

[cecuser@p628-kvm1 playbook]$ sudo vi /opt/ibm/lsfsuite/lsf/conf/lsf.conf
LSF_RSH=ssh
LSF_REMOTE_COPY_CMD="scp -B -o 'StrictHostKeyChecking no'"

[cecuser@p628-kvm1 ~]$ sudo ln -s /opt/ibm/lsfsuite/lsf/conf/lsf.conf /etc/lsf.conf

이제 lsfshutdown & lsfstartup을 통해 restart 합니다.  이건 root에서 해야 합니다.

[cecuser@p628-kvm1 ~]$ su -
Password:
Last login: Tue Mar 31 05:05:59 EDT 2020

-bash-4.2# . /opt/ibm/lsfsuite/lsf/conf/profile.lsf   (이 profile.lsf를 수행해야 PATH 등의 환경변수가 자동설정됩니다.)

-bash-4.2# lsfshutdown
Shutting down all slave batch daemons ...
Shut down slave batch daemon on all the hosts? [y/n] y
Shut down slave batch daemon on <p628-kvm1> ...... done
Shut down slave batch daemon on <p628-kvm2.cecc.ihost.com> ...... done
Shut down slave batch daemon on <p628-kvm3.cecc.ihost.com> ...... done
Shutting down all RESes ...
Do you really want to shut down RES on all hosts? [y/n] y
Shut down RES on <p628-kvm1> ...... done
Shut down RES on <p628-kvm3.cecc.ihost.com> ...... done
Shut down RES on <p628-kvm2.cecc.ihost.com> ...... done
Shutting down all LIMs ...
Do you really want to shut down LIMs on all hosts? [y/n] y
Shut down LIM on <p628-kvm1> ...... done
Shut down LIM on <p628-kvm3.cecc.ihost.com> ...... done
Shut down LIM on <p628-kvm2.cecc.ihost.com> ...... done

-bash-4.2# lsfstartup
Starting up all LIMs ...
Do you really want to start up LIM on all hosts ? [y/n]y
Start up LIM on <p628-kvm1> ......
Starting up all RESes ...
Do you really want to start up RES on all hosts ? [y/n]y
Start up RES on <p628-kvm1> ......
Starting all slave daemons on LSBATCH hosts ...
Do you really want to start up slave batch daemon on all hosts ? [y/n] y
Start up slave batch daemon on <p628-kvm1> ......
Done starting up LSF daemons on the local LSF cluster ...

이제 다시 일반 user에서 각종 LSF 명령을 내려 봅니다.

[cecuser@p628-kvm1 ~]$ . /opt/ibm/lsfsuite/lsf/conf/profile.lsf

[cecuser@p628-kvm1 ~]$ lsid
IBM Spectrum LSF 10.1.0.9, Oct 16 2019
Suite Edition: IBM Spectrum LSF Suite for HPC 10.2.0.9
Copyright International Business Machines Corp. 1992, 2016.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

My cluster name is myCluster
My master name is p628-kvm1

[cecuser@p628-kvm1 ~]$ lshosts
HOST_NAME      type    model  cpuf ncpus maxmem maxswp server RESOURCES
p628-kvm1   LINUXPP   POWER8  25.0     2  31.9G   3.9G    Yes (mg)
p628-kvm3.c LINUXPP   POWER8  25.0     2  31.9G   3.9G    Yes ()
p628-kvm2.c LINUXPP   POWER8  25.0     2  31.9G   3.9G    Yes ()


[cecuser@p628-kvm1 ~]$ bhosts
HOST_NAME          STATUS       JL/U    MAX  NJOBS    RUN  SSUSP  USUSP    RSV
p628-kvm1          ok              -      2      0      0      0      0      0
p628-kvm2.cecc.iho ok              -      2      0      0      0      0      0
p628-kvm3.cecc.iho ok              -      2      0      0      0      0      0


[cecuser@p628-kvm1 ~]$ bqueues
QUEUE_NAME      PRIO STATUS          MAX JL/U JL/P JL/H NJOBS  PEND   RUN  SUSP
admin            50  Open:Active       -    -    -    -     0     0     0     0
owners           43  Open:Active       -    -    -    -     0     0     0     0
priority         43  Open:Active       -    -    -    -     0     0     0     0
night            40  Open:Active       -    -    -    -     0     0     0     0
short            35  Open:Active       -    -    -    -     0     0     0     0
dataq            33  Open:Active       -    -    -    -     0     0     0     0
normal           30  Open:Active       -    -    -    -     0     0     0     0
interactive      30  Open:Active       -    -    -    -     0     0     0     0
idle             20  Open:Active       -    -    -    -     0     0     0     0

2020년 1월 28일 화요일

CentOS 환경의 IBM POWER9 서버에 xCAT 설치하기



xCAT은 eXtreme Cluster/Cloud Administration Toolkit의 약자로서, 대형 HPC cluster의 설치와 운영에 사용되는 open source tool입니다.   설치는 IBM POWER9 (ppc64le) 환경에서도 x86 환경과 동일하게 간단합니다.  여기서는 CentOS 7.6 환경에서 수행해보겠습니다.

-bash-4.2# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (AltArch)

먼저 go-xcat script를 다음과 같이 download 받습니다.

-bash-4.2# wget https://raw.githubusercontent.com/xcat2/xcat-core/master/xCAT-server/share/xcat/tools/go-xcat -O - >/tmp/go-xcat

-bash-4.2# chmod a+x /tmp/go-xcat

이제 이 script를 install이라는 argument와 함께 수행합니다.   그러면 Yes를 한번 눌러주는 것 외에는 사실상 더 해줄 것이 없습니다.

-bash-4.2# /tmp/go-xcat install
Operating system:   linux
Architecture:       ppc64le
Linux Distribution: centos
Version:            7
go-xcat Version:    1.0.45


Reading repositories ...... done

xCAT Core Packages
==================

Package Name                Installed                      In Repository
------------                ---------                      -------------
perl-xCAT                   (not installed)                2.15-snap201911041517
xCAT                        (not installed)                2.15-snap201911041517
xCAT-SoftLayer              (not installed)                2.15-snap201911041517
xCAT-buildkit               (not installed)                2.15-snap201911041517
xCAT-client                 (not installed)                2.15-snap201911041517
xCAT-confluent              (not installed)                2.15-snap201911041517
xCAT-csm                    (not installed)                2.15-snap201911041517
xCAT-genesis-scripts-ppc64  (not installed)                2.15-snap201911041517
xCAT-genesis-scripts-x86_64 (not installed)                2.15-snap201911041517
xCAT-openbmc-py             (not installed)                2.15-snap201911041518
xCAT-probe                  (not installed)                2.15-snap201911041517
xCAT-server                 (not installed)                2.15-snap201911041517
xCAT-test                   (not installed)                2.15-snap201911041517
xCAT-vlan                   (not installed)                2.15-snap201911041517
xCATsn                      (not installed)                2.15-snap201911041517

xCAT Dependency Packages
========================

Package Name                Installed                      In Repository
------------                ---------                      -------------
elilo-xcat                  (not installed)                3.14-4
fping                       (not installed)                2.4b2_to-2
goconserver                 (not installed)                0.3.2-snap201909171016
grub2-xcat                  (not installed)                2.02-0.76.el7.1.snap2019051602
ipmitool-xcat               (not installed)                1.8.18-0
lldpd                       (not installed)                0.7.15-6.1
net-snmp-perl               (not installed)                5.7.2-38.el7_6.2
perl-AppConfig              (not installed)                1.66-20.el7
perl-Crypt-CBC              (not installed)                2.33-2.el7
perl-Crypt-Rijndael         (not installed)                1.09-2.ael7a
perl-Expect                 (not installed)                1.21-1
perl-HTML-Form              (not installed)                6.03-6.el7
perl-HTTP-Async             (not installed)                0.30-2
perl-IO-Stty                (not installed)                0.03-1
perl-IO-Tty                 (not installed)                1.10-11.el7
perl-JSON                   (not installed)                2.59-2.el7
perl-Net-HTTPS-NB           (not installed)                0.14-2
perl-Net-Telnet             (not installed)                3.03-19.el7
perl-SOAP-Lite              (not installed)                0.710.08-1
perl-XML-Simple             (not installed)                2.20-5.el7
pyodbc                      (not installed)                3.0.7-1.ael7a
syslinux-xcat               (not installed)                3.86-2
systemconfigurator          (not installed)                2.2.11-1
systemimager-client         (not installed)                4.3.0-0.1
systemimager-common         (not installed)                4.3.0-0.1
systemimager-server         (not installed)                4.3.0-0.3
xCAT-genesis-base-ppc64     (not installed)                2.14.5-snap201811160710
xCAT-genesis-base-x86_64    (not installed)                2.14.5-snap201811190037
xnba-undi                   (not installed)                1.0.3-131028
yaboot-xcat                 (not installed)                1.3.17-rc1

xCAT is going to be installed.
Continue? [y/n] y

....
Install  15 Packages (+95 Dependent packages)

Total download size: 257 M
Installed size: 713 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                              2.9 MB/s | 257 MB  01:29
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : perl-Data-Dumper-2.145-3.el7.ppc64le                       1/110
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.ppc64le               2/110
  Installing : perl-Sys-Syslog-0.33-3.el7.ppc64le                         3/110
  Installing : ksh-20120801-139.el7.ppc64le                               4/110
  Installing : perl-XML-NamespaceSupport-1.11-10.el7.noarch               5/110
  Installing : apr-1.4.8-3.el7_4.1.ppc64le                                6/110
  Installing : perl-XML-Parser-2.41-10.el7.ppc64le                        7/110
  Installing : apr-util-1.5.2-6.el7.ppc64le                               8/110
  Installing : 12:dhcp-libs-4.2.5-68.el7.centos.1.ppc64le                 9/110
...
  tftp.ppc64le 0:5.2-22.el7
  tftp-server.ppc64le 0:5.2-22.el7
  trousers.ppc64le 0:0.3.14-2.el7
  unzip.ppc64le 0:6.0-19.el7
  xCAT-probe.noarch 4:2.15-snap201911041517
  yajl.ppc64le 0:2.0.4-4.el7

Complete!

xCAT has been installed!
========================

If this is the very first time xCAT has been installed, run one of the
following commands to set the environment variables.

For sh:
    source /etc/profile.d/xcat.sh

For csh:
    source /etc/profile.d/xcat.csh



이렇게 설치가 쉬운 이유는 go-xcat이라는 script에서 자동으로 xcat 관련 YUM repository를 만들었기 때문입니다.

-bash-4.2#  yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                  repo name                                          status
base                                     CentOS-7 - Base                                    7,477
extras                                   CentOS-7 - Extras                                    403
updates                                  CentOS-7 - Updates                                 1,873
xcat-core                                xcat-core                                             21
xcat-dep                                 xcat-dep                                              30
repolist: 9,804


설치 뒤에는 자동으로 xCAT daemon이 수행되는데, 제대로 떠있는지 다음과 같이 확인합니다.

-bash-4.2#  systemctl status xcatd
● xcatd.service - xCAT management service
   Loaded: loaded (/usr/lib/systemd/system/xcatd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-01-28 02:48:59 EST; 7min ago
 Main PID: 14973 (xcatd: SSL list)
   CGroup: /system.slice/xcatd.service
           ├─14972 /usr/sbin/in.tftpd -v -l -s /tftpboot -m /etc/tftpmapfile4xcat.conf
           ├─14973 xcatd: SSL listener
           ├─14974 xcatd: DB Access
           ├─14975 xcatd: UDP listener
           ├─14976 xcatd: Discovery worker
           ├─14977 xcatd: install monitor
           └─14978 xcatd: Command log writer

Jan 28 02:48:28 p636-kvm1 xcat[14943]: xcatd is going to start...
Jan 28 02:48:58 p636-kvm1 xcat[14975]: xcatd: UDP listener process 14975 start
Jan 28 02:48:58 p636-kvm1 xcat[14977]: xcatd: install monitor process 14977 start
Jan 28 02:48:58 p636-kvm1 xcat[14978]: xcatd: Command log writer process 14978 start
Jan 28 02:48:58 p636-kvm1 xcat[14976]: xcatd: Discovery worker process 14976 start
Jan 28 02:48:59 p636-kvm1 xcatd[14939]: Starting xcatd [  OK  ]
Jan 28 02:48:59 p636-kvm1 systemd[1]: Started xCAT management service.
Jan 28 02:49:02 p636-kvm1 xcat[15071]: xCAT: Allowing mknb ppc64 for root from localhost
Jan 28 02:49:47 p636-kvm1 xcat[15089]: xCAT: Allowing mknb x86_64 for root from localhost
Jan 28 02:52:45 p636-kvm1 xcat[15209]: xCAT: Allowing lsdef for root from localhost


xCAT daemon의 버전은 다음과 같이 확인할 수 있습니다.

-bash-4.2# source /etc/profile.d/xcat.sh

-bash-4.2# lsxcatd -a
Version 2.15 (git commit 218c6d3acc8bdbd7f72115e48cda2b1a3613d18a, built Mon Nov  4 15:17:59 EST 2019)
This is a Management Node
dbengine=SQLite


이제 간단한 xCAT 명령을 사용해보겠습니다.  xCAT에서 network을 등록하고 관리하는 방법입니다.  아래와 같이 먼저 makenetworks 명령을 통해 이미 구성되어 있는 NIC을 발견하여 network object를 만들어야 하는데, 실은 xCAT이 설치되고 구성될 때 이미 만들어져 있습니다.

-bash-4.2# makenetworks
Warning: [p636-kvm1]: The network entry '129_40_XXX_48-255_255_255_240' already exists in xCAT networks table. Cannot create a definition for '129_40_XXX_48-255_255_255_240'

이 network은 다음과 같이 볼 수 있습니다.

-bash-4.2# lsdef -t network
129_40_XXX_48-255_255_255_240  (network)

이것의 이름을 좀더 쉬운 이름으로 바꾸어 보겠습니다.

-bash-4.2# chdef -t network 129_40_XXX_48-255_255_255_240 -n primary_network
Changed the object name from 129_40_XXX_48-255_255_255_240 to primary_network.

-bash-4.2# lsdef -t network
primary_network  (network)

자세히 보기 위해서는 다음과 같이 할 수 있습니다.

-bash-4.2# lsdef -t network primary_network
Object name: primary_network
    gateway=129.40.XXX.62
    mask=255.255.255.240
    mgtifname=eth0
    mtu=9000
    net=129.40.XXX.48
    tftpserver=<xcatmaster>