Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build elastatic Cluster in docker

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces how to build an elastatic cluster in docker, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.

Cd / roottouch node1/config/elasticsearch.ymltouch node2/config/elasticsearch.ymlchmod 775 / root/node1/config/elasticsearch.ymlchmod 775 / root/node2/config/elasticsearch.yml

/ root/node1/config/elasticsearch.yml is configured as follows:

Http.host: 0.0.0.0cluster.name: elastic-ckynode.name: es1node.master: truenode.data: truebootstrap.system_call_filter: falsetransport.host: 0.0.0.0discovery.zen.minimum_master_nodes: 1http.cors.enabled: truehttp.cors.allow-origin: "*"

/ root/node2/config/elasticsearch.yml is configured as follows:

Http.host: 0.0.0.0cluster.name: elastic-ckynode.name: es2node.master: truenode.data: truebootstrap.system_call_filter: falsetransport.host: 0.0.0.0discovery.zen.minimum_master_nodes: 1discovery.zen.ping.unicast.hosts: ["es1:9300"] http.cors.enabled: truehttp.cors.allow-origin: "*"

Description:

Cross-domain request http.cors.enabled: true http.cors.allow-origin: "*"

Start as follows:

Cd / rootdocker run-- name es1-p 9201 PWD/node1/config/elasticsearch.yml 9200-p 9301 PWD/node1/config/elasticsearch.yml 9300-v "$PWD/node1/config/elasticsearch.yml": / usr/share/elasticsearch/config/elasticsearch.yml-- ulimit nofile=65536:131072-e "ES_JAVA_OPTS=-Xms512m-Xmx512m"-d elasticsearch docker run-- name es2-p 9202name es1 9200-p 9302name es1 9300-v "$PWD/node2/config/elasticsearch.yml": / usr/share/elasticsearch/config/elasticsearch.yml-- ulimit nofile=65536:131072-- link es1 : es1-e "ES_JAVA_OPTS=-Xms512m-Xmx512m"-d elasticsearch

Check whether it is successful

Docker exec-it es2 / bin/bashcurl http://localhost:9200/_cat/health

Effect:

Root@1256b78663ef:/usr/share/elasticsearch# curl http://localhost:9200/_cat/health 1563959266 09:07:46 elastic-cky green 1 100 000-100.0%

Plug-in elasticsearch-head browser access

Docker run-d-name es-head-p 9100V 9100 mobz/elasticsearch-head:5

Browser access: xxx:9100

On how to build an elastatic cluster in docker to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report