Clickhouse单机版的安装

公司项目上需求使用Clickhouse,记录下单机版的安装步骤,选择的是rpm包方式安装
本例是在CentOS7上安装部署到/app目录下

1、下载所需安装包

下载地址中下载所需版本的安装包,一般是5个安装包。

2、以如下顺序,rpm方式安装

rpm -ivh clickhouse-common-static-20.3.11.97-1.el7.x86_64.rpm
rpm -ivh clickhouse-server-common-20.3.11.97-1.el7.x86_64.rpm
rpm -ivh clickhouse-server-20.3.11.97-1.el7.x86_64.rpm
rpm -ivh clickhouse-client-20.3.11.97-1.el7.x86_64.rpm

3、创建目录

mkdir -p /app/clickhouse/log
mkdir -p /app/clickhouse/data
mkdir -p /app/clickhouse/data_old
mkdir -p /app/clickhouse/tmp/
mkdir -p /app/clickhouse/format_schemas/
mkdir -p /app/clickhouse/user_files/

4、修改启动脚本vim /etc/init.d/clickhouse-server 修改以下参数:

CLICKHOUSE_LOGDIR=/app/clickhouse/log
CLICKHOUSE_LOGDIR_USER=root
CLICKHOUSE_DATADIR_OLD=/app/clickhouse/data_old
CLICKHOUSE_DATADIR=/app/clickhouse/data

5、修改config.xml中的目录地址,vim /etc/clickhouse-server/config.xml:

<path>/app/clickhouse/data/</path>
<tmp_path>/app/clickhouse/tmp/</tmp_path>
<user_files_path>/app/clickhouse/user_files/</user_files_path>
<format_schema_path>/app/clickhouse/format_schemas/</format_schema_path>

6、启动和验证ClickHouse服务

service clickhouse-server start
clickhouse-client -m

7、添加开机自启动

chkconfig clickhouse-server on

posted @ 2020-10-23 11:31  灬夜露沁心灬  阅读(1617)  评论(0编辑  收藏  举报