概述:clickhouse是一个高性能的列式数据库,特点就是快快快,查询性能是mysql的100-1000倍,非常适合存储频繁写入的数据,比如:日志,用户事件记录。单表存储上亿甚至十几亿行数据库查询都是很快的。具体性能参考
https://clickhouse.yandex/benchmark.html 缺点:不能进行更新操作,不能删除单行数据(只能整表删除),没有事务。
1.配置好yum源
$ curl -s https://packagecloud.io/install/repositories/Altinity/clickhouse/script.rpm.sh | sudo bash
$ sudo yum -q makecache -y --disablerepo='*' --enablerepo='Altinity_clickhouse' #更新yum
$ sudo yum list 'clickhouse*' #检验是否配置好源
已加载插件:fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Altinity_clickhouse/signature | 836 B 00:00
Altinity_clickhouse/signature | 1.0 kB 00:00 ...
Altinity_clickhouse-source/signature | 819 B 00:00
Altinity_clickhouse-source/signature | 951 B 00:00 ...
已安装的软件包
clickhouse-client.x86_64 18.16.1-1.el6 @Altinity_clickhouse
clickhouse-common-static.x86_64 18.16.1-1.el6 @Altinity_clickhouse
clickhouse-compressor.x86_64 1.1.54336-3.el6 @Altinity_clickhouse
clickhouse-debuginfo.x86_64 18.14.15-1.el6 @Altinity_clickhouse
clickhouse-server.x86_64 18.16.1-1.el6 @Altinity_clickhouse
clickhouse-server-common.x86_64 18.16.1-1.el6 @Altinity_clickhouse
clickhouse-test.x86_64 18.16.1-1.el6 @Altinity_clickhouse
2.安装clickhouse
$ yum -y install clickhouse-server clickhouse-client
或者
$ yum -y install clickhouse-*
3.启动或者停止clickhouse-server
$ sudo /etc/init.d/clickhouse-server stop|start|restart
$ clickhouse-client --port=9001 #连接clickhouse-server
4.clickhouse配置文件
/etc/clickhouse-server/config.xml
/etc/clickhouse-server/users.xml
我这里的端口是9001 ,端口可以在/etc/clickhouse-server/config.xml 修改
image.png
网友评论