当前位置:网站首页>Linux system uninstall, install, upgrade, migrate clickHouse database

Linux system uninstall, install, upgrade, migrate clickHouse database

2022-08-02 09:55:00 night rain

1. View the clickhouse version

rpm -qa|grep clickhouse

2. View clickhouse service

service clickhouse-server status

3. Close the clickhouse service

sudo service clickhouse-server stop//or simply end the processps -ef|grep clickkill -9 process code

4. Uninstall clickhouse

yum remove -y clickhouse-common-staticyum remove -y clickhouse-server-commonrm -rf /var/lib/clickhouserm -rf /etc/clickhouse-*rm -rf /var/log/clickhouse-server

5. Install clickhouse

Download three clickHouse files

Select the same version for three files, and versions below 21 may not be supportedclickhouse window function, I chose version 21.3.4.25

//Install clickhouse components in orderrpm -ivh clickhouse-common-static-21.3.4.25-2.x86_64.rpmrpm -ivh clickhouse-server-21.3.4.25-2.noarch.rpmrpm -ivh clickhouse-client-21.3.4.25-2.noarch.rpm

Modify config and users configuration

Modify the configuration vim /etc/clickhouse-server/config.xml Change to the location where data is stored after this line/var/lib/clickhouse/Modify the configuration vim /etc/clickhouse-server/users.xml database username and passworddefaultdefaultdefault

6. Start the clickhouse service

sudo service clickhouse-server start

7. Migrate clickhouse data

First check where the clickhouse data existscat /etc/clickhouse-server/config.xmlView  The path after this lineThe path defaults to /var/lib/clickhouseCompress data, metadata, store folder data (data: database name, metadata: database table sql, store: data)tar -zcvf filenametar -xvf filename.gazUnzip and overwrite the three files in the /var/lib/clickhouse path of clickhouse in the new serverstart clickhouse servicesudo service clickhouse-server startNext, let's connect and test it

Uninstalling, installing, upgrading, and migrating the clickHouse database have all been explained here!

If the article is wrong or in doubt, please leave a message to discuss~

原网站

版权声明
本文为[night rain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208020939416570.html