1、安装
CPU必须支持SSE 4.2指令集
grep -q sse4_2 /proc/cpuinfo && echo “SSE 4.2 supported” || echo “SSE 4.2 not supported”
主机名设置
hostnamectl set-hostname XXX
每台主机增加hosts解析
vi /etc/hosts
[IP] [hostname]
CentOS7 打开文件数限制
在 /etc/security/limits.conf 这个文件的末尾加入以下内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
在/etc/security/limits.d/20-nproc.conf这个文件的末尾加入以下内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
重启服务器之后生效,用ulimit -n 或者ulimit -a 查看设置结果
关闭防火墙和selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config &> /dev/null
安装依赖
yum install -y libtool unixODBC libicudata openssl
安装server和client
sudo yum install yum-utils -y
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 -y
安装完毕后,启动脚本clickhouse-server位于/etc/init.d目录下,而主要的配置文件config.xml、users.xml位于/etc/clickhouse-server目录下