单机模式
官网:https://clickhouse.yandex/
下载地址:http://repo.red-soft.biz/repos/clickhouse/stable/el6/
1.1 准备环境
目的:充分开放读取文件次数
-
vim /etc/security/limits.conf
* soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072
-
/etc/security/limits.d/20-nproc.conf
* soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072
-
由于ClickHouse由C++编写,需要安装所需的依赖
sudo yum install -y libtool sudo yum install -y *unixODBC*
-
取消SELinux:
/etc/selinux/config
SELINUX=disabled
1.2 单机模式安装
-
创建/opt/software/clickhouse
mkdir /opt/software/clickhouse
-
将rpm包放入上述目录
-
安装
sudo rpm -ivh *.rpm sudo rpm -qa|grep clickhouse查看安装情况
-
修改配置文件
/etc/clickhouse-server/config.xml
把 <listen_host>::</listen_host> 的注释打开,这样的话才能让ClickHouse被除本机以外的服务器访问
在这个文件中,有ClickHouse的一些默认路径配置,比较重要的
数据文件路径:
/var/lib/clickhouse/ 日志文件路径:/var/log/clickhouse-server/clickhouse-server.log
-
启动并关闭开机自启
sudo systemctl start clickhouse-server sudo systemctl disable clickhouse-server
-
使用client连接server
clickhouse-client -m