ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • LINUX MCCS 클러스터 구축하기 실습(2)
    System of Infra/LINUX 2021. 8. 24. 22:39
    반응형

    LINUX로고이미지

    LINUX MCCS 클러스터 구축하기 실습(2)

    LINUX MCCS 클러스터 구축하기 실습(1)번 포스팅 글에 이어서 다음과 같이 실습을 수행하도록 하겠습니다.

    [root@L-EDU-S-03 etc]# cat drbd.conf
    global {
    disable-ip-verification;
    usage-count no;
    }
    common {
    startup {
    wfc-timeout 1;
    }
    }
    resource r0 {
    protocol C;
    disk {
    resync-rate 100M;
    c-plan-ahead 0;
    }
    net {
    max-buffers 8192;
    }
    device /dev/drbd0;
    floating 200.200.62.103:7788 {
    disk /dev/sdb1;
    meta-disk /dev/sdb2[0];
    }
    device /dev/drbd0;
    floating 200.200.62.104:7788 {
    disk /dev/sdb1;
    meta-disk /dev/sdb2[0];
    }
    
    [root@L-EDU-S-04 etc]# cat drbd.conf
    global {
    disable-ip-verification;
    usage-count no;
    }
    common {
    startup {
    wfc-timeout 1;
    }
    }
    resource r0 {
    protocol C;
    disk {
    resync-rate 100M;
    c-plan-ahead 0;
    }
    net {
    max-buffers 8192;
    }
    floating 200.200.62.103:7788 {
    device /dev/drbd0;
    disk /dev/sdb1;
    meta-disk /dev/sdb2[0];
    }
    floating 200.200.62.104:7788 {
    device /dev/drbd0;
    disk /dev/sdb1;
    meta-disk /dev/sdb2[0];
    }
    }

    -> L-EDU-S-03(서버#1)과 L-EDU-S-04(서버#2)에서 /etc 디렉터리에 drbd.conf라는 Configure 파일을 한 개 생성해 주도록 합니다. drbd.conf의 간단한 내용은 disk /dev/sdb2의 경우 메타데이터의 영역으로 사용을 하기로 (1) 글에서 설명드렸고 마찬가지로 disk /dev/sdb1의 경우 데이터 영역으로 사용 된다는 것을 확인할 수 있습니다.

    또한, 200.xxx.xxx.xxx에 대한 Mirror IP#1,#2의 경우 floating부분에 설정되어 실시간 디스크 복제를 진행한다는 설정을 확인할 수 있습니다.

    * resource r0 : 리소스 그룹을 r0로 사용* device /dev/drbd0 : 경로를 /dev/drbd0 장치를 사용

    [root@L-EDU-S-03 drbd.d]# mkdir -p /data
    [root@L-EDU-S-03 /]# ls -al | grep data
    drwxr-xr-x 2 root root 6 Aug 19 15:43 data
    
    [root@L-EDU-S-04 drbd.d]# mkdir -p /data
    [root@L-EDU-S-04 /]# ls -al | grep data
    drwxr-xr-x 2 root root 6 Aug 19 15:43 data

    -> drbd.conf의 설정이 완료가 되었다면 마운트할 디렉터리를 한 개 생성해 주도록 합니다. 임시로 /data라는 디렉터리를 한 개 생성하도록 하였습니다.

    [root@L-EDU-S-03 drbd.d]# cat global_common.conf
    global {
    disable-ip-verification;
    usage-count no;
    }
    common {
    startup {
    wfc-timeout 1;
    }
    }
    
    [root@L-EDU-S-04 drbd.d]# cat global_common.conf
    global {
    disable-ip-verification;
    usage-count no;
    }
    common {
    startup {
    wfc-timeout 1;
    }
    }

    -> global_common.conf 라는 파일을 /etc/drbd.d의 경로에 생성하여 위와 같은 내용을 붙여 넣도록 합니다.(이 부분은 좀 더 자세히 알아보고 다시 설명드리도록 하겠습니다.)

    [root@L-EDU-S-03 /]# drbdadm create-md r0
    # Output might be stale, since minor 0 is attached
    Device '0' is configured!
    Command 'drbdmeta 0 v08 /dev/sdb1 0 create-md' terminated with exit code 20
    
    [root@L-EDU-S-04 /]# drbdadm create-md r0
    # Output might be stale, since minor 0 is attached
    Device '0' is configured!
    Command 'drbdmeta 0 v08 /dev/sdb1 0 create-md' terminated with exit code 20

    -> drbdadm 명령어를 통해서 L-EDU-S-03(서버#1)과 L-EDU-S-04(서버#2)에 drbd metadb를 생성합니다. /dev/sdb1 메타 데이터 영역을 초기화 하는것으로 생각하시면 됩니다. 

    root@L-EDU-S-03 /]# service drbd status
    Redirecting to /bin/systemctl status drbd.service
    ● drbd.service - DRBD -- please disable. Unless you are NOT using a cluster manager.
    Loaded: loaded (/usr/lib/systemd/system/drbd.service; disabled; vendor preset: disabled)
    Active: active (exited) since Thu 2021-08-19 16:33:53 KST; 12min ago
    Process: 3734 ExecStart=/lib/drbd/drbd start (code=exited, status=0/SUCCESS)
    Main PID: 3734 (code=exited, status=0/SUCCESS)
    
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: prepare disk: r0
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: adjust disk: r0
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: adjust net: r0
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: ]
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: WARN: stdin/stdout is not a TTY; using /dev/...ut
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: degr-wfc-timeout implicitly set to wfc-timeo...s)
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: outdated-wfc-timeout has to be shorter than ...ut
    Aug 19 16:33:52 L-EDU-S-03 drbd[3734]: outdated-wfc-timeout implicitly set to degr-...s)
    Aug 19 16:33:53 L-EDU-S-03 drbd[3734]: .
    Aug 19 16:33:53 L-EDU-S-03 systemd[1]: Started DRBD -- please disable. Unless you a.....
    Hint: Some lines were ellipsized, use -l to show in full.
    
    
    [root@L-EDU-S-04 /]# service drbd status
    Redirecting to /bin/systemctl status drbd.service
    ● drbd.service - DRBD -- please disable. Unless you are NOT using a cluster manager.
    Loaded: loaded (/usr/lib/systemd/system/drbd.service; disabled; vendor preset: disabled)
    Active: active (exited) since Thu 2021-08-19 16:33:24 KST; 12min ago
    Process: 5239 ExecStart=/lib/drbd/drbd start (code=exited, status=0/SUCCESS)
    Main PID: 5239 (code=exited, status=0/SUCCESS)
    
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: prepare disk: r0
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: adjust disk: r0
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: adjust net: r0
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: ]
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: WARN: stdin/stdout is not a TTY; using /dev/...ut
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: degr-wfc-timeout implicitly set to wfc-timeo...s)
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: outdated-wfc-timeout has to be shorter than ...ut
    Aug 19 16:33:23 L-EDU-S-04 drbd[5239]: outdated-wfc-timeout implicitly set to degr-...s)
    Aug 19 16:33:24 L-EDU-S-04 drbd[5239]: .
    Aug 19 16:33:24 L-EDU-S-04 systemd[1]: Started DRBD -- please disable. Unless you a.....
    Hint: Some lines were ellipsized, use -l to show in full.

    -> drbd 데몬을 기동하고 status를 통해서 확인을 합니다.

    [root@L-EDU-S-03 /]# drbdadm --force primary r0

    -> Primary인 L-EDU-S-03(서버#1)에서 동기화를 시작합니다.

    [root@L-EDU-S-03 /]# cat /proc/drbd
    version: 8.4.11-1 (api:1/proto:86-101)
    GIT-hash: 66145a308421e9c124ec391a7848ac20203bb03c build by @buildsystem, 2018-04-26 10:38:55
    0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
    ns:1047552 nr:0 dw:0 dr:1049624 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
    
    [root@L-EDU-S-04 /]# cat /proc/drbd
    version: 8.4.11-1 (api:1/proto:86-101)
    GIT-hash: 66145a308421e9c124ec391a7848ac20203bb03c build by @buildsystem, 2018-04-26 10:38:55
    0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----
    ns:0 nr:1047552 dw:1047552 dr:0 al:8 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

    -> L-EDU-S-03(서버#1)과 L-EDU-S-04(서버#2)간에  drbd 동기화가 진행되어 있는지 확인을 합니다. Primary/Secondary의 형태로 맨 끝 값에 지정되어 있는 oos의 값이 0이 되면 동기화가 끝난 상태입니다.

    [root@L-EDU-S-03 opt]# ./MCCS_linux_x64_4_4_8.sh
    Unpacking JRE ...
    Preparing JRE ...
    Starting Installer ...
    Aug 19, 2021 5:01:43 PM java.util.prefs.FileSystemPreferences$1 run
    INFO: Created user preferences directory.
    Aug 19, 2021 5:01:43 PM java.util.prefs.FileSystemPreferences$2 run
    INFO: Created system preferences directory in java.home.
    Select the language for the installation
    
    [root@L-EDU-S-04 opt]# ./MCCS_linux_x64_4_4_8.sh
    Unpacking JRE ...
    Preparing JRE ...
    Starting Installer ...
    Aug 19, 2021 5:01:43 PM java.util.prefs.FileSystemPreferences$1 run
    INFO: Created user preferences directory.
    Aug 19, 2021 5:01:43 PM java.util.prefs.FileSystemPreferences$2 run
    INFO: Created system preferences directory in java.home.
    Select the language for the installation

    -> 사전에 /opt 경로에 업로드한 MCCS_linux_x64_4_4_8.sh 스크립트를 기동하여 MCCS 클러스터를 작동하도록 합니다.

    [root@L-EDU-S-03 MCCS]# ps -ef | grep -i mccs
    root 10454 1 0 17:02 ? 00:00:00 /usr/bin/perl /opt/MCCS/bin/MccsAgentService.pl
    root 10460 1 0 17:02 ? 00:00:07 /opt/MCCS/bin/mccsserver
    root 12581 21366 0 17:18 pts/0 00:00:00 grep --color=auto -i mccs
    
    [root@L-EDU-S-04 MCCS]# ps -ef | grep -i mccs
    root 11852 1 0 17:02 ? 00:00:00 /usr/bin/perl /opt/MCCS/bin/MccsAgentService.pl
    root 11858 1 0 17:02 ? 00:00:06 /opt/MCCS/bin/mccsserver
    root 13904 22968 0 17:18 pts/0 00:00:00 grep --color=auto -i mccs

    -> L-EDU-S-03(서버#1)과 L-EDU-S-04(서버#2) 양쪽 노드 모두 MCCS_linux_x64_4_4_8.sh 프로세스가 활성화되어 있는지 확인을 합니다.

    [root@L-EDU-S-03 opt]# mount /dev/drbd0 /data
    
    [root@L-EDU-S-03 opt]# df -Th
    Filesystem Type Size Used Avail Use% Mounted on
    /dev/mapper/centos-root xfs 26G 3.7G 23G 15% /
    devtmpfs devtmpfs 1.4G 0 1.4G 0% /dev
    tmpfs tmpfs 1.4G 0 1.4G 0% /dev/shm
    tmpfs tmpfs 1.4G 122M 1.3G 9% /run
    tmpfs tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
    /dev/sda1 xfs 1014M 178M 837M 18% /boot
    tmpfs tmpfs 285M 12K 285M 1% /run/user/42
    tmpfs tmpfs 285M 0 285M 0% /run/user/0
    /dev/drbd0 ext4 991M 2.6M 922M 1% /data

    -> Primary인 L-EDU-S-03(서버#1)에서 앞에서 만든 /data 디렉터리를 마운트 해주도록 합니다. 마운트를 하게 되면 파일 시스템이 생성되어 /dev/drbd0 ext4의 형태로 /data 파일시스템이 보이게 됩니다. 이후 웹 콘솔을 통해서 MCCS 구성을 진행하도록 하겠습니다.

     

    2021.08.23 - [System and Cloud/Linux] - LINUX MCCS 클러스터 구축하기 실습(1)

     

    LINUX MCCS 클러스터 구축하기 실습(1)

    LINUX MCCS클러스터(mantech)  구축하기 실습 리눅스 운영체제의 실습 환경에서 사전에 TEST#1,#2 두 개의 서버와 각각 해당하는 아이피에 대한 준비가 되어 있는 상태에서 실습을 진행함. [사전 준비

    pinetreeday.tistory.com

    PS. 포스팅의 내용은 제 기준으로 작성한 것이기 때문에 참고해서 보시면 감사하겠습니다.

    또한 맨텍 실습 교육을 통해 정리 후 포스팅한 글입니다.

    포스팅 과정의 오류 및 오타 그리고 궁금한 점에 대해서는 댓글 남겨주세요.

    반응형

    댓글

Designed by Tistory.