Cluster computing 配置clickhouse群集时,远程服务器元素应位于何处

Cluster computing 配置clickhouse群集时,远程服务器元素应位于何处,cluster-computing,clickhouse,Cluster Computing,Clickhouse,我正在设置一个clickhouse集群,正如教程所说,应该添加“远程服务器”,然后我转到/etc/clickhouse server/config.xml,我看到后面是 [1]: . 我对这些文件感到困惑,/etc/metrika.xml和/yandex/name\u of\u替换。谁能举个例子,谢谢可以用两种方式来说明 在单独的文件中(默认情况下为/etc/metrika.xml)。 创建此文件,使其可供读取(chown 644已足够)。 在里面写下这样的话: <yandex>

我正在设置一个clickhouse集群,正如教程所说,应该添加“远程服务器”,然后我转到/etc/clickhouse server/config.xml,我看到后面是
[1]: .
我对这些文件感到困惑,/etc/metrika.xml和/yandex/name\u of\u替换。谁能举个例子,谢谢

可以用两种方式来说明

  • 在单独的文件中(默认情况下为/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>
    
    
    示例01-01-1t.yandex.ru
    9000
    示例01-01-2t.yandex.ru
    9000
    示例02-01-1t.yandex.ru
    9000
    示例02-01-2t.yandex.ru
    9000
    
  • 直接在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>
    
    
    示例01-01-1t.yandex.ru
    9000
    示例01-01-2t.yandex.ru
    9000
    示例02-01-1t.yandex.ru
    9000
    示例02-01-2t.yandex.ru
    9000
    
  • 为了方便起见,服务器将在启动时创建包含所有替换的
    /etc/clickhouse server/preprocessed/config.xml
    文件。它只是供查看(服务器不使用)