它可以通過兩種方式來指定。
在單獨的文件中(默認是/etc/metrika.xml)。 創建這個文件,使之成爲讀訪問(CHOWN 644就夠了)。 而且裏面是這樣寫的:
<yandex>
<clickhouse_remote_servers> <!-- name of substitution-->
<logs_all> <!-- name of cluster (arbitary) to be specified in parameter of Distributed table -->
<shard>
<replica>
<host>example01-01-1t.yandex.ru</host>
<port>9000</port>
</replica>
<replica>
<host>example01-01-2t.yandex.ru</host>
<port>9000</port>
</replica>
</shard>
<shard>
<replica>
<host>example02-01-1t.yandex.ru</host>
<port>9000</port>
</replica>
<replica>
<host>example02-01-2t.yandex.ru</host>
<port>9000</port>
</replica>
</shard>
</logs_all>
</clickhouse_remote_servers>
</yandex>
直接在config.xml文件:
<!-- Configuration of clusters that could be used in Distributed tables.
https://clickhouse.yandex/reference_en.html#Distributed
-->
<remote_servers>
<logs_all> <!-- name of cluster (arbitary) to be specified in parameter of Distributed table -->
<shard>
<replica>
<host>example01-01-1t.yandex.ru</host>
<port>9000</port>
</replica>
<replica>
<host>example01-01-2t.yandex.ru</host>
<port>9000</port>
</replica>
</shard>
<shard>
<replica>
<host>example02-01-1t.yandex.ru</host>
<port>9000</port>
</replica>
<replica>
<host>example02-01-2t.yandex.ru</host>
<port>9000</port>
</replica>
</shard>
</logs_all>
</remote_servers>
爲了方便,服務器將在與啓動創建 '配置-preprocessed.xml' 文件所有的替換。它僅供審查(不用於服務器)。