Clickhouse安装–单节点安装
官网地址:https://clickhouse.com/docs/en/install
安装包:https://packages.clickhouse.com/rpm/stable/
安装版本为:21.7.3.14-2
所需安装包:
clickhouse-client-21.7.3.14-2.noarch.rpm
clickhouse-common-static-21.7.3.14-2.x86_64.rpm
clickhouse-common-static-dbg-21.7.3.14-2.x86_64.rpm
clickhouse-server-21.7.3.14-2.noarch.rpm
一、准备工作
1、确定防火墙处于关闭状态
systemctl stop firewalld
注意:开机自启也要关闭
查看是否开机自启
systemctl is-enabled firewalld
关闭开机自启
systemctl disable firewalld
2、CentOS取消打开文件数限制
(1)在hadoop102的/etc/security/limits.conf文件的末尾加入以下内容
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
(2)在 hadoop102 的/etc/security/limits.d/20-nproc.conf 文件的末尾加入以下内容
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
(1)修改/etc/selinux/config 中的 SELINUX=disabled
sudo vim /etc/selinux/config
SELINUX=disabled
注意:别改错了
二、单机安装
1、在 hadoop102 的/opt/software 下创建 clickhouse 目录
mkdir clickhouse
2、上传4个文件到 hadoop102 的software/clickhouse 目录下
3、安装这 4 个 rpm 文件
rpm -ivh *.rpm
4、修改配置文件
vim /etc/clickhouse-server/config.xml
(1)把 <listen_host>::</listen_host> 的注释打开,这样的话才能让 ClickHouse 被除本
机以外的服务器访问
5、启动 Server
systemctl start clickhouse-server
推荐使用:
clickhouse status
clickhouse start
clickhouse restart
clickhouse stop
6、设置开机自启
systemctl enable clickhouse-server
7、使用 client 连接 server
clickhouse-client -m
-m :可以在命令窗口输入多行命令