ClickHouse安装部署

通过RPM安装包

ip:192.168.4.186

安装前准备

验证当前服务器CPU是否支持SSE 4.2指令集

grep -q sse4_2 /proc/cpuinfo && echo "SSE 4.2 supported" || echo "SSE 4.2 not supported"

获取安装包

由于网路不通,只能手动下载传输到测试机。

下载地址:https://repo.yandex.ru/clickhouse/rpm/stable/x86_64/

下载了四个组件:clickhouse-client-21.9.7.2-2.noarch.rpm,clickhouse-common-static-21.9.7.2-2.x86_64.rpm,clickhouse-server-21.9.7.2-2.noarch.rpm,clickhouse-common-static-dbg-21.9.7.2-2.x86_64.rpm

clickhouse-common-static — ClickHouse编译的二进制文件。
clickhouse-server — 创建clickhouse-server软连接,并安装默认配置服务
clickhouse-client — 创建clickhouse-client客户端工具软连接,并安装客户端配置文件。
clickhouse-common-static-dbg — 带有调试信息的ClickHouse二进制文件。

本次测试只安装clickhouse-client-21.9.7.2-2.noarch.rpm,clickhouse-common-static-21.9.7.2-2.x86_64.rpm,clickhouse-server-21.9.7.2-2.noarch.rpm即可。

安装&启动

安装(此步骤会需要设置登录密码)

[root@hadoop4 clickhouse]# ll
total 279744
-rw-r--r-- 1 root root  98243044 Jan 12 15:34 ClickHouse-21.11.9.1-stable.tar.gz
-rw-r--r-- 1 root root     91312 Jan 12 15:42 clickhouse-client-21.9.7.2-2.noarch.rpm
-rw-r--r-- 1 root root 187997076 Jan 12 15:47 clickhouse-common-static-21.9.7.2-2.x86_64.rpm
-rw-r--r-- 1 root root    114929 Jan 12 15:43 clickhouse-server-21.9.7.2-2.noarch.rpm
[root@hadoop4 clickhouse]# rpm -ivh *.rpm
warning: clickhouse-client-21.9.7.2-2.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID e0c56bd4: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:clickhouse-common-static-21.9.7.2################################# [ 33%]
   2:clickhouse-client-21.9.7.2-2     ################################# [ 67%]
   3:clickhouse-server-21.9.7.2-2     ################################# [100%]
ClickHouse binary is already located at /usr/bin/clickhouse
Symlink /usr/bin/clickhouse-server already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-server to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-client already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-client to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-local already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-local to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-benchmark already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-benchmark to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-copier already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-copier to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-obfuscator already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-obfuscator to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-git-import to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-compressor already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-compressor to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-format already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-format to /usr/bin/clickhouse.
Symlink /usr/bin/clickhouse-extract-from-config already exists but it points to /clickhouse. Will replace the old symlink to /usr/bin/clickhouse.
Creating symlink /usr/bin/clickhouse-extract-from-config to /usr/bin/clickhouse.
Creating clickhouse group if it does not exist.
 groupadd -r clickhouse
Creating clickhouse user if it does not exist.
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse clickhouse
Will set ulimits for clickhouse user in /etc/security/limits.d/clickhouse.conf.
Creating config directory /etc/clickhouse-server/config.d that is used for tweaks of main server configuration.
Creating config directory /etc/clickhouse-server/users.d that is used for tweaks of users configuration.
Config file /etc/clickhouse-server/config.xml already exists, will keep it and extract path info from it.
/etc/clickhouse-server/config.xml has /var/lib/clickhouse/ as data path.
/etc/clickhouse-server/config.xml has /var/log/clickhouse-server/ as log path.
Users config file /etc/clickhouse-server/users.xml already exists, will keep it and extract users info from it.
 chown --recursive clickhouse:clickhouse '/etc/clickhouse-server'
Creating log directory /var/log/clickhouse-server/.
Creating data directory /var/lib/clickhouse/.
Creating pid directory /var/run/clickhouse-server.
 chown --recursive clickhouse:clickhouse '/var/log/clickhouse-server/'
 chown --recursive clickhouse:clickhouse '/var/run/clickhouse-server'
 chown clickhouse:clickhouse '/var/lib/clickhouse/'
 groupadd -r clickhouse-bridge
 useradd -r --shell /bin/false --home-dir /nonexistent -g clickhouse-bridge clickhouse-bridge
 chown --recursive clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-odbc-bridge'
 chown --recursive clickhouse-bridge:clickhouse-bridge '/usr/bin/clickhouse-library-bridge'
Enter password for default user: 
Password for default user is saved in file /etc/clickhouse-server/users.d/default-password.xml.
Setting capabilities for clickhouse binary. This is optional.

ClickHouse has been successfully installed.

Start clickhouse-server with:
 sudo clickhouse start

Start clickhouse-client with:
 clickhouse-client --password

Created symlink from /etc/systemd/system/multi-user.target.wants/clickhouse-server.service to /etc/systemd/system/clickhouse-server.service.

开启

clickhouse start

登录

clickhouse-client --password 123456          #123456是安装步骤设置的密码

文件介绍

每个rpm安装生成的文件目录

#clickhouse-server
/usr/bin/clickhouse-server
/usr/bin/clickhouse-report
/usr/bin/clickhouse-odbc-bridge
/usr/bin/clickhouse-obfuscator
/usr/bin/clickhouse-format
/usr/bin/clickhouse-copier
/etc/security/limits.d/clickhouse.conf
/etc/init.d/clickhouse-server
/etc/cron.d/clickhouse-server

#clickhouse-common-static
/usr/bin/clickhouse
/etc/security/limits.d/clickhouse.conf

#clickhouse-client
/usr/bin/clickhouse-local
/usr/bin/clickhouse-extract-from-config
/usr/bin/clickhouse-compressor
/usr/bin/clickhouse-client
/usr/bin/clickhouse-benchmark
/etc/clickhouse-client/config.xml

启动service 生成的目录文件

/etc/clickhouse-server:配置文件目录,包括:config.xml和users.xml

/etc/clickhouse-client:客户端配置文件目录

/var/lib/clickhouse:默认数据目录

/var/log/clickhouse-server:默认日志目录

/etc/init.d/clickhouse-server:启动shell脚本

/etc/security/limits.d/clickhouse.conf:最大文件打开数的配置

/etc/cron.d/clickhouse-server:定时任务配置,默认没有任务

/usr/bin/clickhouse-client:clickhouse客户端

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值