clickhouse-20.6.6.7单节点安装教程(附带安装包)
1 硬件配置
服务器:1台
操作系统:Centos7.7
内存:64G及以上
硬盘:1T及以上
2 部署模式
clickhouse部署单机单节点模式
3 提前准备安装文件(文末提供)
clickhouse-client-20.6.6.7-1.el7.x86_64.rpm
clickhouse-common-static-20.6.6.7-1.el7.x86_64.rpm
clickhouse-server-20.6.6.7-1.el7.x86_64.rpm
clickhouse-server-common-20.6.6.7-1.el7.x86_64.rpm
官网下载地址:
https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/
4 检查环境
[root@node174 clickhouse]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
[root@node174 clickhouse]# grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
SSE 4.2 supported
5 安装部署
[root@node174 clickhouse]# rpm -ivh *.rpm
准备中... ################################# [100%]
正在升级/安装...
1:clickhouse-server-common-20.6.6.7################################# [ 25%]
2:clickhouse-common-static-20.6.6.7################################# [ 50%]
3:clickhouse-server-20.6.6.7-1.el7 ################################# [ 75%]
Create user clickhouse.clickhouse with datadir /var/lib/clickhouse
4:clickhouse-client-20.6.6.7-1.el7 ################################# [100%]
Create user clickhouse.clickhouse with datadir /var/lib/clickhouse
[root@node174 clickhouse]# systemctl start clickhouse-server.service
[root@node174 clickhouse]# systemctl status clickhouse-server.service
● clickhouse-server.service - LSB: Yandex clickhouse-server daemon
Loaded: loaded (/etc/rc.d/init.d/clickhouse-server; bad; vendor preset: disabled)
Active: active (exited) since 三 2020-12-09 09:16:03 CST; 13s ago
Docs: man:systemd-sysv-generator(8)
Process: 15087 ExecStart=/etc/rc.d/init.d/clickhouse-server start (code=exited, status=0/SUCCESS)
12月 09 09:16:01 node174.data systemd[1]: Starting LSB: Yandex clickhouse-server daemon...
12月 09 09:16:01 node174.data su[15097]: (to clickhouse) root on none
12月 09 09:16:01 node174.data clickhouse-server[15087]: Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/
12月 09 09:16:01 node174.data su[15107]: (to clickhouse) root on none
12月 09 09:16:02 node174.data su[15111]: (to clickhouse) root on none
12月 09 09:16:02 node174.data su[15115]: (to clickhouse) root on none
12月 09 09:16:02 node174.data su[15121]: (to clickhouse) root on none
12月 09 09:16:03 node174.data clickhouse-server[15087]: DONE
12月 09 09:16:03 node174.data systemd[1]: Started LSB: Yandex clickhouse-server daemon.
6 服务启动和停止
启动:service clickhouse-server start
停止:service clickhouse-server stop
注:clickhouse-server为服务名,即,启动脚本/etc/init.d/clickhouse-server
systemctl start clickhouse-server.service
systemctl status clickhouse-server.service
7 登录客户端
[root@node174 clickhouse]# clickhouse-client
ClickHouse client version 20.6.6.7.
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.6.6 revision 54436.
node174.data :show databases;
SHOW DATABASES
┌─name───────────────────────────┐
│ _temporary_and_external_tables │
│ default │
│ system │
└────────────────────────────────┘
3 rows in set. Elapsed: 0.005 sec.
node174.data : quit;
8 安装包地址
https://download.csdn.net/download/qq_42422698/13608424