【问题标题】:where should the remote-server element located when configurating clickhouse cluster配置 clickhouse 集群时 remote-server 元素应该位于哪里
【发布时间】:2016-12-29 22:39:27
【问题描述】:

我正在设置一个 clickhouse 集群,因为教程说应该添加“remote_servers”,然后我转向 /etc/clickhouse-server/config.xml,我看到 跟随和 [1]:http://i.stack.imgur.com/AHBBg.png
我对这些文件感到困惑,/etc/metrika.xml 和 /yandex/name_of_substitution。谁能举个例子,谢谢

【问题讨论】:

    标签: cluster-computing clickhouse


    【解决方案1】:

    可以通过两种方式指定。

    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 文件。仅供审核(服务器不使用)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-23
      • 1970-01-01
      • 2014-10-05
      • 2012-04-19
      • 1970-01-01
      • 2018-10-11
      • 2018-08-16
      相关资源
      最近更新 更多