clickhouse之部署(持续更新)

原创
2021/07/22 20:42
阅读数 315

前言

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

问题

远程连接

修改clickhouse-server配置:/etc/clickhouse-server/config.xml

<listen_host>0.0.0.0</listen_host>
展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部