'master'에 해당되는 글 9건

  1. 2020.12.11 [Elasticsearch] Discovery Mode 정리.
  2. 2020.05.18 [Git] Master 브랜치로 돌리기.
  3. 2019.10.17 [Elasticsearch] minimum_master_nodes is not working.
  4. 2016.08.16 [GIT] master 브랜치를 무식하게 변경해 보자.
  5. 2016.03.22 [Redis] Master/Slave, Sentinel 구성 부터 Jedis 예제까지.
  6. 2015.11.24 [Elasticsearch - The Definitive Guide] An Empty Cluster
  7. 2015.04.02 [GIT] master branch resync.
  8. 2014.09.02 [ElasticSearch] master node election...
  9. 2014.01.14 [elasticsearch] node master/data ....

[Elasticsearch] Discovery Mode 정리.

Elastic/Elasticsearch 2020. 12. 11. 11:34

참고문서)

www.elastic.co/guide/en/elasticsearch/reference/7.x/modules-discovery.html

 

 

1. 단독 구성

discovery.type=single-node

 

2. 클러스터 구성

discovery.seed_hosts=e1,e2,e3

cluster.initial_master_nodes=e1,e2,e3

 

1번과 같이 단독 구성은 어떤 형태로든 클러스터 환경 구성이 안됩니다.

또한, 단독 구성 노드를 동일 인스턴스, 로컬 환경에서 여러 개 실행이 되지 않습니다.

 

2번과 같은 클러스터 구성에서는 최소 2대 이상의 구성이 필요 하며,

Master 노드에 대한 자격을 가지는 노드도 또한 2대 이상 필요 합니다.

 

3개 노드 구성 시)
Master 노드가 죽게 되면, Master 노드 자격 노드가 Master 로 선출 되며 서비스가 가능 합니다.

2개 노드 구성 시)
Master 노드가 죽게 되면 서비스가 불가능 합니다.

Master 노드 이외 다른 노드가 죽어도 서비스는 불가능 합니다.

 

간혹, 클러스터 구성 시 Master 노드에 대한 쿼럼 구성을 오해 하시는 경우가 있어서 작성해 보았습니다.

 

:

[Git] Master 브랜치로 돌리기.

ITWeb/개발일반 2020. 5. 18. 15:00

[로컬 Master 브랜치를 Remote Master 로 돌리기]

 

$ git fetch origin

$ git reset --hard origin/master

$ git clean -f -d

 

가끔 개발 브랜치 인줄 알고 merge 했는데, 헐... master 브랜치...

그럼 돌리세요. :)

:

[Elasticsearch] minimum_master_nodes is not working.

Elastic/Elasticsearch 2019. 10. 17. 14:56

7.x breaking changes 에 올라가 있는 내용입니다.

기억력을 돕는 차원에서 기록합니다.

 

The discovery.zen.minimum_master_nodes setting is permitted, but ignored, on 7.x nodes.

 

해당 설정은 더 이상 사용하지 맙시다.

그리고 이제 master node 는 2개로 구성해서는 더 이상 위험해서 못쓰겠내요.

 

참고문서)

https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#breaking_70_discovery_changes

 

Breaking changes in 7.0 | Elasticsearch Reference [7.4] | Elastic

Reindex indices from Elasticsearch 5.x or before Indices created in Elasticsearch 5.x or before will need to be reindexed with Elasticsearch 6.x in order to be readable by Elasticsearch 7.x.

www.elastic.co

 

:

[GIT] master 브랜치를 무식하게 변경해 보자.

ITWeb/개발일반 2016. 8. 16. 16:22

구글링 하면 많이 나옵니다.

이도 저도 귀찮을 때 사용하세요.


$ git checkout master 

$ git reset --hard better_branch  

$ git push -f origin master 


또는 


$ git branch -M branch_name master


:

[Redis] Master/Slave, Sentinel 구성 부터 Jedis 예제까지.

ITWeb/개발일반 2016. 3. 22. 16:17

필요해서 구성해본 내용을 정리 합니다.

복습 차원에서 기록 하는 것이라 별 도움이 안될수 있습니다.


Redis 공식 사이트)


Redis 다운로드)


Redis 설치 on OSX)

# 다운로드 받은 후 tar 압축 해제 후 make 했습니다.

$ make

    LINK redis-check-dump

    CC redis-check-aof.o

    LINK redis-check-aof


Hint: It's a good idea to run 'make test' ;)

# 필요 하신 경우 make install 하시면 됩니다.


Redis Configure 참조)

- maxmemory 설정은 32bits 운영체제에서 최대 3GB 이며, 64bits 에서는 리소스 만큼 가능 하다고 합니다.

- expire 설정을 해주는 것 보다 그냥 LRU 설정을 사용하라고 합니다. (근데 이건 서비스 특성과 성능 테스트 후 결정 하는게 좋아 보입니다.)

- redis LRU 알고리즘이 완벽하지 않다(Redis LRU algorithm is not an exact implementation.)는 공식 문서의 설명이 있습니다. 그래서 maxmemory-samples 라는 설정을 하는 것 같습니다.

(http://redis.io/topics/lru-cache)

- 단순 휘발성 데이터에 대한 cache 용도 일때는 rdb, append 모드를 disable 하는게 좋습니다.

- sentinel 설정은 master, slave 구성 시 failover 지원을 하기 위함 입니다. (client 에서는 JedisSentinelPool 을 사용하세요.)

- master election 시 민주적으로 하기 위해 quorum 구성을 합니다.


Redis Master 설정)

daemonize yes

pidfile /redis-server/master/pidfile/redis.pid

port 6379

tcp-backlog 511

bind 127.0.0.1

loglevel debug

logfile /redis-server/master/log/redis.log

maxmemory 64MB

maxmemory-policy allkeys-lru

maxmemory-samples 5

appendonly no

save ""

requirepass redispassword


Redis Slave 설정)

daemonize yes

pidfile /redis-server/slave/pidfile/redis.pid

port 6479

tcp-backlog 511

bind 127.0.0.1

loglevel debug

logfile /redis-server/slave/log/redis.log

maxmemory 64MB

maxmemory-policy allkeys-lru

maxmemory-samples 5

appendonly no

save ""

slaveof 127.0.0.1 6379

masterauth redispassword


Redis Sentinel Quorum 설정)

Sentinel 1)

port 26379

dir "/tmp"

sentinel monitor redis-master 127.0.0.1 6379 2

sentinel auth-pass redis-master redispassword

sentinel down-after-milliseconds redis-master 30000

sentinel parallel-syncs redis-master 1

daemonize yes

pidfile "/redis-server/sentinel1/pidfile/sentinel.pid"

logfile "/redis-server/sentinel1/log/sentinel.log"


Sentinel 2)

port 26479

dir "/tmp"

sentinel monitor redis-master 127.0.0.1 6379 2

sentinel auth-pass redis-master redispassword

sentinel down-after-milliseconds redis-master 30000

sentinel parallel-syncs redis-master 1

daemonize yes

pidfile "/redis-server/sentinel2/pidfile/sentinel.pid"

logfile "/redis-server/sentinel2/log/sentinel.log"


Sentinel 3)

port 26579

dir "/tmp"

sentinel monitor redis-master 127.0.0.1 6379 2

sentinel auth-pass redis-master redispassword

sentinel down-after-milliseconds redis-master 30000

sentinel parallel-syncs redis-master 1

daemonize yes

pidfile "/redis-server/sentinel3/pidfile/sentinel.pid"

logfile "/redis-server/sentinel3/log/sentinel.log"


Redis Master/Slave/Sentinel 실행)

$ src/redis-server /redis-server/master/conf/redis.conf

$ src/redis-server /redis-server/slave/conf/redis.conf

$ src/redis-server /redis-server/sentinel1/conf/sentinel.conf --sentinel

$ src/redis-server /redis-server/sentinel2/conf/sentinel.conf --sentinel

$ src/redis-server /redis-server/sentinel3/conf/sentinel.conf --sentinel


Jedis 공식 사이트)


Jedis 샘플 코드)

- JedisSentinelPoolTest 참조



:

[Elasticsearch - The Definitive Guide] An Empty Cluster

Elastic/TheDefinitiveGuide 2015. 11. 24. 17:04

원본링크)

https://www.elastic.co/guide/en/elasticsearch/guide/current/_an_empty_cluster.html


Elasitcsearch에가 이야기 하는 master node 의 역할 과 주의 사항이랄까요?

아래는 원문에 대한 Snippet 입니다.


One node in the cluster is elected to be the master node, which is in charge of managing cluster-wide changes like creating or deleting an index, or adding or removing a node from the cluster. The master node does not need to be involved in document-level changes or searches, which means that having just one master node will not become a bottleneck as traffic grows. Any node can become the master. Our example cluster has only one node, so it performs the master role.


[마스터 노드가 하는 일?]

인덱스 생성/삭제

노드 추가/제거


[마스터 노드에서 하면 안되는 일?]

문서 레벨의 변경 작업

검색


하면 안될 일은 트래픽 증가 시 병목 현상이 마스터 노드에서 발생 하면 안되기 때문 입니다.

(장애 납니다. ^^;)

:

[GIT] master branch resync.

ITWeb/개발일반 2015. 4. 2. 11:09

asf의 master branch를 개인 github master branch로 sync 작업을 하기 위해 아래 명령어를 통해 syncing 작업을 하도록 합니다.

그냥 개인적으로 명령어 기억을 잘 못해서 기록해 봅니다.


$ git branch master

$ git clean -d -f

$ git fetch asf master

$ git push origin +master

:

[ElasticSearch] master node election...

Elastic/Elasticsearch 2014. 9. 2. 11:00

그냥 또 까먹을까봐.. 대충 적어 봅니다.


기본적으로 zen discovery 를 통해서 cluster 구성 및 node 간 통신을 위해서 사용이 됩니다.

그럼 master node  가 죽었을 때 어떻게 선출이 될까요?


es 가 실행 되면서 zen discovery module 도 등록이 됩니다.

ZenDiscovery 가 binding 되면서 MasterFaultDetection 과 ElectMasterService 도 등록이 되지요.

MasterFaultDetection 에서 master node 를 감시하다가 에러가 나면 ElectMasterService 에서 master node 를 선출하게 되는 구조가 되는 것입니다.


참 쉽죠 ^^;


ZenDiscovery 에서 하는 역할은 더 있지만 여기서는 그냥 단순 master election 에 대해서만 살펴 봤습니다.


ZenDiscovery

        

MasterFaultDetection

        

ElectMasterService



:

[elasticsearch] node master/data ....

Elastic/Elasticsearch 2014. 1. 14. 17:34

참고글 : http://stackoverflow.com/questions/15019821/what-differents-between-master-node-gateway-and-other-node-gateway-in-elasticsea

참고 하시라고 올려 봅니다.

[원문]

The master node is the same as any other node in the cluster, except that it has been elected to be the master.

It is responsible for coordinating any cluster-wide changes, such as as the addition or removal of a node, creation, deletion or change of state (ie open/close) of an index, and the allocation of shards to nodes. When any of these changes occur, the "cluster state" is updated by the master and published to all other nodes in the cluster. It is the only node that may publish a new cluster state.

The tasks that a master performs are lightweight. Any tasks that deal with data (eg indexing, searching etc) do not need to involve the master. If you choose to run the master as a non-data node (ie a node that acts as master and as a router, but doesn't contain any data) then the master can run happily on a smallish box.

A node is allowed to become a master if it is marked as "master eligible" (which all nodes are by default). If the current master goes down, a new master will be elected by the cluster.

An important configuration option in your cluster is minimum_master_nodes. This specifies the number of "master eligible" nodes that a node must be able to see in order to be part of a cluster. Its purpose is to avoid "split brain" ie having the cluster separate into two clusters, both of which think that they are functioning correctly.

For instance, if you have 3 nodes, all of which are master eligible, and set minimum_master_nodes to 1, then if the third node is separated from the other two it, it still sees one master-eligible node (itself) and thinks that it can form a cluster by itself.

Instead, set minimum_master_nodes to 2 in this case (number of nodes / 2 + 1), then if the third node separates, it won't see enough master nodes, and thus won't form a cluster by itself. It will keep trying to join the original cluster.

While Elasticsearch tries very hard to choose the correct defaults, minimum_master_nodes is impossible to guess, as it has no way of knowing how many nodes you intend to run. This is something you must configure yourself.


[구글 번역]

마스터 노드 는마스터로 선출 되었음을 제외하고 ,클러스터의 다른 노드 와 동일하다.

그런 노드를 생성, 삭제 또는 상태 의 변화지수 (즉, 개방 / 폐쇄 ) 의 추가 또는 제거와 같은 같은 클러스터 전체의 변화 , 그리고 노드에 파편 의 할당을 조정하는 책임이 있습니다. 이러한 변경 사항 이 발생하면 ," 클러스터 상태 는 " 마스터에 의해 업데이트 및 클러스터의 다른 모든 노드 에 게시됩니다. 그것은 새로운 클러스터 상태 를 게시 할 수 있는 유일한 노드입니다.

마스터 수행 이 경량작업 . 데이터 ( 예를 들어, 인덱싱, 검색 등 ) 를 다루는 모든 작업은 마스터 를 포함 할 필요가 없습니다. 가 아닌 데이터 노드로 마스터 를 실행하는 (즉, 마스터 와 라우터 역할을하는 노드 , 그러나 어떤 데이터를 포함하지 않음) 을 선택하면 다음 마스터는 작은 상자 에 즐겁게 실행할 수 있습니다.

노드 가 "마스터 자격 "( 모든 노드가 기본적으로 되는 ) 으로 표시된 경우주인이 될 수 있다. 현재 마스터 가 다운되면 새 마스터 는 클러스터 에 의해 선출 됩니다.

클러스터의중요한 구성 옵션은 minimum_master_nodes 입니다 . 이것은노드가클러스터의 일부가 되기 위해서는 볼 수 있어야 " 마스터 적격 " 노드 수를 지정한다. 그 목적은 , 즉 클러스터가 올바르게 작동하고 있는지 생각 둘 다 두 개의 클러스터 로 분리 하는 데 " 분할 뇌 "를 방지하는 것입니다 .

세 번째 노드가 다른 두 그것에서 분리 되었을 경우 , 마스터 자격 , 1로 minimum_master_nodes 설정 모두 3 노드 , 이 경우 예를 들어 , 그것은 여전히 ​​하나의 마스터 자격 노드를 본다 ( 자체 ) 과 생각 이 그것을 자체적으로클러스터를 형성 할 수있다.

대 신에,제 3 노드 는 분리 하는 경우 , 충분히 마스터 노드를 참조 하지 않으며 따라서 자체적으로클러스터를 형성하지 않을 것이다 그리고, 이 경우에는 ( 노드 / 2 + 1 의 수) 의 2 로 minimum_master_nodes 세트 . 원래 클러스터를 결합 하려고 노력하고 있습니다.

Elasticsearch 올바른 기본값을 선택 하는 것은 매우 어려운 시도하는 동안 당신이 실행하려는 노드 수를 알 수있는 방법이 없기 때문에 , minimum_master_nodes 는 추측하기 불가능하다. 이것은 당신이 자신을 구성해야합니다 무언가이다.


: