3、Linux环境安装clickhouse【非docker版】

一、CentOS安装

1. 登陆官网

https://clickhouse.tech/#quick-start

2. 安装
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
sudo yum install -y clickhouse-server clickhouse-client
 
sudo /etc/init.d/clickhouse-server start    # 启动服务端
clickhouse-client  # or "clickhouse-client --password" if you set up a password.    # 连接客户端
3.配置修改

config.xml 打开监听地址

<listen_host>0.0.0.0</listen_host>
<path>/opt/data/</path>

有时9000端口被其他组件占用,需修改config.xml,执行

sed -i "s/9000/5566/g" /etc/clickhouse-server/config.xml

users.xml 设置密码

<password>password</password>
4.启动
sudo clickhouse-server --config-file=/etc/clickhouse-server/config.xml
## 其他命令
systemctl start clickhouse-server
systemctl stop clickhouse-server
systemctl status clickhouse-server

二、安装包安装

1、下载地址

https://packages.clickhouse.com/
安装包如下:
在这里插入图片描述

2、安装

上传到linux环境,依次将这四个安装包解压,并且每解压一个,执行一下解压文件夹下的install下的doinst.sh脚本。
解压顺序:

clickhouse-common-static-22.3.2.2.tgz
clickhouse-common-static-dbg-22.3.2.2.tgz
clickhouse-server-22.3.2.2.tgz
clickhouse-client-22.3.2.2.tgz

解压执行doinst.sh脚本:

------------------------------------------------------------
# 解压
tar -zxvf clickhouse-common-static-22.3.2.2.tgz
cd clickhouse-common-static-22.3.2.2/install/
# 运行doinst.sh 
./doinst.sh 
------------------------------------------------------------
tar -zxvf clickhouse-common-static-dbg-22.3.2.2.tgz 
./clickhouse-common-static-dbg-22.3.2.2/install/doinst.sh
------------------------------------------------------------
tar -zxvf clickhouse-server-22.3.2.2.tgz
./clickhouse-server-22.3.2.2/install/doinst.sh
------------------------------------------------------------
tar -zxvf clickhouse-client-22.3.2.2.tgz
./clickhouse-client-22.3.2.2/install/doinst.sh
------------------------------------------------------------

在解压clickhouse-serve并安装./clickhouse-server-21.9.4.35/install/doinst.sh
后,clickhouse会默认创建一个default的用户,让你设置密码,不设置密码可以按回车

3、配置文件

config.xml 打开监听地址

<listen_host>0.0.0.0</listen_host>
<path>/opt/data/</path>

users.xml 设置密码

<password>password</password>
4.启动
sudo clickhouse-server --config-file=/etc/clickhouse-server/config.xml
## 其他命令
systemctl start clickhouse-server
systemctl stop clickhouse-server
systemctl status clickhouse-server
5.连接客户端
clickhouse-client
## -m 支持多行语句
clickhouse-client -m
## 密码连接
clickhouse-client --password
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值