Install SingleStore on Docker : Desktop
This guide will install a preconfigured docker image that contains a simple one node
ㅁ SingleStore DB 설치하는 과정을 정리하여 봅니다.
1. https://www.singlestore.com/
- singlestore 사이트에 접속하여 본문의 "Start Free" 버튼을 선택 합니다.
2. 회원 가입 및 로그인을 합니다.
3. SingleStore 사용자 포탈에 접속 합니다.
- https://portal.singlestore.com/
(1) 아래 우측 상단의 "ORGANIZATION" 을 선택 합니다.
(2) Licenses 를 선택합니다.
(3) 아래 라이선스를 복사하여 둡니다.
(4) 우측의 " Install SingleStore" 를 선택 합니다.
ㅁ Install SingleStore Offline
ㅁ STEP 1 : Select Installation Type with Quick Start and select " Docker" install
ㅁ STEP2 : Setup Docker on your system and create docker container with password
- 아래 위의 Licence 와 아래 PASSWORD를 복사합니다.
1. - Install Docker : 도커 설치 완료 후 진행이 가능합니다.
2. Configure Docker : 도커의 방화벽 및 메모리 등을 확인 합니다.
3. Password를 선택합니다.
4. 도커 이미지를 생성합니다.
- 위에서 복사해둔 라이선스와 패스워드를 이용해 이미지를 다운받고 컨테이너를 생성합니다.
- 아래 복사 버튼으로 스크립트를 복사하여 실행 하면 됩니다.
도커 컨테이너 이름을 "singlestore-ciab" 로 생성을 합니다.
위에서 저장한 라이선스와 패스워드를 함께 저장하여 실행합니다.
# CREATE DOCLER CONTER WITH NAME "singlestore-ciab"
sudo docker run -i --init \
--name singlestore-ciab \
-e LICENSE_KEY="PASTE_LICENCE_HERE-ADFAFADFAAAAAAAAAAAEAAAAAAAAACgwNgIZAOImmJjxORM18XP8ahw7W4+b/cctysozqQIZAPCfEtjbWaEYZE8+giBxdCRLhge39KtdzQ==" \
-e ROOT_PASSWORD="PASTE_PASSWORD_HERE-cooYZM0BMg9L" \
-p 3306:3306 -p 8080:8080 \
singlestore/cluster-in-a-box
5. 도커 이미지를 확인하고 실행합니다.
sudo docker images
sudo docker start singlestore-ciab
- 도커가 실행 상태를 확인 합니다.
* 8080 , 3306 Port를 열어 두고 있습니다.
[root@vbox singleDB]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cbb6ef2ba99f singlestore/cluster-in-a-box "bash /startup" About a minute ago Up 42 seconds 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 3307/tcp singlestore-ciab
6. 리눅스 방화벽을 확인합니다.
다음과 같이 firewall에 해당 port 들이 오픈되어 있는지 확인하고 열어 줍니다.
firewall-cmd --list-services
firewall-cmd --add-service=mysql
firewall-cmd --add-services=http,https
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --add-port=8080/tcp6 --permanent
firewall-cmd --list-services
7. Connect With 웹브라우저 또는 SQL Clinent
웹브라우저 또는 SQL Clinet 툴로 위에서 받은 Password를 이용하여 DB 계정 : root 로 접속을 하면 됩니다.
8. 이제 웹브라우저로 포탈을 이용해서 DB를 관리하면 됩니다.
- 방화벽이나 서비스가 정상적이라면 아래 화면이 보일 것입니다.
앞에서 받는 패스워드로 로그인 하므로 패스워드는 꼭 보관해 둡니다.
관리 포탈을 통해 SQL 실행과 노드 관리가 가능합니다.
ㅁ SingleStore 는 Master Aggregrator 와 Leaf Data Node로 구성됩니다.
ㅁ SQL EDITOR를 이용하여 서버에 Query가 가능합니다.
create Database를 실행 했는데 디스크 용량이 모자라서 실행이 안되네요 ( 30 GB 용량의 여분이 있어야 합니다)
이보다 작은 용량으로 ㅈ
(CREATE DATABASE 오류: 30GB가 필요함)
ERROR 2729 UNKNOWN_ERR_CODE: Not enough disk space to create or attach database test_rag on leaf 127.0.0.1:3307. Estimate Available 13282 MB, Estimate Needed 28159 MB.
이상 기본 설치하고 사용하는 방법을 정리해 보았습니다.
[참고] 도커 이미지를 생성하는 과정은 아래와 같습니다.
포탈에 있는
아래와 같이 이미지를 다운받아 도커를 실행합니다.
[root@vbox singleDB]# sudo docker run -i --init \
--name singlestore-ciab \
-e LICENSE_KEY=" LICENCE_HERE-iBe39KtdzQ==" \
-e ROOT_PASSWORD="PASSWRD_HERE rzclK03LNMg9L" \
-p 3306:3306 -p 8080:8080 \
singlestore/cluster-in-a-box
Unable to find image 'singlestore/cluster-in-a-box:latest' locally
latest: Pulling from singlestore/cluster-in-a-box
cdfe3ece1d98: Pull complete
2731779f43b4: Pull complete
f603cee2baf7: Pull complete
2c5643fcbfd2: Pull complete
853bc094dca4: Pull complete
110e7563d095: Pull complete
27b7105dd343: Pull complete
cd4d7053b707: Pull complete
ce99fb609fa0: Pull complete
fd7bfc63565e: Pull complete
23df794f8a18: Pull complete
1a5103d63b35: Pull complete
d56a4c3fe2a0: Pull complete
1e7fa618527c: Pull complete
75e5d3cf4e39: Pull complete
5965bcf6eac8: Pull complete
e5a678fed56e: Pull complete
6dd31f97d6d2: Pull complete
ff3a0d177939: Pull complete
b7fed212674e: Pull complete
8aec85beb547: Pull complete
Digest: sha256:272456ccaa4885ed765d91f35f942dccdad72822e5c4df63b88a3fea934b50ad
Status: Downloaded newer image for singlestore/cluster-in-a-box:latest
Initializing SingleStore Cluster in a Box
Creating...
memsqlctl will perform the following actions:
· Create node on port 3307
- Base directory = /var/lib/memsql/75f2a6a7-1add-4be0-b0e5-19db8bb07d98
- Config file = /var/lib/memsql/75f2a6a7-1add-4be0-b0e5-19db8bb07d98/memsql.cnf
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Creating node
✓ Created node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
Done.
Configuring...
memsqlctl will perform the following actions:
· Update configuration setting on node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938 on port 3306
- Update node config file with setting minimum_core_count=0
· Update configuration setting on node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001 on port 3307
- Update node config file with setting minimum_core_count=0
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Updating node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Updated node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
Updating node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
✓ Updated node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
memsqlctl will perform the following actions:
· Update configuration setting on node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938 on port 3306
- Update node config file with setting minimum_memory_mb=0
· Update configuration setting on node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001 on port 3307
- Update node config file with setting minimum_memory_mb=0
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Updating node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Updated node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
Updating node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
✓ Updated node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
memsqlctl will perform the following actions:
· Update configuration setting on node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938 on port 3306
- Update node config file with setting fts2_java_path=/usr/lib/jvm/java-21-openjdk-21.0.4.0.7-1.el8.alma.1.x86_64/bin/java
· Update configuration setting on node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001 on port 3307
- Update node config file with setting fts2_java_path=/usr/lib/jvm/java-21-openjdk-21.0.4.0.7-1.el8.alma.1.x86_64/bin/java
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Updating node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Updated node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
Updating node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
✓ Updated node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
memsqlctl will perform the following actions:
· Update configuration setting on node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938 on port 3306
- Update node config file with setting fts2_java_home=/usr/lib/jvm/java-21-openjdk-21.0.4.0.7-1.el8.alma.1.x86_64
· Update configuration setting on node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001 on port 3307
- Update node config file with setting fts2_java_home=/usr/lib/jvm/java-21-openjdk-21.0.4.0.7-1.el8.alma.1.x86_64
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Updating node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Updated node config file for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
Updating node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
✓ Updated node config file for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
Done.
Bootstrapping...
memsqlctl will perform the following actions:
· Set up runtime environment
· Start node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938 on port 3306
· Start node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001 on port 3307
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Setting up runtime environment
✘ Attempted to set up runtime environment
WARNING: The NICE limit should be at most -10. This system is currently configured with the limit set to 20.
WARNING: Failed to set vm.max_map_count. To avoid memory errors, vm.max_map_count should be at least 1000000000. The current value is 65530.
Please visit https://docs.singlestore.com/memsqlctl-redir/linux-ulimit-settings for more information.
Starting nodes
✓ Started node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001 (1/2)
Starting nodes
✓ Started node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938 (2/2)
Starting nodes
✓ Started 2 nodes
memsqlctl will perform the following actions on the node on port 3306:
· Run `SET LICENSE = 'LICENCE_HERE-Lhge39KtdzQ=='`
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Setting license on node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Set license on node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
memsqlctl will perform the following actions on the local node on port 3306:
· Run `BOOTSTRAP AGGREGATOR 127.0.0.1`
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Bootstrapping node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Bootstrapped node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
memsqlctl will perform the following actions on the local master aggregator on port 3306:
· Run `ADD LEAF root:****@127.0.0.1:3307`
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Adding node 127.0.0.1:3307 to cluster
✓ Added leaf 127.0.0.1:3307 to cluster
memsqlctl will perform the following actions
· On node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938:
- Run 'SET PASSWORD FOR root@% = PASSWORD(****)'
· On node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001:
- Run 'SET PASSWORD FOR root@% = PASSWORD(****)'
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Setting new password for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
✓ Set new password for node with node ID FB3806561875F5F53DAD1DAFD047BB3F96B0C938
Setting new password for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
✓ Set new password for node with node ID 4C7C91A905C1D6CF576D04D63A15B08B23AFA001
Done.
Configuring Toolbox...
WARNING: Specifying both --localhost and --host 127.0.0.1 or ::1 is a mistake in most cases unless you want to setup cluster-in-a-box.
You need to use a cluster-addressable IP for this host so that it can be accessed from other hosts in the cluster.
Do you want to continue with your configuration? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Toolbox is about to register the following host:
· Host: 127.0.0.1
· Localhost: true
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
Toolbox is about to perform the following actions:
· Update specific system files on host 127.0.0.1 for the initial cluster configuration.
Files to be added:
- /etc/sysctl.d/90-singlestore.conf
Files to be updated:
- /sys/kernel/mm/transparent_hugepage/defrag
- /sys/kernel/mm/transparent_hugepage/enabled
- /etc/security/limits.conf
Create a link to /etc/pki/tls/certs/ca-bundle.crt if the file exists in a standard location.
Add a new systemd service, if available:
- /etc/systemd/system/singlestoreConfigOS.service - .service file
- /etc/singlestoreConfigOS - service logic file
To skip this step, re-run this command with the --skip-auto-config flag.
The host may require a reboot for these changes to take effect. To restart your cluster after a reboot, run 'sdb-admin restart-node --all'.
Would you like to continue? [Y/n]:
Automatically selected yes, non-interactive mode enabled
WARNING: Failed to set root privilege to update configuration files
WARNING: Failed to configure some system settings. Please use the following instructions in the documentation to manually configure the host: https://docs.singlestore.com/docs/system-requirements/columnstore-performance/
Registering host 127.0.0.1
✓ Successfully registered host 127.0.0.1
+-----------+------------+-------------+---------------+
| Host | Local Host | SSH address | Identity File |
+-----------+------------+-------------+---------------+
| 127.0.0.1 | Yes | | |
+-----------+------------+-------------+---------------+
Done.
Successful initialization!
To start the cluster:
docker start (CONTAINER_NAME)
To stop the cluster (must be started):
docker stop (CONTAINER_NAME)
To remove the cluster (all data will be deleted):
docker rm (CONTAINER_NAME)
'BigData' 카테고리의 다른 글
인공지능 주식 예측에 적합한 분석 알고리즘의 종류 (6) | 2025.01.16 |
---|---|
[인공지능 기술] LlamaIndex와 ChatGPT 사용하기 - llama-index (84) | 2024.12.12 |
How to add Firewall rules on Redhat 9 - Allow MySQL Service Through the Firewall (8) | 2024.10.03 |
MYSQL 계정 생성, 권한부여, 권한 삭제 (5) | 2024.10.03 |
[인공지능] ARIMA -주가 예측 모델: 3-6-9개월 후 AMZN 주가 확인 - (2) | 2024.08.12 |
[GPT기술] Llama2 AI모델을 이용한 검색 기술에 활용하기 (122) | 2024.05.22 |
[인공지능 기술] RAG를 위한 라마인덱스의 정리 - llamaindex 의 특징 (2) | 2024.05.12 |