문서번호 : 11-233596
여러 시스템에 SingleStore DB 클러스터 배포를 하는 명령어입니다.
1) CLI 방식으로 배포: (IP 대신 hostname 사용가능)
sdb-deploy setup-cluster \
> --master-host <MA_IP> \
> --aggregator-hosts <CA_IP> \
> --leaf-hosts <LF1_IP>, <LF2_IP>, <LF3_IP>, <LF4_IP> \
> --identity-file ~/my_key.pem \
> --license <license_key> \ # 라이선스 키
> --password <dbpw> # 비밀번호
Bash
복사
자세한 내용을 원하시면, 다음 링크를 참고하십시오.
2) YAML 파일로 배포
•
용법
sdb-deploy setup-cluster --cluster-file <path-to-cluster-file> # YAML 파일 작성 후 실행
Bash
복사
•
YAML 파일 템플릿: (MA, CA, LF 구성)
license: <LICENSE> [Required to bootstrap Master Aggregator]
high_availability: <true | false>
memsql_server_version: <the version of memsql you want to install (7.8+)>
memsql_server_file_path:<path to the downloaded memsql server file>
package_type: <deb|rpm|tar> [Required if multiple package present]
root_password: <default password to be used for all nodes>
optimize: <true | false>
optimize_config:
 memory_percentage: <percentage of memory you want memsql to use>
 no_numa: <true|false>
hosts:
- hostname: <host-name> [Required]
 localhost: <true | false> 
 memsqlctl_path: <path to memsqlctl> [ADVANCED]
 memsqlctl_config_path:<path to memsqlctl config> [ADVANCED]
 tar_install_dir: <path to tar install dir> [ADVANCED]
 tar_install_state: <path to tar install state> [ADVANCED]
 ssh: [Required for remote Hosts]
	 host: <ssh host name>
	 port: <ssh port>
	 user: <ssh user>
	 private_key: <path to your identity key>
 nodes:
 - register: <true | false>
 role: <Unknown | Master | Leaf | Aggregator> (case sensitive) [Required]
 availability_group: <availability group>
 no_start: <true | false>
 variables: 
	 secure_file_priv: <location>
 config: 
	 auditlogsdir: <path to auditlogs directory> [ADVANCED]
	 baseinstalldir: <path to base install directory> [ADVANCED]
	 configpath: <path to configuration path> [ADVANCED][Required if register is true]
	 datadir: <path to data directory> [ADVANCED]
	 disable_auto_restart: <true | false>
	 password: <password>
	 plancachedir: <path to plancache directory> [ADVANCED]
	 port: <port number> [Required for node creation]
	 tracelogsdir: <path to tracelogs directory> [ADVANCED]
	 bind_address: <bind address> [ADVANCED]
Bash
복사
•
YAML 파일 예시 1: 하나의 장비(host)에 클러스터(MA:1, LF:1) 구성
vi setup-cluster.yaml
license: <license-key>
package_type: rpm
memsql_server_version:/home/memsql/singlestoredb-server7.8.2-8c7b918527.x86_64.rpm
root_password: <dbpw>
optimize: true
hosts:
- hostname: 10.41.8.45
  localhost: true
  nodes:
  - role: Master
	  config:
		  port: 3306
		  auditlogsdir: /data/memsql/MA/auditlogs/
		  datadir: /data/memsql/MA/data
		  plancachedir: /data/memsql/MA/plancache
		  tracelogsdir: /data/memsql/MA/tracelogs
  - role: Leaf
    config:
		  port: 3308
		  auditlogsdir: /data/memsql/LF1/auditlogs/
		  datadir: /data/memsql/LF1/data
		  plancachedir: /data/memsql/LF1/plancache
		  tracelogsdir: /data/memsql/LF1/tracelogs
Bash
복사
•
YAML 파일 예시 2: 여러 장비(host)에 클러스터(MA:1, CA:1, LF:4) 구성, HA 활성화
vi setup-cluster.yaml
license: <license-key>
high_availability: true
package_type: rpm
memsql_server_file_path: <server 7.8.2 path>
hosts:
- hostname: <hostname1>
  localhost: true
  nodes:
  - role: Master
    config:
		  password: <dbpw>
		  port: 3306
- hostname: <CA host name or IP>
  ssh:
	  host: <ssh host name or IP>
	  private_key: /home/<user>/.ssh/id_rsa
  nodes:
  - role: Aggregator
	  config:
		  password: <dbpw>
- hostname: <LF1 host name or IP>
  ssh:
	  host: <ssh host name or IP>
	  private_key: /home/<user>/.ssh/id_rsa
  nodes:
  - role: Leaf
	  availability_group: 1 
	  config:
		  password: <dbpw>
- hostname: <LF2 host name or IP>
  ssh:
	  host: <ssh host name or IP>
	  private_key: /home/<user>/.ssh/id_rsa
  nodes:
  - role: Leaf
	  availability_group: 2
	  config:
		  password: <dbpw>
- hostname: <LF3 host name or IP>
  ssh:
	  host: <ssh host name or IP>
	  private_key: /home/<user>/.ssh/id_rsa
  nodes:
  - role: Leaf
	  availability_group: 1 
	  config:
		  password: <dbpw>
- hostname: <LF4 host name or IP>
  ssh:
	  host: <ssh host name or IP>
	  private_key: /home/<user>/.ssh/id_rsa
  nodes:
  - role: Leaf
	  availability_group: 2
	  config:
		  password: <dbpw>
Bash
복사
•
Setup cluster 실행
sdb-deploy setup-cluster ./setup-cluster.yaml # 작성한 YAML 파일
Bash
복사
•
참고) 옵션 설명
| 옵션 | 설명 | 
| license | 클러스터에 사용될 라이선스 | 
| high_availability | 고가용성 활성화 여부 (기본값 false) | 
| root_password | 노드 비밀번호 | 
| optimize | true 로 설정하면, 권장 메모리 백분율로 클러스터의 메모리
사용량 및 NUMA 최적화 | 
| optimize_config | memory_percentage : SingleStore DB 가 각 호스트에서
사용하는 메모리 백분율을 지정
no_numa 옵션이 true 로 설정된 경우: 클러스터의 NUMA
최적화는 수행되지 않음 | 
| memsql_server_version | singlestoredb-server 버전 | 
| msql_server_file_path | singlestoredb-server 패키지의 경로 | 
| package_type | 설치에 사용할 패키지 유형(rpm, deb, tar) | 
| hostname | 클러스터 주소를 지정 가능한 호스트 이름
로컬 호스트를 하나만 사용할 수 있는 경우, 127.0.0.1 | 
| localhost | localhost 지정 (기본값 false) | 
| memsqlctl_path | memsqctl 바이너리 파일 경로 | 
| memsqlctl_config_path | memsqlctl.hcl 바이너리 파일 경로 | 
| tar_install_dir | tarball 디렉터리 | 
| tar_install_state | packages.hcl 파일 경로 | 
| user | ssh 호스트의 사용자 | 
| port | ssh 포트 (기본값 22) | 
| host | ssh 호스트 이름 | 
| private_key | 호스트의 ID 파일 (일반적으로 ~<user>/.ssh) | 
| register | false: 새 노드 생성시
true: 노드가 이미 있어, 해당 노드를 Toolbox 에 등록함 | 
| role | 노드의 역할 (Master, Leaf, Aggregator, Unknown) | 
| availability_group | 가용성 그룹(고가용성 설정시, true) - 자세한 내용은 가용성 그룹 을 참조 | 
| no_start | true 로 설정시, 생성 후 노드가 시작되지 않음 | 
| secure_file_priv | 각 노드에 대해 가져오기 또는 내보내기 작업을 제한해야 하는
디렉토리 (기본값: <defaultInstallDir>/db-files)
자세한 내용은 기본 설치 디렉터리 및 비동기화 변수 설정 참조 | 
| port | 포트 번호 (기본값: 3306) | 
| disable_auto_restart | true 설정시, 노드가 충돌해도 자동으로 다시 시작되지 않음 | 
| password | SingleStore DB 노드의 비밀번호 | 
| defaultinstalldir | 기본 설치 디렉터리(deafalt: /var/lib/memsql) | 
| auditlogsdir | auditlogs 디렉토리의 절대 경로 | 
| baseinstalldir | 기본 설치 디렉토리의 절대 경로 | 
| configpath | 노드 구성 파일의 절대 경로 | 
| datadir | 노드 data 디렉토리의 절대 경로 | 
| plancachedir | plancache 디렉토리의 절대 경로 | 
| tracelogsdir | tracelogs 디렉토리의 절대 경로 | 
| 일자 | 작성자 | 비고 | 
| 2022.4.29 | min | |


