Search

Standard Cluster

문서번호 : 11-516014

설치환경

CPU : 4 vCPU Memory : 4GB Storage : 20GB OS : Cent OS 7
Bash
복사
💡
▶ 본 설치 과정의 사용자 계정은 singlestore입니다. 계정 생성과정은 생략합니다. ▶ 예시로 제시된 설치환경은 설치 테스트를 위한 최소 환경입니다. 운영 및 성능 테스트 환경으로 적합하지 않습니다. ⚠️라이선스 취득 과정은 생략되어 있습니다. Free (or trial) license가 없는 경우 wiki 또는 ‘Cluster-in-a-Box (Docker)’ 페이지 참조하세요.

Cluster 구성도

SingleStore의 기본 클러스터는 Master aggregator와 Child aggregator, 그리고 4개의 Leaf 노드들로 구성 되어 있습니다.
본 설치 과정은 테스트가 목적이므로 간단하게 Master aggregator와 1개의 Leaf 노드로 구성하여 설치하며, 편의상 Master Aggregator에서 진행합니다.
💡
Cluster에 편입될 모든 노드의 IP와 노드의 역할을 결정해 두실 것을 권장합니다. public network과 singlestore의 network을 분리하고자 한다면 사용하고자 하는 network의 IP을 사용하십시오.

사용자에 대해 sudo 권한 부여

root계정에서 설정
visudo -f /etc/sudoers 다음 라인 추가 singlestore ALL=(ALL) NOPASSWD:ALL
Bash
복사

네트워크 관련

방화벽 종류에 따라 설정이 상이할 수 있습니다. 방화벽 해제 상태라면 생략합니다.
방화벽 해제는 설치하려는 모든 노드에서 동일하게 진행합니다.
1.
firewalld 동작 여부 확인
systemctl status firewalld
Bash
복사
2.
firewalld 설정 변경 및 재적용
sudo firewall-cmd --zone=public --permanent --add-port=22/tcp sudo firewall-cmd --zone=public --permanent --add-port=3306/tcp sudo firewall-cmd --zone=public --permanent --add-port=443/tcp sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp sudo firewall-cmd --reload
Bash
복사
여기까지 Master, Leaf node 서버에 동시 적용해야 할 사항입니다.
다음 과정부터 Master node 서버에서만 진행합니다.

SSH Key 생성 및 복제

ssh 명령을 통해 remote 실행시 prompt 를 방지하기 위한 설정입니다.
이미 key 가 생성되어 있거나, remote의 authorized key에 등록되어 prompt가 제거된 상태라면, 생략 가능합니다.
ssh-keygen # enter 4회
Bash
복사
cd .ssh ssh-copy-id -i id_rsa.pub <Leaf 노드 IP>
Bash
복사
ssh-copy-id는 password authentication이 필요합니다. Cloud 의 IaaS 와 같이 authentication이 disable된 곳에서는 public key를 직접 각 노드의 ~/.ssh/authorized_keys에 추가해야 합니다.

패키지 파일 다운

singlestore directory 생성
mkdir singlestore
Bash
복사
singlestore 패키지 다운
CLI Deployment - Tarball (singlestore.com) 링크로 접속하여 singlestore 패키지 링크로 이동합니다.
중간 정도 내려가면 패키지 링크 박스가 있습니다.
각각 링크 주소를 복사한 다음 wget 명령어로 다운로드 합니다.
# 예시 cd ~/singlestore wget https://release.memsql.com/production/tar/x86_64/singlestoredb-toolbox-1.13.10-74b5063715.x86_64.tar.gz wget https://release.memsql.com/production/tar/x86_64/singlestoredb-studio-4.0.7-7ce5bef293.x86_64.tar.gz wget https://release.memsql.com/production/tar/x86_64/singlestore-client-1.0.7-9e7c21fd02.x86_64.tar.gz wget https://release.memsql.com/production/tar/x86_64/singlestoredb-server-7.6.21-25dd93a9b3.x86_64.tar.gz
Bash
복사
참고
💡
본 과정에서 설치한 version은 7.6 (구) version입니다. 최신 version을 원하시면 아래 이미지를 참고하세요.
화살표 표기된 곳에서 version 설정을 하시면 됩니다.
패키지가 잘 다운로드 되었는지 확인합니다.
download하는 singlestore version에 따라 file 명이 다를 수 있습니다.

패키지 설치

toolbox, client, studio 패키지 압축 풀기
tar xvfz singlestore-client-1.0.7-9e7c21fd02.x86_64.tar.gz -C ~/singlestore tar xvfz singlestoredb-studio-4.0.7-7ce5bef293.x86_64.tar.gz -C ~/singlestore tar xvfz singlestoredb-toolbox-1.13.10-74b5063715.x86_64.tar.gz -C ~/singlestore
Bash
복사

쉘 환경변수(PATH) 영구 설정

vi ~/.bash_profile # 기존 PATH에 추가 export PATH=$PATH:~/singlestore/singlestore-client-<version>:~/singlestore/singlestoredb-studio-<version>:~/singlestore/singlestoredb-toolbox-<version> source ~/.bash_profile
Bash
복사

CLI(Command-Line Interface) 이용

클러스터의 Master Aggregator 등록

SingleStore 상의 Master Aggregator는 한 시점에 한 노드만 허용합니다.
sdb-toolbox-config register-host --yes --localhost --host <MA_IP> --tar-install-dir ~/singlestore
Bash
복사
MA_IP : Master aggregator의 IP

클러스터의 일반 host 등록

sdb-toolbox-config register-host --yes --host <LF1_IP> --tar-install-dir ~/singlestore
Bash
복사
LF1_IP : Leaf 1 노드의 IP. 설치 파일시스템의 지정등 추가 옵션은 설치가이드 참조.
💡
추가로 Child Aggregator, Leaf 노드의 서버 호스트를 추가하고 싶다면 아래를 참고하세요
# Child Aggregator host 등록 sdb-toolbox-config register-host --yes --host <CA_IP> # Leaf2, Leaf3, Leaf4 host 등록 sdb-toolbox-config register-host --yes --host <LF2_IP> sdb-toolbox-config register-host --yes --host <LF3_IP> sdb-toolbox-config register-host --yes --host <LF4_IP>
Bash
복사

클러스터의 모든 host 확인

클러스터에 등록된 호스트 목록을 확인합니다. 이 곳에 조회되는 노드에 대해 소프트웨어 배포가 자동으로 이루어집니다.
sdb-toolbox-config list-hosts
Bash
복사

singlestoredb-server 설치

sdb-deploy install --yes --all --force-package-format tar --file-path ~/singlestore/<singlestoredbserver [tar.gz]>
Bash
복사

클러스터 Master Aggregator 구성

클러스터 상에 create-node 명령으로 노드를 생성하고, 이 때 생성되는 MemSQL ID를 이용해 노드의 역할을 지정합니다. License key 는 본인의 취득한 키를 사용합니다.
sdb-admin create-node --yes --password <pw> --host <MA_IP> --port <MA_PORT> --base-install-dir ~/singlestore/nodes/MA sdb-admin bootstrap-aggregator --yes --license <license_key> --memsql-id <MemSQL ID>
Bash
복사
💡
클러스터 Child Aggregator 구성을 원한다면 아래를 참고하세요. (option)
sdb-admin create-node --yes --password <pw> --host <CA_IP> --port <CA_PORT> --base-install-dir ~/singlestore/nodes/CA sdb-admin add-aggregator --yes --password <pw> --memsql-id <MemSQL ID>
Bash
복사

클러스터 Leaf 1 구성

Master aggregator와 유사하게 create-node 후 확보한 MemSQL ID를 add-leaf 에 사용합니다.
sdb-admin create-node --yes --password <pw> --host <LF1_IP> --port <LF1_PORT> --base-install-dir ~/singlestore/nodes/LF1 sdb-admin add-leaf --yes --password <pw> --memsql-id <MemSQL ID>
Bash
복사
💡
Leaf 노드를 추가하고 싶다면 위 Leaf 1 구성과 같은 절차를 반복합니다.

클러스터 구성 확인

sdb-admin list-nodes
Bash
복사
노드에 추가된 Aggregator와 Leaf의 수에 따라 출력되는 결과가 다를 수 있습니다.

Node 시작 및 정지

sdb-admin start-node --all --yes # 모든 노드들 활성화 sdb-admin stop-node --all --yes # 모든 노드들 비활성화
Bash
복사

SingleStore DB Studio 연결

studio 설정

설치했던 singlestore-studio 디렉토리로 접속합니다.
cd singlestore/singlestoredb-studio-4.0.7-7ce5bef293/
Bash
복사
studio.hcl 과 studio.log 파일을 생성합니다.
touch studio.hcl studio.log
Bash
복사
singlestoredb-studio.hcl 파일을 열어 statePath, logPath의 경로를 직접 설정해 주어야 합니다.
vi singlestoredb-studio.hcl host = [Host IP 주소] port = [Studio용 Port 번호] # 기본 port 8080을 입력하면 됩니다. statePath = "/Path/TO/studio.hcl" # 클러스터 접속 정보 logPath = "/Path/TO/singlestoredb-studio/studio.log" # 로그 파일 위치
Bash
복사

Studio 실행

singlestoredb-studio &
Bash
복사
Browser를 이용해 [Master node IP]:8080 으로 접속
Add an Existing Cluster 선택

Locate Cluster 설정

Hostname : Master node IP
port : 3306

Enter Credentials 설정

Username : root
Password : 자유롭게 설정

Create Cluster Profile 설정

Type : 자유 선택
Cluster Name : 자유롭게 작명
Description : 자유롭게 작명

Studio Main Page

SingleStoreDB Studio 구축 완료!

History

일자
작성인
내역
2022.09.06
Lee
최초 생성
📧