1、檢查環境
1.1、linux版本
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
1.2、SSE 4.2
[root@localhost ~]# grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
SSE 4.2 supported
2、安裝rpm包
2.1、下載
~~ https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/ ~~
wget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-client-20.3.9.70-2.noarch.rpm
wget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-server-20.3.9.70-2.noarch.rpm
wget https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/clickhouse-common-static-dbg-20.3.9.70-2.x86_64.rpm
2.2、安裝
[root@localhost clickhouse]# rpm -ivh clickhouse-common-static-20.3.9.70-2.x86_64.rpm
[root@localhost clickhouse]# rpm -ivh clickhouse-server-20.3.9.70-2.noarch.rpm
Created symlink from /etc/systemd/system/multi-user.target.wants/clickhouse-server.service to /etc/systemd/system/clickhouse-server.service.
Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/
[root@localhost clickhouse]# rpm -ivh clickhouse-client-20.3.9.70-2.noarch.rpm
3、啟動&連接
3.1、啟動服務
[root@localhost clickhouse]# systemctl start clickhouse-server.service
[root@localhost clickhouse]# systemctl status clickhouse-server.service
3.2、命令行連接
[root@localhost clickhouse]# clickhouse-client
ClickHouse client version 20.3.9.70 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.3.9 revision 54433.
localhost :) show databases;
SHOW DATABASES
┌─name────┐
│ default │
│ system │
└─────────┘
2 rows in set. Elapsed: 0.004 sec.
3.3、Dbeaver連接
默認監聽的是localhost,需要修改為外網可訪問的ip
# 修改配置文件
vim /etc/clickhouse-server/config.xml
<listen_host>0.0.0.0</listen_host>
# 重啟服務
systemctl restart clickhouse-server.service
默認沒有密碼