之前寫過一篇427.【數(shù)據(jù)庫】starrocks 安裝踩坑锅尘,今天把詳細(xì)的安裝步驟記錄下來:
一、環(huán)境準(zhǔn)備
- starrocks 安裝包
- jdk8
- centos7服務(wù)器3臺(tái)
二、服務(wù)器互信任
在三臺(tái)服務(wù)器之間建立互信任,使得ssh 連接時(shí)谆奥,無需輸入密碼祖凫,可參考170. 【Linux】ssh-keyscan 解決“離線環(huán)境”多節(jié)點(diǎn)互信任問題,里面的腳本可直接使用违施。
互信任完成之后,就可以使用 sync_scripts.sh
腳本了瑟幕,該腳本支持將一個(gè)命令同時(shí)在互信任的幾個(gè)服務(wù)器中執(zhí)行磕蒲,省去了一些時(shí)間。有需要的自己寫一個(gè)只盹,或者也可以私信我辣往。
三、開始安裝
./sync_scripts.sh 'cd /home/path_install_starrocks ; tar -zxvf jdk-8u202-linux-x64.tar.gz &&tar -zxvf StarRocks-2.5.2.tar.gz'
- 解壓 jdk和starrocks安裝包
./sync_scripts.sh "echo 'JAVA_HOME=/home/path_install_starrocks/jdk1.8.0_202' >>/etc/bashrc"
./sync_scripts.sh "echo 'export PATH=\${PATH}:\${JAVA_HOME}/bin' >>/etc/bashrc"
./sync_scripts.sh "source /etc/bashrc"
- 配置 JAVA_HOME
- 可以看到我三臺(tái)服務(wù)器上的java都已經(jīng)配置好了
./sync_scripts.sh 'echo 0 | tee /proc/sys/vm/swappiness'
./sync_scripts.sh 'echo 1 | tee /proc/sys/vm/overcommit_memory'
- 配置參數(shù)
./sync_scripts.sh 'cd /home/path_install_starrocks/StarRocks-2.5.2/fe/conf &&ls&& echo JAVA_HOME=${JAVA_HOME} >> fe.conf'
- 修改 fe.conf
./sync_scripts.sh 'cd /home/path_install_starrocks/StarRocks-2.5.2/fe && mkdir -p meta'
- 創(chuàng)建 meta 目錄
# 停止
./sync_scripts.sh 'cd /home/path_install_starrocks/StarRocks-2.5.2/fe/bin && ./stop_fe.sh --daemon'
# 啟動(dòng)
./sync_scripts.sh 'cd /home/path_install_starrocks/StarRocks-2.5.2/fe/bin && ./start_fe.sh --daemon'
-
啟動(dòng)fe
- 可以看到fe已經(jīng)啟動(dòng)成功了
./sync_scripts.sh "echo 'export LD_LIBRARY_PATH=\${JAVA_HOME}/jre/lib/amd64/server' >> ~/.bashrc"
./sync_scripts.sh 'source ~/.bashrc'
- 解決starrocks_be 缺少依賴庫的問題
./sync_scripts.sh 'cd /home/path_install_starrocks/StarRocks-2.5.2/be && mkdir -p storage'
- 創(chuàng)建 storage 目錄
C:\Users\FENG>mysql -h xx.xxx.xxx.xxx -P9030 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 5.1.0
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ALTER SYSTEM ADD BACKEND "172.16.7.216:9050";
Query OK, 0 rows affected (0.02 sec)
mysql> ALTER SYSTEM ADD BACKEND "172.16.7.217:9050";
Query OK, 0 rows affected (0.01 sec)
mysql> ALTER SYSTEM ADD BACKEND "172.16.7.218:9050";
Query OK, 0 rows affected (0.01 sec)
mysql>
- 添加后端be節(jié)點(diǎn)
./sync_scripts.sh 'cd /home/path_install_starrocks/StarRocks-2.5.2/be && ./bin/start_be.sh --daemon'
- 啟動(dòng)be節(jié)點(diǎn)
mysql> SHOW PROC '/backends'\G;
*************************** 1. row ***************************
BackendId: 11001
IP: 172.16.7.216
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2023-02-25 16:13:58
LastHeartbeat: 2023-02-25 16:15:43
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 30
DataUsedCapacity: 0.000
AvailCapacity: 1.947 TB
TotalCapacity: 1.952 TB
UsedPct: 0.24 %
MaxDiskUsedPct: 0.24 %
ErrMsg:
Version: 2.5.2-c3772fb
Status: {"lastSuccessReportTabletsTime":"2023-02-25 16:14:59"}
DataTotalCapacity: 1.947 TB
DataUsedPct: 0.00 %
CpuCores: 4
NumRunningQueries: 0
MemUsedPct: 0.97 %
CpuUsedPct: 0.2 %
*************************** 2. row ***************************
BackendId: 11005
IP: 172.16.7.217
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2023-02-25 16:13:58
LastHeartbeat: 2023-02-25 16:15:43
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 30
DataUsedCapacity: 0.000
AvailCapacity: 1.947 TB
TotalCapacity: 1.952 TB
UsedPct: 0.24 %
MaxDiskUsedPct: 0.24 %
ErrMsg:
Version: 2.5.2-c3772fb
Status: {"lastSuccessReportTabletsTime":"2023-02-25 16:14:59"}
DataTotalCapacity: 1.947 TB
DataUsedPct: 0.00 %
CpuCores: 4
NumRunningQueries: 0
MemUsedPct: 0.97 %
CpuUsedPct: 0.0 %
*************************** 3. row ***************************
BackendId: 11006
IP: 172.16.7.218
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2023-02-25 16:13:58
LastHeartbeat: 2023-02-25 16:15:43
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 30
DataUsedCapacity: 0.000
AvailCapacity: 1.947 TB
TotalCapacity: 1.952 TB
UsedPct: 0.24 %
MaxDiskUsedPct: 0.24 %
ErrMsg:
Version: 2.5.2-c3772fb
Status: {"lastSuccessReportTabletsTime":"2023-02-25 16:14:58"}
DataTotalCapacity: 1.947 TB
DataUsedPct: 0.00 %
CpuCores: 4
NumRunningQueries: 0
MemUsedPct: 0.97 %
CpuUsedPct: 0.2 %
3 rows in set (0.01 sec)
- 可以看到3個(gè)節(jié)點(diǎn)都是Active=true殖卑。啟動(dòng)完畢
- navicat 也連接測(cè)試成功了