ChickHouse安装介绍

ChickHouse安装介绍

一、clickHouse简介
clickHouse是俄罗斯人开源的一个数据分析的数据库,这个列式存储的数据库跑分要领先很多流行的商业的数据库软件,简单的说,ClickHouse作为分析型数据库,有三大特点:一是跑分快,二是功能多,三是文艺范

二、安装环境
官网上优先支持Ubuntu系统,Ubuntu有官方编译好的安装包可以使用。
但国内大部分使用的还是Centos系统,这里是Centos7系统。

三、安装
1、去官网下载安装包
下载地址:http://repo.red-soft.biz/repos/clickhouse/stable/el7/
rpm安装包:
clickhouse-client-1.1.54236-4.el7.x86_64.rpm
clickhouse-compressor-1.1.54236-4.el7.x86_64.rpm
clickhouse-debuginfo-1.1.54236-4.el7.x86_64.rpm
clickhouse-server-1.1.54236-4.el7.x86_64.rpm
clickhouse-server-common-1.1.54236-4.el7.x86_64.rpm
2、软件安装需要依赖2个额外的包 libtool-ltdl和unixODBC,推荐使用yum 安装:
[root@localhost clickhouse]# yum -y localinstall clickhouse-*.rpm
3、安装依赖包
[root@localhost clickhouse]# rpm -ivh clickhouse-server-common-1.1.54236-4.el7.x86_64.rpm
准备中... ################################# [100%]
软件包 clickhouse-server-common-1.1.54236-4.el7.x86_64 已经安装
[root@localhost clickhouse]# rpm -ivh clickhouse-client-1.1.54236-4.el7.x86_64.rpm
准备中... ################################# [100%]
软件包 clickhouse-client-1.1.54236-4.el7.x86_64 已经安装
[root@localhost clickhouse]# rpm -ivh clickhouse-compressor-1.1.54236-4.el7.x86_64.rpm
准备中... ################################# [100%]
软件包 clickhouse-compressor-1.1.54236-4.el7.x86_64 已经安装
[root@localhost clickhouse]# rpm -ivh clickhouse-debuginfo-1.1.54236-4.el7.x86_64.rpm
准备中... ################################# [100%]
软件包 clickhouse-debuginfo-1.1.54236-4.el7.x86_64 已经安装

四、修改配置文件(集群的话这里需要修改ip)
[root@localhost clickhouse]# cd /etc/clickhouse-server/
修改config.xml文件
<listen_host>::1</listen_host>
<listen_host>127.0.0.1</listen_host

五、操作
1、启动
[root@localhost huangwei]# service clickhouse-server start
(如果不行:clickhouse-server --config-file=/etc/clickhouse-server/config.xml)
后台托管启动服务
nohup clickhouse-server --config-file=/etc/clickhouse-server/config.xml >null 2>&1 &
2、登陆客户端
[root@localhost huangwei]# clickhouse-client
ClickHouse client version 1.1.54236.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.54236.

:) show tables;

SHOW TABLES

Ok.

0 rows in set. Elapsed: 0.004 sec.

:)
退出:exit
连接测试
clickhouse-client --host=xx.xx.xx.xx --port=9000 (端口号如果被占用可修改配置文件)
3、停止
service clickhouse-server stop
4、重启
service clickhouse-server restart
5、查看状态
service clickhouse-server status

原文地址:https://www.cnblogs.com/cs123/p/14112056.html