zoukankan      html  css  js  c++  java
  • ClickHouse最简单的安装方法

    安装包地址:

    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 

  • 相关阅读:
    yum报错Python版本不兼容
    MySQL——checkpoint
    MySQL体系结构——内存
    MySQL体系结构——存储引擎
    ORA-00972: identifier is too long 问题处理
    day08面向对象、jsonpath操作、写日志
    day07mock edis加密
    数据库增删改查封装
    day06数据库、发送邮件、操作excel等
    pycharm的使用
  • 原文地址:https://www.cnblogs.com/leodaxin/p/10015700.html
Copyright © 2011-2022 走看看