1.确认防火墙处于关闭状态
systemctl stop firewalld
2.CentOS取消打开文件数限制
vim /etc/security/limits.conf
添加如下配置
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
vim /etc/security/limits.d/20-nproc.conf
添加如下配置
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
3.安装依赖
yum install -y libtool
yum install -y *unixODBC*
如下显示则安装完成
4.CentOS取消SELINUX
vim /etc/selinux/config
进行如下修改:
SELINUX=disabled
5.下载clickhouse安装包
clickhouse的rmp安装包下载网页:
Altinity/clickhouse - Packages · packagecloudAltinity/clickhouse - Packages · packagecloud Altinity/clickhouse - Packages · packagecloud。
下载四个rmp包:
clickhouse-client-20.5.4.40-1.el7.x86_64.rpm、
clickhouse-server-20.5.4.40-1.el7.x86_64.rpm、
clickhouse-common-static-120.5.4.40-1.el7.x86_64.rpm、
clickhouse-server-common-120.5.4.40-1.el7.x86_64.rpm
6.创建clickhouse目录
cd /opt/installs/
mkdir clickhouse
7.将clickhouse安装包拖拽进去,并进行安装4个rpm文件
rpm -ivh clickhouse-common-static-20.5.4.40-1.el7.x86_64.rpm
rpm -ivh clickhouse-server-common-20.5.4.40-1.el7.x86_64.rpm
rpm -ivh clickhouse-server-20.5.4.40-1.el7.x86_64.rpm
rpm -ivh clickhouse-client-20.5.4.40-1.el7.x86_64.rpm
安装完查看安装的情况
sudo rpm -qa|grep clickhouse
7.修改配置文件
vim /etc/clickhouse-server/config.xml
大概104行 把 <listen_host>::</listen_host> 的注释打开,这样才能让ClickHouse被除本机以外的服务器访问
8.启动服务
systemctl start clickhouse-server
#关闭开机自启
systemctl disable clickhouse-server
9.连接服务
#第一种连接
clickhouse-client -m
#第二种连接
clickhouse-client --host=你的IP --port=9000 --user=default --password=你的密码
-m
安装完成
10.基本操作
启动
#查看命令
clickhouse --help
#启动
clickhouse start
#重启
clickhouse restart
clickhouse相关目录
命令目录
/usr/bin
配置文件目录
cd /etc/clickhouse-server/
日志目录
cd /var/log/clickhouse-server/
数据文件目录
cd /var/lib/clickhouse/
标签:安装,server,4.40,64,ClickHouse,rpm,el7,clickhouse
From: https://blog.csdn.net/wadjdkdkdjjd/article/details/142486157