安装包地址:
https://packagecloud.io/Altinity/clickhouse
无需下载安装包,更新yum源即可!!
最后: yum install -y clickhouse-server clickhouse-client 即可完成安装!!!
配置之后如果使用DBevaver连接不上,原因是需要修改config.xml的listen,由127.0.0.1修改本地ip地址或者0.0.0.0
创建表报错:clickhouse Can't create replicated table without ZooKeeper
原因:zookeeper配置错了:
当你打开cluster表时候发现错误一般是没有配置分片组!!
https://clickhouse.yandex/docs/en/operations/table_engines/replication/#replicatedmergetree
CREATE TABLE utab ( EventDate DateTime, CounterID UInt32, UserID UInt32 ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/hits', '{replica}') PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) INSERT into utab values ('2018-11-22 08:08:08',1,1); SELECT * from utab; CREATE TABLE utab_all ( EventDate DateTime, CounterID UInt32, UserID UInt32 ) ENGINE = Distributed('ck-daxin', 'default', 'utab', toYYYYMM(EventDate)) ; SELECT count(1) from utab_all;
clickhouse集群安装:
https://clickhouse.yandex/tutorial.html