Clickhouse升级

1、当前版本20.3.9.70

[root@node1 ~]# clickhouse-client --password
ClickHouse client version 20.3.9.70 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.3.9 revision 54433.

elastic1 :) 

2、升级版本

需要升级到21.7.5.29-2,将下载好的rpm包上传到upgrade目录(创建一个upgrade目录)


[root@node1 upgrade]# ll
total 170396
-rw-r--r-- 1 root root     78074 Aug  2 13:27 clickhouse-client-21.7.5.29-2.noarch.rpm
-rw-r--r-- 1 root root 174293080 Aug  2 13:27 clickhouse-common-static-21.7.5.29-2.x86_64.rpm
-rw-r--r-- 1 root root    101969 Aug  2 13:27 clickhouse-server-21.7.5.29-2.noarch.rpm
[root@node1 upgrade]# 

3、升级过程

(1)停止服务

[root@node1 ~]# systemctl stop clickhouse-server
[root@node1 ~]# systemctl status clickhouse-server
● clickhouse-server.service - ClickHouse Server (analytic DBMS for big data)
   Loaded: loaded (/etc/systemd/system/clickhouse-server.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Mon 2021-08-02 13:31:50 CST; 47s ago
  Process: 2278 ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid (code=exited, status=0/SUCCESS)
 Main PID: 2278 (code=exited, status=0/SUCCESS)

Aug 02 13:31:46 node1 systemd[1]: Stopping ClickHouse Server (analytic DBMS for big data)...
Aug 02 13:31:50 node1 systemd[1]: Stopped ClickHouse Server (analytic DBMS for big data).
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[root@node1 ~]# 

(2)升级软件包

[root@node1 upgrade]# yum upgrade *.rpm -y
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Examining clickhouse-client-21.7.5.29-2.noarch.rpm: clickhouse-client-21.7.5.29-2.noarch
Marking clickhouse-client-21.7.5.29-2.noarch.rpm as an update to clickhouse-client-20.3.9.70-2.noarch
Examining clickhouse-common-static-21.7.5.29-2.x86_64.rpm: clickhouse-common-static-21.7.5.29-2.x86_64
Marking clickhouse-common-static-21.7.5.29-2.x86_64.rpm as an update to clickhouse-common-static-20.3.9.70-2.x86_64
Examining clickhouse-server-21.7.5.29-2.noarch.rpm: clickhouse-server-21.7.5.29-2.noarch
Marking clickhouse-server-21.7.5.29-2.noarch.rpm as an update to clickhouse-server-20.3.9.70-2.noarch
Resolving Dependencies
--> Running transaction check
---> Package clickhouse-client.noarch 0:20.3.9.70-2 will be updated
---> Package clickhouse-client.noarch 0:21.7.5.29-2 will be an update
---> Package clickhouse-common-static.x86_64 0:20.3.9.70-2 will be updated
---> Package clickhouse-common-static.x86_64 0:21.7.5.29-2 will be an update
---> Package clickhouse-server.noarch 0:20.3.9.70-2 will be updated
---> Package clickhouse-server.noarch 0:21.7.5.29-2 will be an update
--> Finished Dependency Resolution
rhel7.3  
....

ClickHouse has been successfully installed.

Start clickhouse-server with:
 sudo clickhouse start

Start clickhouse-client with:
 clickhouse-client --password

  Updating   : clickhouse-client-21.7.5.29-2.noarch                                                                                                                                          3/6
  Cleanup    : clickhouse-client-20.3.9.70-2.noarch                                                                                                                                          4/6
  Cleanup    : clickhouse-server-20.3.9.70-2.noarch                                                                                                                                          5/6
  Cleanup    : clickhouse-common-static-20.3.9.70-2.x86_64                                                                                                                                   6/6
rhel7.3/productid                                                                                                                                                         | 1.6 kB  00:00:00
  Verifying  : clickhouse-common-static-21.7.5.29-2.x86_64                                                                                                                                   1/6
  Verifying  : clickhouse-server-21.7.5.29-2.noarch                                                                                                                                          2/6
  Verifying  : clickhouse-client-21.7.5.29-2.noarch                                                                                                                                          3/6
  Verifying  : clickhouse-client-20.3.9.70-2.noarch                                                                                                                                          4/6
  Verifying  : clickhouse-server-20.3.9.70-2.noarch                                                                                                                                          5/6
  Verifying  : clickhouse-common-static-20.3.9.70-2.x86_64                                                                                                                                   6/6

Updated:
  clickhouse-client.noarch 0:21.7.5.29-2                       clickhouse-common-static.x86_64 0:21.7.5.29-2                       clickhouse-server.noarch 0:21.7.5.29-2

Complete!
[root@node1 upgrade]# s

(3)启动服务

[root@node1 upgrade]# systemctl start clickhouse-server
[root@node1 upgrade]# systemctl status clickhouse-server
● clickhouse-server.service - ClickHouse Server (analytic DBMS for big data)
   Loaded: loaded (/etc/systemd/system/clickhouse-server.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2021-08-02 13:38:28 CST; 9s ago
 Main PID: 11529 (clckhouse-watch)
   CGroup: /system.slice/clickhouse-server.service
           ├─11529 clickhouse-watchdog --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid
           └─11534 /usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid

Aug 02 13:38:28 node1 clickhouse-server[11529]: Include not found: clickhouse_compression
Aug 02 13:38:28 node1 clickhouse-server[11529]: Logging trace to /var/log/clickhouse-server/clickhouse-server.log
Aug 02 13:38:28 node1 clickhouse-server[11529]: Logging errors to /var/log/clickhouse-server/clickhouse-server.err.log
Aug 02 13:38:28 node1 clickhouse-server[11529]: Processing configuration file '/etc/clickhouse-server/config.xml'.
Aug 02 13:38:28 node1 clickhouse-server[11529]: Include not found: clickhouse_remote_servers
Aug 02 13:38:28 node1 clickhouse-server[11529]: Include not found: clickhouse_compression
Aug 02 13:38:28 node1 clickhouse-server[11529]: Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/config.xml'.
Aug 02 13:38:28 node1 clickhouse-server[11529]: Processing configuration file '/etc/clickhouse-server/users.xml'.
Aug 02 13:38:28 node1 clickhouse-server[11529]: Include not found: networks
Aug 02 13:38:28 node1 clickhouse-server[11529]: Saved preprocessed configuration to '/var/lib/clickhouse/preprocessed_configs/users.xml'.
[root@node1 upgrade]# clickhouse-client --password
ClickHouse client version 21.7.5.29 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.7.5 revision 54449.

node1 :) use tutorial

USE tutorial

Query id: aab6908c-f849-42a3-82ac-ab10a04fa6fb

Ok.

0 rows in set. Elapsed: 0.002 sec.

node1 :) show tables;

SHOW TABLES

Query id: 7624fc43-5f13-41e2-9002-ba11b5d879d5

┌─name──────┐
│ hits_v1   │
│ visits_v1 │
└───────────┘

2 rows in set. Elapsed: 0.004 sec.

node1 :) select count(1) from hits_v1;

SELECT count(1)
FROM hits_v1

Query id: 1f9f7b95-745c-4ff5-9217-11dc7d988eab

┌─count()─┐
│ 8873898 │
└─────────┘

1 rows in set. Elapsed: 0.004 sec.

node1 :) 
上一篇:linux 内核参数优化


下一篇:Linux下Docker容器访问宿主机网络