** 엘라스틱을 사용하기 위해 memlock과 nofile을 변경해야 함
** 참고 : Default ulimit(memlock & nofile) settings (for Elasticsearch)
** 아래 내용은 docker swarm을 기반으로 함
Virtual memory areas 늘리기
$ sudo /etc/sysctl.confi
===== sysctl.conf =====
...
vm.max_map_count=262144
...
==========================
$ sudo reboot now
Master node
$ sudo docker service \
create \
--constraint node.role==manager \
--reserve-cpu 2 \
--reserve-memory 2g \
--limit-cpu 2 \
--limit-memory 2g \
--network net \
--hostname es-master \
--replicas 1 \
--mount type=bind,src=/etc/localtime,dst=/etc/localtime,readonly \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
--env "cluster.name=es_cluster" \
--env "node.name=es-master" \
--env "node.master=true" \
--env "node.data=false" \
--env "path.data=/usr/share/elasticsearch/data" \
--env "path.logs=/usr/share/elasticsearch/logs" \
--env "bootstrap.memory_lock=true" \
--env "network.host=es-master" \
--env "http.port=9200" \
--env "http.cors.enabled=true" \
--env "http.cors.allow-origin=*" \
--env "transport.tcp.port=9300" \
--env "discovery.zen.minimum_master_nodes=1" \
--env "cluster.routing.allocation.disk.threshold_enabled=true" \
--env "cluster.routing.allocation.disk.watermark.low=1000mb" \
--env "cluster.routing.allocation.disk.watermark.high=500mb" \
--env "xpack.ml.enabled=false" \
--env "xpack.monitoring.enabled=true" \
--env "xpack.security.enabled=false" \
--env "xpack.security.audit.enabled=false" \
--env "xpack.watcher.enabled=false" \
--name es-master \
docker.elastic.co/elasticsearch/elasticsearch:5.5.3
Data node
** {number}에 따라 data node를 여러개 만들 수 있음
$ sudo docker service \
create \
--reserve-cpu 2 \
--reserve-memory 2g \
--limit-cpu 2 \
--limit-memory 2g \
--network net \
--hostname es-data-{number} \
--replicas 1 \
--mount type=bind,src=/etc/localtime,dst=/etc/localtime,readonly \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
--env "cluster.name=es_cluster" \
--env "node.name=es-data-{number}" \
--env "node.master=false" \
--env "node.data=true" \
--env "path.data=/usr/share/elasticsearch/data" \
--env "path.logs=/usr/share/elasticsearch/logs" \
--env "bootstrap.memory_lock=true" \
--env "network.host=es-data-{number}" \
--env "transport.tcp.port=9300" \
--env "discovery.zen.ping.unicast.hosts=es-master" \
--env "discovery.zen.minimum_master_nodes=1" \
--env "cluster.routing.allocation.disk.threshold_enabled=true" \
--env "cluster.routing.allocation.disk.watermark.low=1000mb" \
--env "cluster.routing.allocation.disk.watermark.high=500mb" \
--env "xpack.ml.enabled=false" \
--env "xpack.monitoring.enabled=true" \
--env "xpack.security.enabled=false" \
--env "xpack.security.audit.enabled=false" \
--env "xpack.watcher.enabled=false" \
--name es-data-{number} \
docker.elastic.co/elasticsearch/elasticsearch:5.5.3
댓글 없음:
댓글 쓰기
참고: 블로그의 회원만 댓글을 작성할 수 있습니다.