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