- Published on
clickhouse 安装使用
- Authors
- Name
- Harry
ClickHouse 是用于实时应用程序和分析的速度最快、资源效率最高的开源数据库。
安装
CentOS系统环境
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.
使用
使用客户端工具连接server
clickhouse-client --host 116.63.xx.xx --port 9000 --password little.123
创建数据库
CREATE DATABASE test;
压缩分区数据表
OPTIMIZE TABLE test.tb1 PARTITION 202304 final;
压缩全表
OPTIMIZE TABLE test.tb1 final;