Post-7.1.1 Upgrade ClickHouse IP Index Rebuilding
If you are upgrading ClickHouse based deployment from pre-7.1.1, then after upgrade has completed, you need to run the following command to rebuild ClickHouse indices. If you are running a version later than 7.1.1, and have already executed the rebuilding steps, then nothing more needs to be done.
/opt/phoenix/phscripts/clickhouse/rebuild_ip_bloom_filter.sh -h
Usage: ./script [-h for help] [-p for 10 oldest partitions] [-m manual commands] [-r <index id> index to be rebuilt]
Here are indexes available for rebuild. Please choose one and specify the id in -r option.
-r <index id> option is mandatory.
- reptDevIpAddr
- srcIpAddr
- destIpAddr
- hostIpAddr
For example, to rebuild reptDevIpAddr index, issue the following command.
$ ./rebuild_ip_bloom_filter.sh -r 1
|
|
Notes before running the script:
|
Detailed Steps are as follows:
- Go to root shell by running the following command:
sudo -s - Run the following command:
/opt/phoenix/phscripts/clickhouse/rebuild_ip_bloom_filter.sh -r 1
The script will produce output similar to the following:[root@server]# /opt/phoenix/phscripts/clickhouse/rebuild_ip_bloom_filter.sh -r 1 current attr is reptDevIpAddr Materialize in progress "false" for reptDevIpAddr with 0 parts to process Materialize in progress "false" for srcIpAddr with 0 parts to process Materialize in progress "false" for destIpAddr with 0 parts to process Materialize in progress "false" for hostIpAddr with 0 parts to process drop in progress "false" for reptDevIpAddr drop in progress "false" for srcIpAddr drop in progress "false" for destIpAddr drop in progress "false" for hostIpAddr Processing index index_reptDevIpAddr_bloom_filter Trying to rebuild index_reptDevIpAddr_bloom_filter drop in progress "false" There is enough storage on host 172.30.56.206. done checking storage for index index_reptDevIpAddr_bloom_filter dropping index index_reptDevIpAddr_bloom_filter dropping index command issued Start monitoring index index_reptDevIpAddr_bloom_filter for drop operation drop index_reptDevIpAddr_bloom_filter done. Total time taken: 0 seconds Total time to drop index_reptDevIpAddr_bloom_filter is 1 seconds adding index_reptDevIpAddr_bloom_filter Start monitoring index index_reptDevIpAddr_bloom_filter for materialize operation parts left to materialize reptDevIpAddr index : 6 - time taken 0 seconds materialize index_reptDevIpAddr_bloom_filter done. Total time taken: 10 seconds Rebuilding index for reptDevIpAddr done. Total time taken for rebuild 13 seconds
- Run the following command:
/opt/phoenix/phscripts/clickhouse/rebuild_ip_bloom_filter.sh -r 2 - Run the following command:
/opt/phoenix/phscripts/clickhouse/rebuild_ip_bloom_filter.sh -r 3 - Run the following command:
/opt/phoenix/phscripts/clickhouse/rebuild_ip_bloom_filter.sh -r 4