2.X/1. Getting Started

1-02-4. Add Failover

drscg 2017. 10. 1. 11:52

Running a single node means that you have a single point of failure—there is no redundancy.Fortunately, all we need to do to protect ourselves from data loss is to start another node.

단일 node를 실행한다는 것은 단일 장애 지점을 가지고 있다(복사본이 없다)는 것을 의미한다. 다행히, 데이터 손실을 피하기 위해, 해야 할 것은, 다른 node를 시작하는 것뿐이다.

If we start a second node, our cluster would look like Figure 3, “두 개의 node를 가진 cluster(모든 primary/replica shard가 할당되었다)”.

두 번째 node를 시작하면, cluster는 Figure 3, “두 개의 node를 가진 cluster(모든 primary/replica shard가 할당되었다)”처럼 보일 것이다.

Figure 3. 두 개의 node를 가진 cluster(모든 primary/replica shard가 할당되었다)

두 개의 node를 가진 cluster


The second node has joined the cluster, and three replica shards have been allocated to it—one for each primary shard. That means that we can lose either node, and all of our data will be intact.

두 번째 node가 cluster에 합류하고, 거기에 3개의 replica shard(각 primary shard에 하나씩)가 할당된다. 즉, 어떤 node 하나를 잃어도 데이터 모두는 온전할 것이다.

Any newly indexed document will first be stored on a primary shard, and then copied in parallel to the associated replica shard(s). This ensures that our document can be retrieved from a primary shard or from any of its replicas.

새로 색인된 document는 먼저 primary shard에 저장되고, 병렬로 할당된 replica shard에 복사된다. 이것은 document를 primary shard나 replica shard에서 검색할 수 있도록 한다.

The cluster-health now shows a status of green, which means that all six shards (all three primary shards and all three replica shards) are active:

이제 cluster-health 는 green 이라는 상태를 나타낸다. 즉, 모두 6개 shard(3개의 primary shard와 3개의 replica shard)가 동작 중이다.

{
  "cluster_name": "elasticsearch",
  "status": "green", 
  "timed_out": false,
  "number_of_nodes": 2,
  "number_of_data_nodes": 2,
  "active_primary_shards": 3,
  "active_shards": 6,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 100
}

cluster status 는 green 이다.

Our cluster is not only fully functional, but also always available.

cluster는 모든 기능이 정상이고, 항상 이용 가능 하다.

'2.X > 1. Getting Started' 카테고리의 다른 글

1-02-2. Cluster Health  (0) 2017.10.01
1-02-3. Add an Index  (0) 2017.10.01
1-02-5. Scale Horizontally  (0) 2017.10.01
1-02-6. Coping with Failure  (0) 2017.10.01
1-03. Data In, Data Out  (0) 2017.10.01