1. 检查系统是否支持
grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
2. yum 安装
sudo yum install yum-utils
sudo rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/stable/x86_64
sudo yum install clickhouse-server clickhouse-client
3. 启动
sudo service clickhouse-server start
配置文件位置:
/etc/clickhouse-server/config.xml
日志位置
/var/log/clickhouse-server/
客户端连接
clickhouse-client
clickhouse-client --host=example.com //远程连接
测试
select 1
4. 遇到的问题
__启动问题:__通过命令sudo service clickhouse-server start
启动一直提示Init script is already running
解决方法:
sudo systemctl start clickhouse-server
sudo systemctl stop clickhouse-server
sudo systemctl status clickhouse-server
client访问问题:
使用clickhouse-client
登录时,提示 Code: 210. DB::NetException: Connection refused (localhost:9000, ::1)
解决方法:
/etc/clickhouse-server/config.xml
<listen_host>::1</listen_host>
<listen_host>0.0.0.0</listen_host>