1.卸载clickhouse
关闭原来的clickhouse
sudo systemctl stop clickhouse-server
查看关闭clickhouse是否成功
sudo systemctl status clickhouse-server
备份配置文件
/etc/clickhouse-server/user.xml
/etc/clickhouse-server/config.d/metrika.xml
/etc/clickhouse-server/config.xml
卸载clickhouse和相关组件
sudo apt-get --purge remove clickhouse-server clickhouse-client clickhouse-common-static
删除对应文件夹
rm -rf /var/lib/clickhouse
rm -rf /etc/clickhouse-*
rm -rf /var/log/clickhouse-*
查看对应的文件是否删除完成(若没删除完成直接删除)
find -name clickhouse
2.下载需要的版本的clickhouse
使用命令可以看到可以下载的版本
apt list -a clickhouse-common-static
apt install -y clickhouse-common-static=22.8.9.24
apt install -y clickhouse-{server,client}=22.8.9.24
备份现在的配置文件,将之前备份的配置文件复制过来
/etc/clickhouse-server/user.xml
/etc/clickhouse-server/config.d/metrika.xml
/etc/clickhouse-server/config.xml
启动clickhouse
sudo service clickhouse-server start
可以登录clickhouse查看是否成功
clickhouse-client --password xx