ClickHouse-rpm安装

  • Post author:
  • Post category:其他




介绍

官方存在几种安装方式:

  • https://clickhouse.tech/docs/en/getting-started/install/
  • From RPM Packages
  • From Tgz Archives
  • From Docker Image
  • From Precompiled Binaries for Non-Standard Environments

本次主要这几种情况下的安装



yum安装

sudo yum install clickhouse-server clickhouse-client



Tgz安装

该安装方式在内网方式可通过吧对应版本的ch server client安装包下载到本地在上传到服务器进行安装

export LATEST_VERSION=`curl https://api.github.com/repos/ClickHouse/ClickHouse/tags 2>/dev/null | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n 1`
curl -O https://repo.clickhouse.tech/tgz/clickhouse-common-static-$LATEST_VERSION.tgz
curl -O https://repo.clickhouse.tech/tgz/clickhouse-common-static-dbg-$LATEST_VERSION.tgz
curl -O https://repo.clickhouse.tech/tgz/clickhouse-server-$LATEST_VERSION.tgz
curl -O https://repo.clickhouse.tech/tgz/clickhouse-client-$LATEST_VERSION.tgz

tar -xzvf clickhouse-common-static-$LATEST_VERSION.tgz
sudo clickhouse-common-static-$LATEST_VERSION/install/doinst.sh

tar -xzvf clickhouse-common-static-dbg-$LATEST_VERSION.tgz
sudo clickhouse-common-static-dbg-$LATEST_VERSION/install/doinst.sh

tar -xzvf clickhouse-server-$LATEST_VERSION.tgz
sudo clickhouse-server-$LATEST_VERSION/install/doinst.sh
sudo /etc/init.d/clickhouse-server start

tar -xzvf clickhouse-client-$LATEST_VERSION.tgz
sudo clickhouse-client-$LATEST_VERSION/install/doinst.sh



内网rpm安装ClickHouse

官网没有直接提供rpm包安装,这边提供一个下载ClickHouse RPM包的资源地址:链接:

rpm包下载链接



页面主要有两个目录:

在这里插入图片描述

clickhouse目录下多为测试版更新,更新速度快,可在测试版本更新功能;

clickhouse-altinity-stable目录为稳定版发布目录,下载或者更新版本可以在该网址该目录下面进行下载操作。

将下载的rpm包上传到服务器


执行命令,则可进行离线安装

sudo rpm -ivh *



启动检测

  1. 执行启动命令:sudo /etc/init.d/clickhouse-server start
  2. 停止命令:sudo /etc/init.d/clickhouse-server stop
  3. 登录ClickHouse数据库:clickhouse-client –port 8200
  4. 查看库:show databases;
test01 :) show databases;

SHOW DATABASES

┌─name────┐
│ ck_test │
│ default │
│ system  │
└─────────┘

3 rows in set. Elapsed: 0.002 sec. 

下载的rpm包以及生成文件介绍:


下载RPM包。

clickhouse-client-20.3.18.10-1.el7.x86_64.rpm
clickhouse-common-static-20.3.18.10-1.el7.x86_64.rpm
clickhouse-server-20.3.18.10-1.el7.x86_64.rpm
clickhouse-server-common-20.3.18.10-1.el7.x86_64.rpm

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


clickhouse-server-common-20.3.18.10-1.el7.x86_64.rpm
/etc/clickhouse-server/users.xml
/etc/clickhouse-server/config.xml

clickhouse-server-20.3.18.10-1.el7.x86_64.rpm
/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-static20.3.18.10-1.el7.x86_64.rpm
/usr/bin/clickhouse
/etc/security/limits.d/clickhouse.conf

clickhouse-client-20.3.18.10-1.el7.x86_64.rpm
/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客户端



版权声明:本文为qq_40341628原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。