1 ClickHouse 安装部署(tgz)

1 下载离线安装包

    到官网 https://packages.clickhouse.com/tgz/stable/ 查看最新的安装包版本 ,

https://packages.clickhouse.com/tgz/stable/clickhouse-common-static-$LATEST_VERSION.tgz
https://packages.clickhouse.com/tgz/stable/clickhouse-common-static-dbg-$LATEST_VERSION.tgz
https://packages.clickhouse.com/tgz/stable/clickhouse-server-$LATEST_VERSION.tgz
https://packages.clickhouse.com/tgz/stable/clickhouse-client-$LATEST_VERSION.tgz

用实际版本号替换$LATEST_VERSION 并下载,然后上传至服务器

2、安装

[root@localhost ClickHousePackage]# ./clickhouse-common-static-22.3.2.2/install/doinst.sh 
[root@localhost ClickHousePackage]# ./clickhouse-common-static-db22.3.2.2/install/doinst.sh 
[root@localhost ClickHousePackage]# ./clickhouse-server-22.3.2.2/install/doinst.sh 
 此步骤需要输入默认密码 
[root@localhost ClickHousePackage]# ./clickhouse-client-22.3.2.2/install/doinst.sh 

3、修改 数据目录和日志目录

默认的数据和日志目录位于

 数据目录:/var/lib/clickhouse/
 日志目录 :/var/log/clickhouse-server/

因为数据和日志目录需要占用较大的存储空间,如果var下并不能满足,则需要将日志和数据移动到其它目录

停止服务
[root@localhost ~]# clickhouse stop

创建数据目录
[root@localhost storage]# mkdir /home/storage/clickhouse
创建日志目录
[root@localhost storage]# mkdir /home/storage/clickhouse/log

修改目录所有者
[root@localhost clickhouse]# chown -R clickhouse:clickhouse /home/storage/clickhouse


移动默认的数据和日志目录到指定路径
[root@localhost ClickHousePackage]# mv /var/lib/clickhouse/ /home/storage/clickhouse/
[root@localhost ClickHousePackage]# mv /var/log/clickhouse-server/ /home/storage/clickhouse/log/

在默认的数据和日志目录 创建软连接到 实际目录
注意 目录软链接 会用源目录的名字 在软链接文件所在目录建立相同名称的软链接文件
[root@localhost ClickHousePackage]# ln -s /home/storage/clickhouse /var/lib
[root@localhost ClickHousePackage]# ln -s /home/storage/clickhouse/log/clickhouse-server /var/log

4 重启服务

[root@localhost ~]# clickhouse restart

你可能感兴趣的:(ClickHouse,clickhouse,OLAP)