ansible clickhouse -m copy -a "src=/root/.bashrc dest=/root/.bashrc " ansible clickhouse -m shell -a "java -version "
1 2 3
ansible clickhouse -m shell -a "yum install -y rsync " ansible clickhouse -m synchronize -a "src=/opt/module/StarRocks dest=/opt/module/" ansible clickhouse -m shell -a " ls /opt/module/StarRocks "
fe部署
第一次启动需指定–helper参数,后续再启动无需指定此参数
sh /opt/module/StarRocks/fe/bin/start_fe.sh --helper 172.20.85.111:9010 --daemon
1 2
ansible fe -m shell -a " sh /opt/module/StarRocks/fe/bin/stop_fe.sh " ansible fe -m shell -a " sh /opt/module/StarRocks/fe/bin/start_fe.sh --daemon "
1 2 3 4 5 6
mysql -h 127.0.0.1 -P9030 -uroot -p mysql> SHOW PROC '/frontends'\G ALTERSYSTEMADD FOLLOWER "172.20.85.112:9010"; ALTERSYSTEMADD FOLLOWER "172.20.85.142:9010"; # ALTER SYSTEM DROP FOLLOWER "172.20.85.142:9010"; ALTERSYSTEMADD OBSERVER "172.20.85.113:9010";
supervisorctl status //查看所有进程的状态 supervisorctl stop be //停止 supervisorctl start be //启动 supervisorctl restart be //重启 supervisorctl update be //配置文件修改后使用该命令加载新的配置 supervisorctl reload //重新启动配置中的所有程序
官网升级
升级 BE 前的准备
1 2 3 4 5 6 7 8 9 10 11 12 13
#为了避免 BE 重启期间不必要的 Tablet 修复,进而影响升级后的集群性能,建议在升级前先在 FE Leader 上执行如下命令以禁用 Tablet 调度功能, > mysql -h 127.0.0.1 -P9030 -uroot -p
admin set frontend config ("max_scheduling_tablets"="0"); admin set frontend config ("disable_balance"="true"); admin set frontend config ("disable_colocate_balance"="true");
# 在所有 BE 重启升级完成后,通过 show backends 命令确认所有 BE 的 Alive 状态为 true 后,启用 Tablet 调度功能,
admin set frontend config ("max_scheduling_tablets"="10000"); admin set frontend config ("disable_balance"="false"); admin set frontend config ("disable_colocate_balance"="false");
-- 设置最大文件打开数 ansible newhost -m copy -a "src=/etc/security/limits.conf dest=/etc/security/limits.conf" ansible newhost -m copy -a "src=/etc/systemd/system.conf dest=/etc/systemd/system.conf" ansible newhost -m copy -a "src=/etc/security/limits.d/20-nproc.conf dest=/etc/security/limits.d/20-nproc.conf"
ansible newhost -m copy -a "src=/etc/sysctl.conf dest=/etc/sysctl.conf " ansible newhost -m copy -a "src=/etc/hosts dest=/etc/hosts" ansible newhost -m copy -a "src=/etc/profile dest=/etc/profile"
1 2
ansible newhost -m shell -a "mkdir /opt/module/ " ansible be -m copy -a "src=/opt/module/StarRocks-2.3.18.tar.gz dest=/opt/module/StarRocks-2.3.18.tar.gz"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
ansible newhost -m copy -a "src=/root/supervisor-4.2.5.tar.gz dest=/tmp/" ansible newhost -m shell -a "tar -zxvf /tmp/supervisor-4.2.5.tar.gz " ansible newhost -m shell -a "yum install python-setuptools -y " ansible newhost -m shell -a "cd supervisor-4.2.5 && python setup.py install" ansible newhost -m shell -a "mkdir /etc/supervisor " ansible newhost -m copy -a "src=/etc/supervisor/supervisord.conf dest=/etc/supervisor/" ansible newhost -m copy -a "src=/usr/lib/systemd/system/supervisord-4.2.5.service dest=/usr/lib/systemd/system/" ansible newhost -m shell -a "systemctl enable supervisord-4.2.5.service" ansible newhost -m shell -a "systemctl is-enabled supervisord-4.2.5.service" ansible newhost -m shell -a "mkdir /etc/supervisord.d/" scp cdh85-189:/etc/supervisord.d/starrocks_be.ini /tmp/ ansible be -m copy -a "src=/tmp/starrocks_be.ini dest=/etc/supervisord.d/" ansible newhost -m shell -a "systemctl start supervisord-4.2.5.service" ansible newhost -m shell -a "systemctl status supervisord-4.2.5.service" ansible newhost -m shell -a "supervisorctl status all"