一、官网及安装
安装指引
https://clickhouse.yandex/docs/en/getting_started/install/
1、先检查系统是否支持SSE 4.2
grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
2、yum安装准备
yum -y install yum-utils
sudo rpm --import https://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG
sudo yum-config-manager --add-repo https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
3、安装clickhouse
sudo yum install clickhouse-server clickhouse-client
二、配置:
1、修改 /etc/clickhouse-server/config.xml
#日志文件目录
<log>/data/applog/clickhouse-server/clickhouse-server.log</log>
<errorlog>/data/applog/clickhouse-server/clickhouse-server.err.log</errorlog>
#数据文件目录
<path>/data/appdata/clickhouse/</path>
<tmp_path>/data/appdata/clickhouse/tmp/</tmp_path>
<user_files_path>/data/appdata/clickhouse/user_files/</user_files_path>
#打开
<listen_host>0.0.0.0</listen_host>
2、修改日志目录、目录权限
chown -R clickhouse:clickhouse /data/appdata/clickhouse
chown -R clickhouse:clickhouse /data/applog/clickhouse-server/
3、启动
service clickhouse-server start