ClickHouse升级与回滚方案

  |   0 评论   |   1,229 浏览

升级

yum方式(下载比较慢)

Update Cache

[root@cxy7.com ~]# yum -q makecache -y --disablerepo='*' --enablerepo='Altinity_clickhouse'

备份

[root@cxy7.com ~]# tar -cvzf /opt/clickhouse-server-config.20190611.tgz /etc/clickhouse-server
[root@cxy7.com ~]# tar -cvzf /opt/clickhouse-server-metadata.20190611.tgz /data/clickhouse/metadata

升级

[root@cxy7.com ~]# /etc/init.d/clickhouse-server forcestop
[root@cxy7.com ~]# yum upgrade clickhouse-server clickhouse-client -y

本地rpm包方式

下载最新的rpm包

https://packagecloud.io/altinity/clickhouse

将rpm包分发至各节点

clickhouse-client-19.13.1.11-1.el7.x86_64.rpm
clickhouse-common-static-19.13.1.11-1.el7.x86_64.rpm
clickhouse-server-19.13.1.11-1.el7.x86_64.rpm
clickhouse-server-common-19.13.1.11-1.el7.x86_64.rpm

开始升级

[root@cxy7.com ~]# /etc/init.d/clickhouse-server forcestop
[root@cxy7.com ~]# yum upgrade *.rpm -y

回滚

[root@cxy7.com ~]# /etc/init.d/clickhouse-server stop
[root@cxy7.com ~]# yum downgrade clickhouse-server-common-18.14.15-1.el7.x86_64 clickhouse-server-18.14.15-1.el7.x86_64 clickhouse-common-static-18.14.15-1.el7.x86_64 clickhouse-client-18.14.15-1.el7.x86_64 -y


读后有收获可以支付宝请作者喝咖啡