2

チュートリアルで「remote_servers」を追加する必要があると言われているように、クリックハウス クラスターをセットアップしています。 ]: http://i.stack.imgur.com/AHBBg.png .
これらのファイル、/etc/metrika.xml および /yandex/name_of_substitution と混同しています。誰が例を挙げることができますか、ありがとう

4

1 に答える 1

4

2 つの方法で指定できます。

  1. 別のファイル (デフォルトでは /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>
    
  2. 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起動時にすべての置換を含むファイルを作成します。レビュー用です(サーバーでは使用されません)。

于 2016-08-24T18:51:28.350 に答える