1 准备工作

1.1 CentOS取消打开文件数限制

在/etc/security/limits.conf 这个文件的末尾加入一下内容:

  1. [root@hadoop102 ~]$ vim /etc/security/limits.conf
  2. 在文件末尾添加:
  3. * soft nofile 65536
  4. * hard nofile 65536
  5. * soft nproc 131072
  6. * hard nproc 131072

1.2 CentOS取消SELINUX

修改/etc/selinux/config中的SELINUX=disabled后重启

  1. [root@hadoop102 ~]# vim /etc/selinux/config
  2. SELINUX=disabled

3.1.3 关闭防火墙
3.1.4 安装依赖

  1. [root@hadoop102 ~]# yum install -y libtool
  2. [root@hadoop102 ~]# yum install -y *unixODBC*

image.png
image.png

2 单机安装

官网:https://clickhouse.yandex/
下载地址:http://repo.red-soft.biz/repos/clickhouse/stable/el6/

2.1 上传4个文件

  1. [root@hadoop102 software]# ls
  2. clickhouse/clickhouse-client-21.4.6.55-2.noarch.rpm
  3. clickhouse/clickhouse-common-static-21.4.6.55-2.x86_64.rpm
  4. clickhouse/clickhouse-common-static-dbg-21.4.6.55-2.x86_64.rpm
  5. clickhouse/clickhouse-server-21.4.6.55-2.noarch.rpm

2.2分别在三台机子上安装这4个rpm文件

[root@hadoop102 software]#  rpm -ivh *.rpm

image.png

2.3 修改配置文件:

[bigdata@hdp1 soft]#sudo chmod 751 /etc/clickhouse-server/config.xml
[bigdata@hdp1 soft]# sudo vim /etc/clickhouse-server/config.xml

image.png
0.0.0.0 的注解打开,这样的话才能让clickhouse被除本机以外的服务器访问

2.4 启动ClickHouse-Server

[bigdata@hdp1 soft]#sudo systemctl start clickhouse-server

2.5 使用client连接server

[bigdata@hdp1 soft]# clickhouse-client -m

如果出现错误可以参考如下:
https://blog.csdn.net/u011652364/article/details/114268454

2.6关闭开机自启

sudo systemctl disable clickhouse-server

image.png