2016-12-08 2 views
2

테스트를 위해 3 노드 클러스터를 2 노드로 축소하여 나중에 5 노드 클러스터에 대해 동일한 작업을 수행하려고했습니다.CrateDB 클러스터를 축소하는 방법은 무엇입니까?

그러나, 클러스터 축소의 가장 좋은 방법은 다음과 후 : 최대 모든 테이블의 모든 테이블의

  • 을 뒤로

    1. 을 : alter table xyz set (number_of_replicas=2) 그것이보다 작은 경우 2
    2. SET GLOBAL PERSISTENT discovery.zen.minimum_master_nodes = <half of the cluster + 1>;
      3 전 에이. https://crate.io/docs/reference/configuration.html#graceful-stop
    3. 가 데이터 확인에 대한
    4. 기다립니다 3.
    5. 때부터 녹색
    6. 반복을 설정하는 하나 개의 노드에 우아한 정지를 시작 : 데이터 검사가 항상 녹색이 경우에 '전체'를 min_availability 설정 완료, 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 노드 이상인 경우 절차가 권장 됨

    CrateDB는 복제본과 기본 노드가 노드를 공유하지 않도록 클러스터에 자동으로 분산을 배포합니다. 이것이 가능하지 않은 경우 (2 개의 노드와 1 개의 기본 복제본이 2 개의 복제본 인 경우 데이터 확인이 '녹색'으로 반환되지 않습니다.) 따라서 귀하의 경우 복제본 수를 1로 설정하여 클러스터를 녹색으로 다시 클러스터합니다 (alter table mytable set (number_of_replicas = 1)).

    크리티컬 노드 검사는 아직 클러스터에 업데이트 된 crate.yml을받지 못해서 발생합니다. 파일에도 여전히 3 노드 클러스터 구성이 있으므로 메시지 CrateDB는 시작할 때 expected_nodes 만로드하므로 (not a runtime setting) 전체 클러스터를 다시 시작해야만 축소가 완료됩니다. 롤링을 다시 시작할 때 수행 할 수 있지만 SET GLOBAL PERSISTENT discovery.zen.minimum_master_nodes = <half of the cluster + 1>;을 올바르게 설정해야합니다. 그렇지 않으면 합의가 작동하지 않습니다. ...

    또한 재조정과 우발적 인 데이터 손실로 인해 클러스터에 과부하가 걸리지 않도록 하나씩 축소하는 것이 좋습니다.