【ClickHouse入门】二、ClickHouse安装
2.1 准备工作
2.1.1 确定防火墙属于关闭状态
[root@T1 ~]# getenforce Disabled
2.1.2 CentOS取消打开文件数限制
(1)在T1、T2、T3的/etc/security/limits.conf文件的末尾加入以下内容
* soft nofile 65535 * hard nofile 65535 * soft nproc 131072 * hard nproc 131072
(2)在T1、T2、T3的/etc/security/limits.d/20-nproc.conf文件的末尾加入以下的内容
* soft nofile 65535 * hard nofile 65535 * soft nproc 131072 * hard nproc 131072
2.1.3 安装依赖
yum install -y libtool *unixODBC*
2.2 单机安装
下载地址:http://repo.red-soft.biz/repos/clickhouse/stable/el7/
2.2.1 在T1、T2、T3下的/opt/software下创建clickhouse目录
mkdir -p /opt/software/clickhouse
2.2.2 将下载的文件上传到目录下
2.2.3 三台服务器上安装rpm包
[root@T1 clickhouse]# rpm -ivh *.rpm
2.2.4 修改配置文件
[root@T1 clickhouse-server]# vim /etc/clickhouse-server/config.xml
(1)把 <listen_host>::</listen_host> 的注释打开,这样的话才能让 ClickHouse 被除本机以外的服务器访问
<!-- Listen specified address. Use :: (wildcard IPv6 address), if you want to accept connections both with IPv4 and IPv6 from everywhere. --> <listen_host>::</listen_host> <!-- Same for hosts without support for IPv6: --> <!-- <listen_host>0.0.0.0</listen_host> -->
(2)修改T2、T3的配置文件
[root@T1 clickhouse-server]# scp /etc/clickhouse-server/config.xml root@T2:/etc/clickhouse-server/config.xml [root@T1 clickhouse-server]# scp /etc/clickhouse-server/config.xml root@T3:/etc/clickhouse-server/config.xml
2.2.5 三台服务器启动Server
[root@T1 clickhouse-server]# clickhouse start
2.2.6 使用Client连接Server
[root@T1 clickhouse-server]# clickhouse-client -m --password ****** ClickHouse client version 21.7.3.14 (official build). Connecting to localhost:9000 as user default. Connected to ClickHouse server version 21.7.3 revision 54449. T1 :) show databases; SHOW DATABASES Query id: 5b40eea7-c124-4c2a-876e-0ba6124a46fa ┌─name────┐ │ default │ │ system │ └─────────┘ 2 rows in set. Elapsed: 0.003 sec.
-m :可以在命令窗口输入多行命令

浙公网安备 33010602011771号