Upgrading and downgrading on ClickHouse is a quite simple operation. In this article, we will explain how to do these operations with examples.
For the upgrade process, you can start the upgrade process by typing the version you want specifically.
ClickHouse does not support a distributed update. The operation should be performed consecutively on each separate server. Do not update all the servers on a cluster simultaneously, or the cluster will be unavailable for some time.
To reach official ClickHouse releases, please visit here.
♣ NOTE: You can update multiple servers at once as soon as there is no moment when all replicas of one shard are offline. |
To upgrade, you have to run the commands which is given below;
sudo apt-get update sudo apt-get install clickhouse-server=xx.yy.a.b clickhouse-client=xx.yy.a.b clickhouse-common-static=xx.yy.a.b sudo service clickhouse-server restart
Lets give an example;
We have ClickHouse 22.3.7.28 version on our system. We are going to upgrade ClickHouse version 22.6.1.1985.
Process;
1- First upgrade your OS.
2- Install specific version of ClickHouse.
3- Restart ClickHouse server.
4- Check ClickHouse version.
Check current version;
clickhouse-client --version ClickHouse client version 22.3.7.28 (official build).
Now, run the commands given below;
sudo apt-get update sudo apt-get install clickhouse-server=22.6.1.1985 clickhouse-client=22.6.1.1985 clickhouse-common-static=22.6.1.1985 sudo service clickhouse-server restart
Verify new version of ClickHouse
clickhouse-client --version ClickHouse client version 22.6.1.1985 (official build).
When you examine the logs under the /var/log/clickhouse-server/clickhouse-server.log directory, you will see that the new version of clickhouse is running after the restart.
<Trace> Pipe: Pipe capacity is 1.00 MiB <Information> : Starting ClickHouse 22.6.1.1985 with revision 54463, build id: A1A632F69545B4EC, PID 88660 <Information> Application: starting up <Information> Application: OS name: Linux, version: 5.13.0-1031-gcp, architecture: x86_64
You can follow same steps for downgrade operation.