• 环境说明:

    • 目前已验证: openeuler22.03 LTS SP3,openeuler22.03 LTS SP4
    • clickhouse 版本: 24.9.2

一、Clickhouse 在线安装

1.1 添加clickhouse repo源

 $ yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo

1.2 在线安装

 $ yum install -y clickhouse-server clickhouse-client

二、Clickhouse 配置

2.1配置客户端连接密码

$ vim /etc/clickhouse-server/users.xml
<password>srebro@2024</password>

2.2 配置监听地址

$  vim /etc/clickhouse-server/config.xml
#搜索0.0.0.0 ,然后粘贴下面的内容
<listen_host>::</listen_host>

2.3 创建软连接配置数据路径

clickhouse安装后,默认的数据目录在/var/lib/clickhouse,我们的磁盘默认挂载在/home/application 路径下;将其软连接到 /home/application/clickhouse 下

$ mkdir -p /home/application/clickhouse

$ rm -rf /var/lib/clickhouse/

$ ln -s  /home/application/clickhouse /var/lib/

2.4 创建软连接配置日志路径

clickhouse安装后,默认的数据目录在/var/log/clickhouse-server,我们的磁盘默认挂载在/home/application 路径下;将其软连接到 /home/application/clickhouse-server/ 下

$ mkdir -p /home/application/clickhouse-server/

$ rm -rf /var/log/clickhouse-server

$ ln -s /home/application/clickhouse-server/  /var/log/

2.5 赋予clickhouse 目录权限

$ chown -Rf clickhouse:clickhouse  /home/application/clickhouse

$ chown -Rf clickhouse:clickhouse /home/application/clickhouse-server

三、启动clickhouse-server数据库

 systemctl start clickhouse-server
 systemct enable clickhouse-server

四、客户端clickhouse-client 登陆测试

$ clickhouse-client --password
ClickHouse client version 20.4.6.53 (official build).
Password for user (default):
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 20.4.6 revision 54434.
0001 :) exit
Bye.