2016-12-08 5 views
2

テストのために、3ノードのクラスタを2ノードに縮小し、後で5ノードのクラスタで同じことをやりたかったのです。それは CrateDBクラスタの規模を縮小する方法は?

  • SET GLOBAL PERSISTENT discovery.zen.minimum_master_nodes = <half of the cluster + 1>;
    3前2未満だった場合alter table xyz set (number_of_replicas=2):すべてバックアップテーブルの場合、すべてのテーブル
    1. :クラスタを縮小するのがベストプラクティスに従った後しかし

      、 a。データチェックは常に、緑に「フル」にmin_availabilityを設定する必要がある場合: https://crate.io/docs/reference/configuration.html#graceful-stop

    2. 1つのノード
    3. 上の優雅な停止を開始すること3.
    4. ときから
    5. 緑の繰り返しを有効にするデータチェックを待ち行われ、 crate.ymlにおけるノード構成を持続: gateway.recover_after_nodes: n discovery.zen.minimum_master_nodes:[![enter image description here][1]][1] (n/2) +1 gateway.expected_nodes: n

    私のクラスタが再び「グリーン」に行ったことがない、と私はまた、CRIを持っていますticalノードのチェックに失敗しました。

    ここで何が問題になりましたか?

    crate.yml:

    ... 
        ################################## Discovery ################################## 
    
        # Discovery infrastructure ensures nodes can be found within a cluster 
        # and master node is elected. Multicast discovery is the default. 
    
        # Set to ensure a node sees M other master eligible nodes to be considered 
        # operational within the cluster. Its recommended to set it to a higher value 
        # than 1 when running more than 2 nodes in the cluster. 
        # 
        # We highly recommend to set the minimum master nodes as follows: 
        # minimum_master_nodes: (N/2) + 1 where N is the cluster size 
        # That will ensure a full recovery of the cluster state. 
        # 
        discovery.zen.minimum_master_nodes: 2 
    
        # Set the time to wait for ping responses from other nodes when discovering. 
        # Set this option to a higher value on a slow or congested network 
        # to minimize discovery failures: 
        # 
        # discovery.zen.ping.timeout: 3s 
        # 
    
        # Time a node is waiting for responses from other nodes to a published 
        # cluster state. 
        # 
        # discovery.zen.publish_timeout: 30s 
    
        # Unicast discovery allows to explicitly control which nodes will be used 
        # to discover the cluster. It can be used when multicast is not present, 
        # or to restrict the cluster communication-wise. 
        # For example, Amazon Web Services doesn't support multicast discovery. 
        # Therefore, you need to specify the instances you want to connect to a 
        # cluster as described in the following steps: 
        # 
        # 1. Disable multicast discovery (enabled by default): 
        # 
        discovery.zen.ping.multicast.enabled: false 
        # 
        # 2. Configure an initial list of master nodes in the cluster 
        # to perform discovery when new nodes (master or data) are started: 
        # 
        # If you want to debug the discovery process, you can set a logger in 
        # 'config/logging.yml' to help you doing so. 
        # 
        ################################### Gateway ################################### 
    
        # The gateway persists cluster meta data on disk every time the meta data 
        # changes. This data is stored persistently across full cluster restarts 
        # and recovered after nodes are started again. 
    
        # Defines the number of nodes that need to be started before any cluster 
        # state recovery will start. 
        # 
        gateway.recover_after_nodes: 3 
    
        # Defines the time to wait before starting the recovery once the number 
        # of nodes defined in gateway.recover_after_nodes are started. 
        # 
        #gateway.recover_after_time: 5m 
    
        # Defines how many nodes should be waited for until the cluster state is 
        # recovered immediately. The value should be equal to the number of nodes 
        # in the cluster. 
        # 
        gateway.expected_nodes: 3 
    
  • 答えて

    1

    だから重要な2つの事柄があります:

    • は、レプリカの数は、あなたが典型的なセットアップで失う可能ノード数(2は、本質的ですプロセスのノードを縮小しても問題ないように推奨されています)
    • クラスタのノード数が2ノードを超える場合は手順をお勧めします)

    CrateDBは、レプリカとプライマリがノードを共有しないように、クラスタ全体にシャードを自動的に配布します。それが可能でない場合(2ノードと2レプリカを持つ1プライマリの場合、データチェックは決して 'グリーン'に戻りませんので、レプリカの数を1に設定してバック(alter table mytable set (number_of_replicas = 1))緑のクラスタ

    重要なノードのチェックが原因まだ更新crate.ymlを受けたではないクラスタにある:あなたのファイルもまだそれゆえに3ノードクラスタの設定、メッセージを持っていますCrateDBは起動時にexpected_nodeをロードするだけなので(not a runtime setting)、クラスタ全体を再起動する必要があります。これはローリング再開で行うことができますが、SET GLOBAL PERSISTENT discovery.zen.minimum_master_nodes = <half of the cluster + 1>;を正しく設定してください。そうでなければコンセンサスは動作しません...

    また、クラスタを過負荷状態にしたり、誤ってデータを失うことがないように、1つずつ縮尺を変更することをお勧めします。

    関連する問題