下载地址

https://repo.clickhouse.com/tgz/stable/
版本:21.9.4.35
image.png

安装

  1. df -h
  2. tar -zxvf clickhouse-common-static-21.9.4.35.tgz
  3. ./clickhouse-common-static-21.9.4.35/install/doinst.sh
  4. tar -zxvf clickhouse-common-static-dbg-21.9.4.35.tgz
  5. ./clickhouse-common-static-dbg-21.9.4.35/install/doinst.sh
  6. tar -zxvf clickhouse-server-21.9.4.35.tgz
  7. ./clickhouse-server-21.9.4.35/install/doinst.sh
  8. tar -zxvf clickhouse-client-21.9.4.35.tgz
  9. ./clickhouse-client-21.9.4.35/install/doinst.sh

Enter password for default user:
Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.
Setting capabilities for clickhouse binary. This is optional.
Allow server to accept connections from the network (default is localhost only), [y/N]: y
The choice is saved in file /etc/clickhouse-server/config.d/listen.xml.

ClickHouse has been successfully installed.

Start clickhouse-server with:
sudo clickhouse start

Start clickhouse-client with:
clickhouse-client —password

Created symlink from /etc/systemd/system/multi-user.target.wants/clickhouse-server.service to /etc/systemd/system/clickhouse-server.service
show databases;

远程连接

cd /etc/clickhouse-server/
vi config.xml
打开第一个listen注释 lsof -i:8123
注意:配置文件权限组
chown -R clickhouse:clickhouse config.xml
image.png
clickhouse restart && tail -f /var/log/clickhouse-server/clickhouse-server.log
systemctl restart clickhouse-server && journalctl -xefu clickhouse-server