2016-08-23 59 views
1

當我建立clickhouse簇,作爲教程所說的「remote_servers」應添加遠程服務器元件位於,然後我轉向/etc/clickhouse-server/config.xml我看到< remote_servers含= 「clickhouse_remote_servers」 >隨後用 [1]:http://i.stack.imgur.com/AHBBg.png
我很困惑與這些文件,/etc/metrika.xml和/ Yandex的/ name_of_substitution。誰可以給一個例子,由於應該在哪裏構式clickhouse簇

回答

3

它可以通過兩種方式來指定。

  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> 
    

爲了方便,服務器將在與啓動創建 '配置-preprocessed.xml' 文件所有的替換。它僅供審查(不用於服務器)。