ClickHouse-安装篇
操作系统:Centos-7.7
ClickHouse: YUM 在线安装,20.x
官网:https://clickhouse.yandex/ 具体安装细节看:https://clickhouse.tech/#quick-start
安装前准备
CentOS7 打开文件数限制:
在 /etc/security/limits.conf 这个文件的末尾加入一下内容:
sudo vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
在 /etc/security/limits.d/90-nproc.conf 这个文件的末尾加入一下内容:
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
重启服务器之后生效,用 ulimit -n 或者 ulimit -a 查看设置结果
ulimit -n
ulimit -a
CentOS7 取消 SELINUX
修改 /etc/selinux/config 中的 SELINUX=disabled 后重启
vim /etc/selinux/config
SELINUX=disabled
关闭防火墙
centos6:
service iptables stop
service ip6tables stop
centos7:
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl start firewalld.service
安装依赖
yum install -y libtool
yum install -y *unixODBC*
单机模式安装
ClickHouse的安装可以使用 yum在线安装,也可以使用 rpm 离线安装的方式! 具体信息见官网文档:https://clickhouse.tech/#quick-start
准备操作
需要验证当前服务器的 CPU 是否支持 SSE 4.2 指令集,因为向量化执行需要用到这项特性:
grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"
安装
依次执行如下命令:
yum install yum-utils -y
rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG
yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/clickhouse.repo yum install clickhouse-server clickhouse-client -y
如果您没法链接互联网,则也可以使用 rpm 的方式来进行离线安装:需要下载的安装包有:
clickhouse-server-20.5.4.40-2.noarch.rpm
clickhouse-common-static-20.5.4.40-2.x86_64.rpm
clickhouse-client-20.5.4.40-2.noarch.rpm
下载地址在:
https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/ https://packagecloud.io/Altinity/clickhouse
启动服务端
前台启动:
clickhouse-server --config-file=/etc/clickhouse-server/config.xml