使用docker部署单机测试版starrocks

发布时间:2025-01-02 04:23

使用docker部署单机测试版starrocks

原创

©著作权归作者所有:来自51CTO博客作者我的二狗呢的原创作品,请联系作者获取转载授权,否则将追究法律责任

官方文档

​ ​https://docs.starrocks.io/zh-cn/latest/administration/deploy_with_docker​​

在使用官方文档的安装的时候,遇到些问题(主要是jdk yum安装的版本变动导致的)。

我这里稍微优化了下,具体记录如下。

准备好离线安装包

mkdir /usr/local/starrocks -pv
cd /usr/local/starrocks

wget https://download.starrocks.com/zh-CN/download/request-download/55/StarRocks-2.3.3.tar.gz

另外,再准备好 jdk-8u202-linux-x64.tar.gz 压缩包(或者yum在线下载也行,但是yum下载的默认情况下版本可能会有变化)

文件列表如下:
# root @ centos7-3 in /usr/local/starrocks [13:33:41]
$ l
.rw-r--r-- root root 185 MB 2022-02-22 16:54:59  jdk-8u202-linux-x64.tar.gz
.rw-r--r-- root root 1.8 GB 2022-09-27 15:52:04  StarRocks-2.3.3.tar.gz
.rwxr-xr-x root root 91 B 2022-10-08 16:47:47  build.sh
.rwxr-xr-x root root 141 B 2022-10-08 16:48:19  run.sh
.rwxr-xr-x root root 65 B 2022-10-08 16:50:48  conn.sh
.rw-r--r-- root root 756 B 2022-11-07 12:33:32  Dockerfile
.rwxr-xr-x root root 551 B 2022-11-07 12:33:48  run_script.sh

1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.

准备dockerfile如下

$ cat Dockerfile
FROM centos:centos7

# Prepare StarRocks Installer.
RUN mkdir -p /data/deploy/
COPY StarRocks-2.3.3.tar.gz /data/deploy/StarRocks-2.3.3.tar.gz
RUN cd /data/deploy/ && tar zxf StarRocks-2.3.3.tar.gz

# Install Java JDK.
COPY jdk-8u202-linux-x64.tar.gz /opt/
RUN cd /opt/ && tar xf jdk-8u202-linux-x64.tar.gz
RUN /opt/jdk1.8.0_202/bin/java -version

# Create directory for FE meta and BE storage in StarRocks.
RUN mkdir -p /data/deploy/StarRocks-2.3.3/fe/meta
RUN mkdir -p /data/deploy/StarRocks-2.3.3/be/storage

# Install relevant tools.
RUN yum -y install mysql net-tools telnet

# Run Setup script.
COPY run_script.sh /data/deploy/run_script.sh
RUN chmod +x /data/deploy/run_script.sh
CMD /data/deploy/run_script.sh

1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.

准备启动脚本如下:

$ cat run_script.sh
#!/bin/bash

# Set JAVA_HOME.
export JAVA_HOME=/opt/jdk1.8.0_202/

# Start FE.
cd /data/deploy/StarRocks-2.3.3/fe/bin/
./start_fe.sh --daemon

sleep 30;

# Start BE.
cd /data/deploy/StarRocks-2.3.3/be/bin/
./start_be.sh --daemon

# Sleep until the cluster starts.
sleep 30;

# Set BE server IP.
IP=$(ifconfig eth0 | grep 'inet' | cut -d: -f2 | awk '{print $2}')
mysql -uroot -h${IP} -P 9030 -e "alter system add backend '${IP}:9050';"

# Loop to detect the process.
while true; do
ps aux | grep starrocks | grep -q -v grep
PROCESS_STATUS=$?
done

1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.

打包

docker build --no-cache --progress=plain -t starrocks:1.0 .

1.

启动

docker run -p 9030:9030 -p 8030:8030 -p 8040:8040 --privileged=true -itd --name starrocks-test starrocks:1.0

1.

连接starrocks

mysql -uroot -h127.0.0.1 -P 9030

[(none)]> SHOW PROC '/backends'\G
*************************** 1. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 172.17.0.2
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2022-11-07 04:40:38
LastHeartbeat: 2022-11-07 05:34:25
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 10
DataUsedCapacity: .000
AvailCapacity: 37.899 GB
TotalCapacity: 294.971 GB
UsedPct: 87.15 %
MaxDiskUsedPct: 87.15 %
ErrMsg:
Version: 2.3.3-164799c
Status: {"lastSuccessReportTabletsTime":"2022-11-07 05:33:39"}
DataTotalCapacity: 37.899 GB
DataUsedPct: 0.00 %
CpuCores: 8
1 row in set (0.00 sec)

[(none)]> SHOW PROC '/frontends'\G
*************************** 1. row ***************************
Name: 172.17.0.2_9010_1667795978250
IP: 172.17.0.2
EditLogPort: 9010
HttpPort: 8030
QueryPort: 9030
RpcPort: 9020
Role: FOLLOWER
IsMaster: true
ClusterId: 1090400975
Join: true
Alive: true
ReplayedJournalId: 990
LastHeartbeat: 2022-11-07 05:34:25
IsHelper: true
ErrMsg:
StartTime: 2022-11-07 04:39:50
Version: 2.3.3-164799c
1 row in set (0.02 sec)

1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50. 收藏 评论 举报

相关文章

网址:使用docker部署单机测试版starrocks https://mxgxt.com/news/view/631049

相关内容

StarRocks 2.1 新版本特性介绍
如何创建StarRocks集群
如何配置StarRocks输出组件用于向数据源写入数据
StarRocks数据质量管理
selectdb和starrocks是什么关系?
让数据分析极速统一!StarRocks和阿里云一起干了件大事
1024,我们干了点儿大事
小雅 Alist:影视资源合集
热门拉力测试机动态 吉林拉力测试机
关于新发布《演员聘用合同示范文本(试行)》及配套《使用说明》的要点解读

随便看看