【发布时间】:2016-12-29 22:39:27
【问题描述】:
我正在设置一个 clickhouse 集群,因为教程说应该添加“remote_servers”,然后我转向 /etc/clickhouse-server/config.xml,我看到
我对这些文件感到困惑,/etc/metrika.xml 和 /yandex/name_of_substitution。谁能举个例子,谢谢
【问题讨论】:
标签: cluster-computing clickhouse
我正在设置一个 clickhouse 集群,因为教程说应该添加“remote_servers”,然后我转向 /etc/clickhouse-server/config.xml,我看到
我对这些文件感到困惑,/etc/metrika.xml 和 /yandex/name_of_substitution。谁能举个例子,谢谢
【问题讨论】:
标签: cluster-computing clickhouse
可以通过两种方式指定。
在单独的文件中(默认为 /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>
为方便起见,服务器将在启动时创建包含所有替换的/etc/clickhouse-server/preprocessed/config.xml 文件。仅供审核(服务器不使用)。
【讨论】: