Configuration

/etc/clickhouse-server/config.xml

主要組態檔案

/etc/clickhouse-server/config.d

置放個別XML檔並根據replace/remove屬性,覆寫config.xml

/etc/metrika.xml

主檔元素有屬性incl,可以用替換參數在檔案metrika.xml內取得
<zookeeper incl="zookeeper-servers" optional="true" />
    <zookeeper-servers>
            <node index="1">
                    <host>xxxx</host>
                    <port>2181</port>
            </node>
    </zookeeper-servers>

/etc/clickhouse-server/users.xml

user settings, profiles, and quotas 相關設定

/etc/clickhouse-server/users.d

置放個別XML檔,覆寫users.xml

Cluster

Distributed

configration

<remote_servers>
  <名稱>
    <shard>
        <weight>1</weight>          
        <internal_replication>true</internal_replication>
        <replica>
            <host>example01-01-1</host>
            <port>9000</port>
        </replica>         
    </shard>
    <shard>
        <weight>2</weight>
        <internal_replication>true</internal_replication>
        <replica>
            <host>example01-02-1</host>
            <port>9000</port>
        </replica>           
    </shard>        
  </名稱>
</remote_servers>

Replication

<zookeeper>
    <node index="1">
        <host>example1</host>
        <port>2181</port>
    </node>
    <node index="2">
        <host>example2</host>
        <port>2181</port>
    </node>
</zookeeper>
<macros>        
    <shard>01</shard>
    <replica>example01</replica>
</macros>

OS tunning

Huge page

 echo 'never' | sudo tee /sys/kernel/mm/transparent_hugepage/enabled