下载地址
https://repo.clickhouse.com/tgz/stable/
版本:21.9.4.35
安装
df -h
tar -zxvf clickhouse-common-static-21.9.4.35.tgz
./clickhouse-common-static-21.9.4.35/install/doinst.sh
tar -zxvf clickhouse-common-static-dbg-21.9.4.35.tgz
./clickhouse-common-static-dbg-21.9.4.35/install/doinst.sh
tar -zxvf clickhouse-server-21.9.4.35.tgz
./clickhouse-server-21.9.4.35/install/doinst.sh
tar -zxvf clickhouse-client-21.9.4.35.tgz
./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
clickhouse restart && tail -f /var/log/clickhouse-server/clickhouse-server.log
systemctl restart clickhouse-server && journalctl -xefu clickhouse-server