clickhouse之部署(持續更新)

語言: CN / TW / HK

前言

clickhouse的安裝方式有三種。有作業系統源安裝包,tag安裝包,原始碼安裝

作業系統源安裝包

這些是用root命令安裝

yum install yum-utils
rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG
yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/stable/x86_64
yum install clickhouse-server clickhouse-client

# 要使用clickhouse才能啟動
chown -R clickhouse:clickhouse /etc/clickhouse-server
chown -R clickhouse:clickhouse /var/log/clickhouse-server
chown -R clickhouse:clickhouse /etc/init.d/clickhouse-server
cd /etc/init.d/

sudo -u clickhouse clickhouse-server --config-file=/etc/clickhouse-server/config.xml

tag包安裝

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
clickhouse-common-static-$LATEST_VERSION/install/doinst.sh

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

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

chown -R clickhouse:clickhouse /etc/clickhouse-server
chown -R clickhouse:clickhouse /var/log/clickhouse-server
chown -R clickhouse:clickhouse /etc/init.d/clickhouse-server

/etc/init.d/clickhouse-server start

tar -xzvf clickhouse-client-$LATEST_VERSION.tgz
lickhouse-client-$LATEST_VERSION/install/doinst.sh
分享到: