'node'에 해당되는 글 10건

  1. 2020.04.02 [Elasticsearch] Docker Compose 구성 하기
  2. 2020.03.27 [Elasticsearch] Single node 실행
  3. 2019.10.17 [Elasticsearch] minimum_master_nodes is not working.
  4. 2019.08.28 [Elasticsearch] Node Topology 7.x
  5. 2016.03.31 [Node.js] Node.js + Express + EJS + PM2 초간단 구성하기 on OSX
  6. 2015.12.11 [Elasticsearch] Merge Throttle 설정 튜닝
  7. 2015.12.09 [Elasticsearch] Tribe Node
  8. 2015.11.24 [Elasticsearch - The Definitive Guide] An Empty Cluster
  9. 2014.01.14 [elasticsearch] node master/data ....
  10. 2007.12.06 XML DOM Node Types

[Elasticsearch] Docker Compose 구성 하기

Elastic/Elasticsearch 2020. 4. 2. 07:49

Elasticsearch 를 Single Node 로 구성 하기 위한 docker-compose.yml 내용을 살펴 봅니다.

 

참고문서)

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

 

docker-compose.yml)

version: '2.2'
services:
  ${ES-SERVICE-NAME}:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
    container_name: ${ES-SERVICE-NAME}
    environment:
      - node.name=${NODE-NAME}
      - cluster.name=${CLUSTER-NAME}
      - discovery.type=single-node
      - discovery.seed_hosts=${NODE-NAME}
      - path.data=/usr/share/elasticsearch/data
      - path.logs=/usr/share/elasticsearch/logs
      - bootstrap.memory_lock=true
      - http.port=9200
      - transport.port=9300
      - transport.compress=true
      - network.host=0.0.0.0
      - http.cors.enabled=false
      - http.cors.allow-origin=/https?:\/\/localhost(:[0-9]+)?/
      - gateway.expected_master_nodes=1
      - gateway.expected_data_nodes=1
      - gateway.recover_after_master_nodes=1
      - gateway.recover_after_data_nodes=1
      - action.auto_create_index=true
      - action.destructive_requires_name=true
      - cluster.routing.use_adaptive_replica_selection=true
      - xpack.monitoring.enabled=false
      - xpack.ml.enabled=false
      - http.compression=true
      - http.compression_level=3
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nproc:
        soft: 1024000
        hard: 1024000
      nofile:
        soft: 1024000
        hard: 1024000
    sysctls:
      net.core.somaxconn: 65000
    healthcheck:
      test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cat/health || exit 1"]
      interval: 30s
      timeout: 30s
      retries: 3
    restart: always
    volumes:
      - ${NAMED-VOLUME-DATA}:/usr/share/elasticsearch/data:rw
      - ${NAMED-VOLUME-LOG}:/usr/share/elasticsearch/logs:rw
#      - ${FULL-PATH-DATA}:/usr/share/elasticsearch/data:rw
#      - ${FULL-PATH-LOG}:/usr/share/elasticsearch/logs:rw
    ports:
      - 9200:9200
      - 9300:9300
    expose:
      - 9200
      - 9300
    networks:
      - ${NETWORK-NAME}

volumes:
  ${NAMED-VOLUME-DATA}:
    driver: local
  ${NAMED-VOLUME-LOG}:
    driver: local

networks:
  ${NETWORK-NAME}:
    driver: bridge

 

Single Node 로 구성 하기 위해 중요한 설정은

- environment: 섹션에서 discovery.type=single-node 

입니다.

 

만약, Clustering 구성을 하고 싶다면 위 설정을 제거 하고 아래 세개 설정을 작성 하시면 됩니다.

- cluster.initial_master_nodes=# node 들의 private ip 를 등록 합니다.
- discovery.seed_hosts=# node 들의 private ip 를 등록 합니다.

- network.publish_host=# 컨테이너가 떠 있는 host 의 private ip 를 등록 합니다.

 

path.data 에 대한 구성을 복수로 하고 싶으실 경우

- volumes: 섹션에서 named volume 을 여러개 설정 하시거나

- bind mount 설정을 구성 하셔서 

적용 하시면 됩니다.

 

위 docker-compose.yml 을 기준으로 single node 구성과 cluster 구성을 모두 하실 수 있습니다.

 

  • ${....} 는 변수명 입니다.
    • 본인의 환경에 맞춰 작명(?) 하셔서 변경 하시면 됩니다.
:

[Elasticsearch] Single node 실행

Elastic/Elasticsearch 2020. 3. 27. 16:05

Elasticsearch 버전이 올라 가면서 master node 를 최소 쿼럼 구성으로 해야 하는데요.

아마 잘 아시겠지만 Single node 구성을 원하시는 분은 아래 설정을 통해서 실행 하시면 됩니다.

 

[Single node 설정]

discovery.type=single-node

 

이 설정은 아래 설정이 포함되어 있을 경우 충돌이 납니다.

cluster.initial_master_nodes

 

본 설정을 주석 처리 하거나 삭제 하신 후 실행 시키면 정상 동작 합니다.

 

Elastic 공식 문서에 자세한 설명이 나와 있으니 참고 하시면 좋습니다.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-settings.html#modules-discovery-settings

:

[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

 

:

[Elasticsearch] Node Topology 7.x

Elastic/Elasticsearch 2019. 8. 28. 10:54

사용성에서 정확한 정의가 없어서 많이들 헷갈려 하셨던 Node 가 정리가 된 것 같아 기록해 봅니다.

 

원문 링크)

https://www.elastic.co/guide/en/elasticsearch/reference/7.3/modules-node.html

 

Master Eligible Node

- node.master

마스터 노드는 전용으로 구성 하는 것을 추천 하며, 최소한의 작업을 수행 하도록 하는 것이 좋습니다.

 

Data Node

- node.data

CPU-, Memory-, I/O 성능 영향을 많이 받기 때문에 좋은 장비로 구성 하시길 추천 드립니다.

또한 Network 사용량에 대한 고려도 해야 합니다.

 

Ingest Node

- node.ingest

 

Machine Learning Node (x-pack)

- node.ml

 

Coordinating Node

node.master: false

node.data: false

node.ingest: false

node.ml: false

이 노드의 수를 너무 많이 늘리지 않도록 주의 하는게 좋습니다.

이유는 마스터 노드가 선출 되었을 때 모든 노드의 승인을 기다리게 되어 오히려 성능적으로 손해를 볼 수도 있습니다.

 

Voting Only Node (x-pack)

- node.voting_only

:

[Node.js] Node.js + Express + EJS + PM2 초간단 구성하기 on OSX

ITWeb/개발일반 2016. 3. 31. 11:23

imac osx에 node.js 를 이용한 웹서비스 구성 테스트 입니다.

기존에 잘 작성된 문서들이 많아서 그냥 참고해서 그대로 따라해 보았습니다.

다만, 구성 하면서 springmvc 와 비교를 해보면서 전통적인 웹 개발 방법보다 어떤 장점을 갖는지 이해하고자 하였습니다.


  • Node.js
  • Express
    • 설치 참고 사이트
    • global 로 설치 해야 하는 경우와 그렇지 않은 경우로 나눠서 설치 하며 기준을 명시 해 두어야 합니다.
    • 설치 (전역 모듈로 설치 합니다.)
      • $ npm install express
      • $ npm install -g express
    • path 설정

      #!/bin/bash
       
       
      if [ -f ~/.bashrc ]; then
        source ~/.bashrc
      fi
       
      JAVA_HOME=`/usr/libexec/java_home`
      MAVEN_HOME=/Users/jeonghoug/Dev/apps/maven
      MYSQL_HOME=/usr/local/mysql
      NODE_PATH=/usr/local/lib/node_modules
      PATH=$NODE_PATH:$NODE_PATH/npm/bin:$JAVA_HOME/bin:$MAVEN_HOME/bin:
      $MYSQL_HOME/bin:$PATH
       
      export PATH
      export NODE_PATH
      export JAVA_HOME
      export MAVEN_HOME
      export MYSQL_HOME
    • 설치된 경로

      # global 옵션을 주지 않고 설치하게 되면 아래와 같이 해당 계정 아래 생성 됩니다.
      $ pwd
      /Users/jeonghoug/node_modules/express
    • 로컬 설치된 express 삭제 하고 global 로 설치 합니다.

      $ npm uninstall express
      $ sudo npm install -g express
    • express 를 이용한 HelloWebServer 테스트
      • $ mkdir HelloWebServer; cd HelloWebServer; vi app.js
      • 참조 샘플 : http://pyrasis.com/nodejs/nodejs-HOWTO

        var express = require('express')
          , http = require('http')
          , app = express()
          , server = http.createServer(app);
         
        app.get('/', function (req, res) {
          res.send('Hello /');
        });
         
        app.get('/world.html', function (req, res) {
          res.send('Hello World');
        });
         
        server.listen(8000, function() {
          console.log('Express server listening on port '
             + server.address().port);
        });
      • global 옵션 설치 후 실행

        $ node app.js
        module.js:327
            throw err;
            ^
        Error: Cannot find module 'express'
            at Function.Module._resolveFilename (module.js:325:15)
            at Function.Module._load (module.js:276:25)
            at Module.require (module.js:353:17)
            at require (internal/module.js:12:17)
            at Object.<anonymous> (/Dev/workspace/HelloWebServer/app.js:1:77)
            at Module._compile (module.js:409:26)
            at Object.Module._extensions..js (module.js:416:10)
            at Module.load (module.js:343:32)
            at Function.Module._load (module.js:300:12)
            at Function.Module.runMain (module.js:441:10)

         

        • 위와 같이 에러가 발생 하며, 이유는 -g 옵션으로 설치된 경로는 /usr/local/lib/node_modules/express 로 설치가 되지만, 소스코드 상에 require('express') 에서는 상대 경로 찾기 때문에 모듈을 찾지 못하는 오류가 발생 합니다.
        • require('express') 를 require('/usr/local/lib/node_modules/express') 로 변경 후 실행 하면 정상 동작 합니다.
        • 또는 $ npm install express 로 local 설치 하고 실행 하면 정상 동작 합니다.
    • global 옵션으로 설치한 모듈에 대해서 'cannot find module' 에러 발생 시 해결 방법
      • 기본적으로 node 에서 사용하는 환경 변수 설정 중 path 설정이 안되어 있어 발생 하게 됩니다.

        #!/bin/bash
         
         
        if [ -f ~/.bashrc ]; then
          source ~/.bashrc
        fi
         
        JAVA_HOME=`/usr/libexec/java_home`
        MAVEN_HOME=/Users/jeonghoug/Dev/apps/maven
        MYSQL_HOME=/usr/local/mysql
        NODE_PATH=/usr/local/lib/node_modules
        PATH=$NODE_PATH:$NODE_PATH/npm/bin:$JAVA_HOME/bin:$MAVEN_HOME/bin:$MYSQL_HOME/bin:$PATH
         
         
        export PATH
        export NODE_PATH
        export JAVA_HOME
        export MAVEN_HOME
        export MYSQL_HOME
      • 위와 같이 NODE_PATH 환경 변수 설정을 해주게 되면 관련 에러가 발생 하지 않게 되며 global 모듈을 사용할 수 있게 됩니다.

      • 위와 같이 path 설정 후 발생하는 문제 점

        $ npm install
        module.js:327
            throw err;
            ^
        Error: Cannot find module '/usr/local/lib/node_modules/npm/bin/
        node_modules/npm/bin/npm-cli.js'
            at Function.Module._resolveFilename (module.js:325:15)
            at Function.Module._load (module.js:276:25)
            at Function.Module.runMain (module.js:441:10)
            at startup (node.js:139:18)
            at node.js:968:3

         

        • 위에서 보는 것과 같이 NODE_PATH 설정 후 npm install을 하게 되면 npm 의 기본 경로가 중복으로 설정되어 동작하는 문제가 있어 아래와 같이 수정 합니다.

          #!/bin/bash
           
           
          if [ -f ~/.bashrc ]; then
            source ~/.bashrc
          fi
           
          JAVA_HOME=`/usr/libexec/java_home`
          MAVEN_HOME=/Users/jeonghoug/Dev/apps/maven
          MYSQL_HOME=/usr/local/mysql
          NODE_PATH=/usr/local/lib/node_modules
          PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$MYSQL_HOME/bin:$PATH
           
          export PATH
          export NODE_PATH
          export JAVA_HOME
          export MAVEN_HOME
          export MYSQL_HOME
  • Express Generator
    • EJS 템플릿
    • 설치하기
      • $ sudo npm install -g express-generator
    • 샘플코드 참고 사이트
    • ejs 템플릿 생성하기

      $ express --ejs
         create : .
         create : ./package.json
         create : ./app.js
         create : ./public
         create : ./public/images
         create : ./public/stylesheets
         create : ./public/stylesheets/style.css
         create : ./routes
         create : ./routes/index.js
         create : ./routes/users.js
         create : ./views
         create : ./views/index.ejs
         create : ./views/error.ejs
         create : ./bin
         create : ./bin/www
         install dependencies:
           $ cd . && npm install
         run the app:
           $ DEBUG=ExampleEJS:* npm start
         create : ./public/javascripts
    • package.json
      • 본 서비스에서 사용 또는 설치 되어야 할 모듈을 모두 정의해 둡니다.
        • maven 으로 비교 하면 dependency 기능과 비슷합니다.
      • 정의가 끝나면 $ npm install 을 통해 설치를 합니다.
    • app.js
      • 본 서비스 또는 어플리케이션에 대한 global 설정을 하게 됩니다.
      • 여기서 URI 등록 작업이 이루어 지며, SpringMVC 에서 @Controller 내 @RequestMapping 과 같은 기능을 처리 합니다.
      • routes 를 등록하여 사용이 가능 하며, routes/*.js 에서 MVC 구성을 하면 됩니다.
    • bin/www
      • http server를 생성 하며 설정 정보를 기록 합니다.
    • views/*.ejs
      • jsp 나 jstl 과 같은 역할을 하는 view 파일들이 위치 합니다.
      • 실시간 수정이 가능 합니다.
    • routes/*.js
      • spring mvc 에서 controller, bo, dao 와 같은 역할의 파일들이 위치 합니다.
      • 수정 내용 반영을 위해서는 재시작을 해야 합니다.
    • public/*
      • static file 들이 위치 합니다.
    • ExampleEJS

      // views/index.ejs
      <!DOCTYPE html>
      <html>
        <head>
          <title><%= title %></title>
          <link rel='stylesheet' href='/stylesheets/style.css' />
        </head>
        <body>
          <h1><%= title %></h1>
          <% for (var i = 0; i < 5; i++) { %>
          <p>Welcome to <%= title %></p>
          <% } %>
        </body>
      </html>
       
      // routes/index.js
      var express = require('express');
      var router = express.Router();
       
      /* GET home page. */
      router.get('/', function(req, res) {
        res.render('index', { title: 'Express' });
      });
       
      module.exports = router;
  • PM2
    • 참조사이트
    • 설치
      • $ sudo npm install -g pm2
    • 실행
      • 기존에 $ node app.js 로 실행을 했다면, $ pm2 start app.js 로 실행이 가능 합니다.


:

[Elasticsearch] Merge Throttle 설정 튜닝

Elastic/Elasticsearch 2015. 12. 11. 15:56

bulk indexing 을 하다 보면 색인 하는 과정에서 느려지는 현상을 경험 할 수 있습니다.

여러가지 원인이 있을 수 있지만 간단하게 설정을 통해서 성능 향상을 시킬수 있는 방법을 소개해 드립니다.


기본적인 정보는 이미 Elasticsearch Reference 에서 제공하고 있기 때문에 관련 내용을 찾아 보시면 이해 하시는데 도움이 됩니다.


참고문서)


Elasticsearch 역시 lucene 기반의 검색 엔진이기 때문에 과거부터 전해져 오는 segment merge 시 발생 하는 성능 저하 문제는 피해 갈 수가 없습니다.

이를 좀 더 효율적으로 사용하기 위해 아래 설정을 활용 하시면 됩니다.


Merge throttle 은 두 가지 방법을 제공해 주고 있습니다.


1. Node level throttle

이것은 merge 동작은 shard 단위로 발생을 하기 때문에 같은 node 에 있는 shard 들은 동일한 자원을 사용하게 됩니다.

즉, disk i/o 에 대한 경합을 할 수 밖에 없는 것인데요.

이런 이유로 node level 설정을 사용하게 됩니다.


indices.store.throttle.type: “merge” ## all, none

indices.store.throttle.max_bytes_per_sec: “20mb"


 여기서 수정이 필요한 부분은 색인 데이터의 크기를 감안해서 max_bytes_per_sec 을 적합한 크기로 설정해 주시면 됩니다.


2. Index level throttle

특정 index 에 대해서 관리를 하고 싶을 때 node level throttle 설정을 무시 하고 설정을 하도록 해주는 것입니다.

설정 방법은 index update settings 를 통해서 할 수 있습니다.


index.store.throttle.type: “node"

index.store.throttle.max_bytes_per_sec: “20mb"


 여기서 수정이 필요한 부분은 색인 데이터의 크기를 감안해서 max_bytes_per_sec 을 적합한 크기로 설정해 주시면 됩니다.

 throttle type을 none 으로 할 경우  disable merge 설정이 됩니다.

:

[Elasticsearch] Tribe Node

Elastic/Elasticsearch 2015. 12. 9. 12:05

tribe node는 서로 다른 cluster로 구성된 elasticsearch의 데이터에 대해서 질의 또는 색인이 가능 하도록 제공하는 기능 입니다.

RDBMS의 view 와 비슷한 개념이라고 생각 하시면 쉽습니다.


참고문서)

https://www.elastic.co/guide/en/elasticsearch/reference/2.1/modules-tribe.html

https://www.elastic.co/blog/clustering_across_multiple_data_centers

https://www.elastic.co/blog/tribe-node


이제 부터 간단하게 구성하는 방법을 살펴 보겠습니다.

elasticsearch 다운로드와 설치 과정은 아래 링크 참고하세요.

- https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html


1. 노드구성

위에서 이야기 한 것과 같이 서로 다른 Cluster라고 했습니다.

그렇기 때문에 standalone 구성의 cluster 두 개를 준비 하겠습니다.

더불어 tribe node 도 하나 구성을 합니다.

- 총 3개의 노드


2. 노드설정

- Cluster 1

[elasticsearch.yml]

cluster.name: t1-cluster

node.name: t1-node

http.port: 9201

transport.tcp.port: 9301

index.number_of_shards: 1

index.number_of_replicas: 0


- Cluster 2

[elasticsearch.yml]

cluster.name: t2-cluster

node.name: t2-node

http.port: 9202

transport.tcp.port: 9302

index.number_of_shards: 1

index.number_of_replicas: 0


- Tribe Node(cluster)

[elasticsearch.yml]

tribe.t1.cluster.name: "t1-cluster"

tribe.t1.discovery.zen.ping.multicast.enabled: false

tribe.t1.discovery.zen.ping.unicast.hosts: ["localhost:9301"]

tribe.t2.cluster.name: "t2-cluster"

tribe.t2.discovery.zen.ping.multicast.enabled: false

tribe.t2.discovery.zen.ping.unicast.hosts: ["localhost:9302"]

tribe.blocks.write: true

tribe.blocks.metadata: true

cluster.name: "tribe-cluster"

node.name: "tribe-node"

http.port: 9200


3. 클러스터실행

생성한 3개의 클러스터를 실행 합니다.


4. Cluste 1과 Cluster 2에 Index 생성 및 색인

그냥 구성 샘플이라 문서 하나씩만 색인 하겠습니다.


Cluster 1)

- sample1.json

{"index":{"_index":"db", "_type":"tbl"}}

{"number":"1","name":"MALICE MIZER","url":"http://www.last.fm/music/MALICE+MIZER","picture":"http://userserve-ak.last.fm/serve/252/10808.jpg","@timestamp":"2000-10-06T19:20:25.000Z"}


$ curl -XPOST http://localhost:9201/db/tbl/_bulk --data-binary @sample1.json


Cluster 2)

- sample2.json

{"index":{"_index":"db2", "_type":"tbl"}}

{"number":"2","name":"Diary of Dreams","url":"http://www.last.fm/music/Diary+of+Dreams","picture":"http://userserve-ak.last.fm/serve/252/3052066.jpg","@timestamp":"2001-10-06T19:20:25.000Z"}


$ curl -XPOST http://localhost:9202/db2/tbl/_bulk --data-binary @sample2.json


5. Tribe Node(Cluster)를 이용한 질의

질의) Cluster 1

$ curl -XGET "http://localhost:9200/db/_search" -d'

{

    "query": {

        "match_all": {}

    }

}'


결과)

{

   "took": 24,

   "timed_out": false,

   "_shards": {

      "total": 1,

      "successful": 1,

      "failed": 0

   },

   "hits": {

      "total": 1,

      "max_score": 1,

      "hits": [

         {

            "_index": "db",

            "_type": "tbl",

            "_id": "AVFhPAntBw75btupmZWX",

            "_score": 1,

            "_source": {

               "number": "1",

               "name": "MALICE MIZER",

               "url": "http://www.last.fm/music/MALICE+MIZER",

               "picture": "http://userserve-ak.last.fm/serve/252/10808.jpg",

               "@timestamp": "2000-10-06T19:20:25.000Z"

            }

         }

      ]

   }

}


질의) Cluster 2

curl -XGET "http://localhost:9200/db2/_search" -d'

{

    "query": {

        "match_all": {}

    }

}'


결과)

{

   "took": 16,

   "timed_out": false,

   "_shards": {

      "total": 1,

      "successful": 1,

      "failed": 0

   },

   "hits": {

      "total": 1,

      "max_score": 1,

      "hits": [

         {

            "_index": "db2",

            "_type": "tbl",

            "_id": "AVFha2Vz4YXacqLkqH0V",

            "_score": 1,

            "_source": {

               "number": "2",

               "name": "Diary of Dreams",

               "url": "http://www.last.fm/music/Diary+of+Dreams",

               "picture": "http://userserve-ak.last.fm/serve/252/3052066.jpg",

               "@timestamp": "2001-10-06T19:20:25.000Z"

            }

         }

      ]

   }

}


View 질의) Tribe Node(Cluster)

$ curl -XGET "http://localhost:9200/_search" -d'

{

    "query": {

        "match_all": {}

    }

}'


결과)

{

   "took": 12,

   "timed_out": false,

   "_shards": {

      "total": 2,

      "successful": 2,

      "failed": 0

   },

   "hits": {

      "total": 2,

      "max_score": 1,

      "hits": [

         {

            "_index": "db",

            "_type": "tbl",

            "_id": "AVFhPAntBw75btupmZWX",

            "_score": 1,

            "_source": {

               "number": "1",

               "name": "MALICE MIZER",

               "url": "http://www.last.fm/music/MALICE+MIZER",

               "picture": "http://userserve-ak.last.fm/serve/252/10808.jpg",

               "@timestamp": "2000-10-06T19:20:25.000Z"

            }

         },

         {

            "_index": "db2",

            "_type": "tbl",

            "_id": "AVFha2Vz4YXacqLkqH0V",

            "_score": 1,

            "_source": {

               "number": "2",

               "name": "Diary of Dreams",

               "url": "http://www.last.fm/music/Diary+of+Dreams",

               "picture": "http://userserve-ak.last.fm/serve/252/3052066.jpg",

               "@timestamp": "2001-10-06T19:20:25.000Z"

            }

         }

      ]

   }

}


※ 부가적으로 alias 기능과 함께 활용하시면 아주 유용하게 사용하실 수 있습니다.

:

[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.


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

인덱스 생성/삭제

노드 추가/제거


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

문서 레벨의 변경 작업

검색


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

(장애 납니다. ^^;)

:

[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 는 추측하기 불가능하다. 이것은 당신이 자신을 구성해야합니다 무언가이다.


:

XML DOM Node Types

ITWeb/개발일반 2007. 12. 6. 14:41
dynamic 하게 dom 객체를 생성하거나 해서 삽입하고 할때 알고 있어야 하는 코드들이라서 올려 봅니다.
뭐 저 한테 필요한 거라 이곳에 기록해 두기는 하는 거지만 DOM 을 공부 하시는 분들은 필요한 정보 같아 공유해 봅니다.

ref. http://www.w3schools.com/dom/dom_nodetype.asp

Node Types

The following table lists the different W3C node types, and which node types they may have as children:

Node type Description Children
Document Represents the entire document (the root-node of the DOM tree) Element (max. one), ProcessingInstruction, Comment, DocumentType
DocumentFragment Represents a "lightweight" Document object, which can hold a portion of a document Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
DocumentType Provides an interface to the entities defined for the document None
ProcessingInstruction Represents a processing instruction None
EntityReference Represents an entity reference Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
Element Represents an element Element, Text, Comment, ProcessingInstruction, CDATASection, EntityReference
Attr Represents an attribute Text, EntityReference
Text Represents textual content in an element or attribute None
CDATASection Represents a CDATA section in a document (text that will NOT be parsed by a parser) None
Comment Represents a comment None
Entity Represents an entity Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference
Notation Represents a notation declared in the DTD None


Node Types - Return Values

The following table lists what the nodeName and the nodeValue properties will return for each node type:

Node type nodeName returns nodeValue returns
Document #document null
DocumentFragment #document fragment null
DocumentType doctype name null
EntityReference entity reference name null
Element element name null
Attr attribute name attribute value
ProcessingInstruction target content of node
Comment #comment comment text
Text #text content of node
CDATASection #cdata-section content of node
Entity entity name null
Notation notation name null


NodeTypes - Named Constants

NodeType Named Constant
1 ELEMENT_NODE
2 ATTRIBUTE_NODE
3 TEXT_NODE
4 CDATA_SECTION_NODE
5 ENTITY_REFERENCE_NODE
6 ENTITY_NODE
7 PROCESSING_INSTRUCTION_NODE
8 COMMENT_NODE
9 DOCUMENT_NODE
10 DOCUMENT_TYPE_NODE
11 DOCUMENT_FRAGMENT_NODE
12 NOTATION_NODE

: