parseFloat("123.456").toFixed(2);
floorSet: Array.from(floorSet).sort(),

위 코드에서 정렬이 정상적으로 이루어지지 않음

function sortNumber(a, b) {
  return a - b;
}

var numArray = [140000, 104, 99];
numArray.sort(sortNumber);

console.log(numArray);
floorSet: Array.from(floorSet).sort(sortNumber),

elasticsearch가 버전업하면서. 변경되고, 좋아진점을 잘 정리해둔 글이다.


http://kimjmin.net/2019/04/2019-04-elastic-stack-7-release/

 

Elastic Stack 7.0 출시 밎 지금까지의 변경들 - Jongmin's blog

Elasticsearch, Kibana, Logstash, Beats 제품들을 개발하는 Elastic 사 에서는 이 4 제품들을 통틀어 Elastic Stack 이라고 부릅니다. 예전에 Beats가 생기기 전에는 ELK(Elsaticsearch, Logstash, Kibana) 스택으로 더 잘 알려져 있었는데 이 스토리는 https://www.elastic.co/kr/elk-stack 페이지에서 좀 더 자세히 보실 수 있습니다. Elastic Stack은

kimjmin.net


나는 <<es 7.2버전>>을 사용중이므로, 6점대에 비해서 뭐가 좋아졌는지를 살펴보았다.
* adaptive replica selection이 적용되었음 : 코디네이터 노드에서 search request를 받아 해당 샤드에게 전달할때 샤드를 선택하는 방식으로, 기존 RR방식에서 똑똑해짐.
* cross cluster search의 성능이 향상되었음
* refresh interval 설정이 디폴트 30초로 설정되어 색인성능을 높였음
* minimum master node설정 자동화 : split brain 발생 가능 없어짐.
* default primary shard  수를 5에서 1로 변경.
* open jdk가 기본 번들로 포함되어 java 따로 설치 안해도 됨.

 

es에서 노드들을 어떻게 발견할까?
discovery.seed_hosts에 array값으로 initial nodes list를 주기는 하지만
그 이후에 노드가 추가, 삭제되는 경우는 어떻게될까?

# Discovery :  discovery.seed_hosts
discovery는 cluster formation module이 클러스터를 형성하는 다른 노드들을 찾는 과정을 의미한다.
(cluster formation module이 있고 역할에 따라 나뉘는데 그 중에 하나가 discovery임.)
이 과정은 es노드를 시작할때 또는 노드에서 마스터 노드가 실패했다고 판단될때 실행되는데,
마스터 노드가 발견되거나 새로 선출될때까지 계속해서 실행된다.

이 과정은 seed hosts 리스트에 의해 시작되고,
프로세스는 두 단계로 동작하는데
* 첫째 각 노드는 연결된 노드를 식별하고, 마스터 자격이 있는지 확인하여 seed 주소를 검사함
* 둘째 성공하면 원격 노드와 알려진 master-eligible 노드 목록을 모두 공유하고 원격 노드는 피어와 차례로 응답.
그런 다음 노드는 방금 발견한 새 노드들을 검사하고, 피어를 요청하는 등의 작업을 수행.
노드가 마스터 자격이 없는 경우 선택된 마스터 노드를 감지할때까지 이 감지 프로세스가 계속됨.

결론은 새로운 노드를 추가할때에 master-eligible nodes를 포함하는 클러스터의 모든 리스트를 
discover.seed_hosts에 기입해주고, 띄우면 master-eligible nodes에서 discovery하는 듯.
원래 있던 노드의 discovery.seed_hosts까지 수정해서 재시작해줄필요 없음.

# cluster.initial_master_nodes
최초 bootstrap당시의 master-eligible-nodes 목록임.
새 노드를 기존 클러스터에 추가할때는 master-eligible nodes를 포함하여 모두 discovery.seed_hosts에만 넣어주면되고,
initial_master_nodes 셋팅 해 줄 필요없음.
대신, inital_master_nodes에 설정된 master-eligible-nodes들 중에서 과반수 이상이 살아있어야 클러스터가 정상적으로 실행됨.

* discovery에 대하여.
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-hosts-providers.html

 

Discovery | Elasticsearch Reference [7.6] | Elastic

Discovery is the process by which the cluster formation module finds other nodes with which to form a cluster. This process runs when you start an Elasticsearch node or when a node believes the master node failed and continues until the master node is foun

www.elastic.co

* cluster.initial_master_nodes에 대하여. discovery에 사용되는 여러 셋팅값들.
https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html#unicast.hosts

 

Important discovery and cluster formation settings | Elasticsearch Reference [7.6] | Elastic

Important discovery and cluster formation settingsedit There are two important discovery and cluster formation settings that should be configured before going to production so that nodes in the cluster can discover each other and elect a master node. disco

www.elastic.co

 

  • openapi-generator-github
  • openapi-generator
  • swagger-editor가 Visual Studio Code Editor에서도 사용이 가능하다.
  • MS에서 codewind OpenAPI Tools
  • Openapi-lint
  • OpenAPI Preview
  • OpenAPI (swagger) Editor
  • ..

swagger Editor 이런거 다 설치할 필요가 없다... MS에서 만든 codewind OpenAPI Tools만 설치하면 openapi generator의 docker도 받고 preview도 되고, OpenAPI Editor를 설치하면 왼쪽에 따로 창이 떠서 yaml의 코드에서 어떤 위치에 정의되어있는지 전부다 나온다. 이게 짱이네... 그리고 추가로 MS에서 제공하는 Codewind OpenAPI Tools은 YARM 2.0 -> 3.0으로, yaml의 파일을 json으로 만들어주고 server, client 코드까지 다 만들어준다. Swagger 공홈가서 받고 그런삽질 안해도 된다.ㅠㅠㅠ

+ Recent posts