说明
如果您想在 Ubuntu 22.04 或 ARM 架构处理器上运行 StarRocks,则需要从 StarRocks Docker Hub 下载并运行特定标签的 Docker 镜像,并从 Docker 容器目录 /data/starrocks 下复制二进制文件到您的主机。
依据不同的工作负载复杂性,StarRocks 每个 CPU 线程每秒可以处理 10M 至 100M 行数据。您可以据此估计集群中需要多少 CPU 线程能够满足您的要求。而 StarRocks 在存储数据时利用列存储和压缩,可以达到 4-10 倍的压缩比,您可以使用该数据来估计集群所需的存储量。
StarRocks 仅支持 JDK 作为依赖,不支持使用 JRE。
系统参数配置
关闭Transparent Huge Pages 与 部分内核参数
echo never > /sys/kernel/mm/transparent_hugepage/enabled
chmod +x /etc/rc.d/rc.local
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >>/etc/rc.d/rc.local
echo "echo 120000 > /proc/sys/kernel/threads-max" >>/etc/rc.d/rc.local
echo "echo 60000 > /proc/sys/vm/max_map_count" >>/etc/rc.d/rc.local
echo "echo 200000 > /proc/sys/kernel/pid_max" >>/etc/rc.d/rc.local
编辑 /etc/sysctl.conf ,调整内核参数
vm.overcommit_memory=1
vm.swappiness=0
vm.min_free_kbytes = 10551236
vm.max_map_count=655350
fs.aio-max-nr = 1048576
fs.nr_open=20480000
fs.file-max = 76724600
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_abort_on_overflow=1
内核参数生效
sysctl -p
jdk
保证/etc/profile中有 java_home
install mysql-client
wget https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
rpm -Uvh mysql80-community-release-el7-2.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum install mysql-community-client -y
config starrocks
[root@vm11 opt]# wget -c https://releases.starrocks.io/starrocks/StarRocks-3.0.4.tar.gz
[root@vm11 opt]# tar -xf StarRocks-3.0.4.tar.gz
[root@vm11 opt]# mv StarRocks-3.0.4 starRocks
[root@vm11 opt]# cd starRocks/
[root@vm11 starRocks]# cd fe/
[root@vm11 fe]# ls
bin conf lib spark-dpp webroot
[root@vm11 fe]# mkdir /opt/starRocks/fe/meta
[root@vm11 fe]# mkdir /opt/starRocks/be/meta
[root@vm11 fe]# cd conf/
[root@vm11 conf]# vim fe.conf
注意
当一台机器拥有多个 IP 地址时,需要在 FE/BE 配置文件 conf/fe.conf ,be.conf中设置 priority_networks,为该节点设定唯一 IP。
start fe
[root@vm11 starRocks]# sh /opt/starRocks/fe/bin/start_fe.sh --daemon
[root@vm11 starRocks]# mysql -h 127.0.0.1 -P9030 -uroot -e 'show frontends\G'
*************************** 1. row ***************************
Name: 10.203.1xx.xx_9010_1689848223234
IP: 10.203.1xx.xx
EditLogPort: 9010
HttpPort: 8030
QueryPort: 9030
RpcPort: 9020
Role: LEADER
ClusterId: 2067414157
Join: true
Alive: true
ReplayedJournalId: 10
LastHeartbeat: 2023-07-20 18:17:14
IsHelper: true
ErrMsg:
StartTime: 2023-07-20 18:17:10
Version: 3.0.4-f8ff06d
start be
[root@vm11 starRocks]# mysql -h 127.0.0.1 -P9030 -uroot -e 'alter system add backend "10.203.192.33:9050"'
[root@vm11 starRocks]# mysql -h 127.0.0.1 -P9030 -uroot -e 'show backends\G'
*************************** 1. row ***************************
BackendId: 10006
IP: 10.2xx.1xx.xx
HeartbeatPort: 9050
BePort: -1
HttpPort: -1
BrpcPort: -1
LastStartTime: NULL
LastHeartbeat: NULL
Alive: false
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: 0.000
AvailCapacity: 1.000 B
TotalCapacity: 0.000
UsedPct: 0.00 %
MaxDiskUsedPct: 0.00 %
ErrMsg:
Version:
Status: {"lastSuccessReportTabletsTime":"N/A"}
DataTotalCapacity: 0.000
DataUsedPct: 0.00 %
CpuCores: 0
NumRunningQueries: 0
MemUsedPct: 0.00 %
CpuUsedPct: 0.0 %
[root@vm11 starRocks]# sh /opt/starRocks/be/bin/start_be.sh --daemon
[root@vm11 starRocks]# tailf /opt/starRocks/be/log/be.INFO
I0720 18:19:09.618156 18446 tablet_manager.cpp:1244] creating tablet meta. next_unique_id=13
I0720 18:19:09.618315 18444 tablet_manager.cpp:223] Created tablet 10068
I0720 18:19:09.618423 18446 tablet_manager.cpp:223] Created tablet 10070
I0720 18:19:09.633759 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10075
I0720 18:19:09.633826 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10077
I0720 18:19:09.633842 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10079
I0720 18:19:09.633862 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10081
I0720 18:19:09.633868 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10083
I0720 18:19:09.633874 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10085
I0720 18:19:09.633879 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10087
I0720 18:19:09.633951 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10089
I0720 18:19:09.633939 18444 tablet_manager.cpp:154] Creating tablet 10075
I0720 18:19:09.633958 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10091
I0720 18:19:09.633967 18629 agent_server.cpp:410] Submit task success. type=CREATE, signature=10093
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。