2020
07/02
16:01
你的地图定位我的位置:msn.com > 操作系统 > centos7下的docker安装ES集群e家

centos7下的docker安装ES集群e家

颁发光阴:2020-07-02 16:01:19

原励志文章标题大全:centos7下的docker安装ES集群e家

1>拉取镜像

docker pull elasticsearch:7.6.2

2>创建金十数据挂在目录,以及部署ElasticSearch集群e家部署文件

mkdir /docker/ES

mkdir /docker/ES/data1

mkdir /docker/ES/data2

mkdir /docker/ES/data3

mkdir /docker/ES/config

在config办公用品文件夹价格下创建部署文件

touch es1.yml es2.yml es3.yml

编辑es1.yml文件

vi es1.yml

cluster.name: hzmt-es-cluster
node.name: es-node1
network.bind_host: 0.0.0.0
network.publish_host: 192.168.10.122
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 2
discovery.seed_hosts: ["192.168.10.122:9300","192.168.10.122:9301","192.168.10.122:9302"]
cluster.initial_master_nodes: ["es-node1","es-node2","es-node3"]

vi es2.yml

cluster.name: hzmt-es-cluster
node.name: es-node1
network.bind_host: 0.0.0.0
network.publish_host: 192.168.10.122
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true 
discovery.zen.minimum_master_nodes: 2
discovery.seed_hosts: ["192.168.10.122:9300","192.168.10.122:9301","192.168.10.122:9302"]
cluster.initial_master_nodes: ["es-node1","es-node2","es-node3"]

vi es3.yml

cluster.name: hzmt-es-cluster
node.name: es-node1
network.bind_host: 0.0.0.0
network.publish_host: 192.168.10.122
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true 
discovery.zen.minimum_master_nodes: 2
discovery.seed_hosts: ["192.168.10.122:9300","192.168.10.122:9301","192.168.10.122:9302"]
cluster.initial_master_nodes: ["es-node1","es-node2","es-node3"]

添加防火墙:

firewall-cmd --add-port=9300/tcp

firewall-cmd --add-port=9301/tcp

firewall-cmd --add-port=9302/tcp

改变创建的办公用品文件夹价格管理员权限怎么获得:

chmod 777 data1 data2 data3

3>启动ElasticSearch集群e家容器

docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 -v /docker/ES/config/es1.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /docker/ES/data1:/usr/share/elasticsearch/data --name ES01 elasticsearch:7.6.2

docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9201:9201 -p 9301:9301 -v /docker/ES/config/es2.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /docker/ES/data2:/usr/share/elasticsearch/data --name ES02 elasticsearch:7.6.2

docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9202:9202 -p 9302:9302 -v /docker/ES/config/es3.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v /docker/ES/data3:/usr/share/elasticsearch/data --name ES03 elasticsearch:7.6.2

 

4>验证es是否启动成功

curl 127.0.0.1:9200

可能性在你避雷器输入  src='/images/loading.gif' data-original="https://img2020.cnblogs.com/blog/1752043/202007/1752043-20200702153238715-1969520357.png" loading="lazy">

 

 

 

5>验证集群e家健康状态

curl ‘127.0.0.1:9200/_cat/health?pretty=true‘

可能性在避雷器输入 docker pull mobz/elasticsearch-head:5

启动容器 docker run -d -p 9100:9100 --name es-manager mobz/elasticsearch-head:5

避雷器访 src='/images/loading.gif' data-original="https://img2020.cnblogs.com/blog/1752043/202007/1752043-20200702153350080-1450024584.png" loading="lazy">

 

(如果是阿里云孵卵器,牢记在平安组中加端口策论开花相应的端口号)

 

光阴似箭,当看到比你优秀的人比你还勤于的自考成绩啥时候出来,你也会越是优秀。相信越勤于越吉人天相!

 

原励志文章标题大全:centos7下的docker安装ES集群e家

基本词:Centos

渡人请保留本文网址: http://www.www.d5897.com/a/462571.html
*破例声明:以上始末来自于网络编采,著作权属原作者全部,如有侵权,请具结我们: admin#www.d5897.com (#包换@)。
Baidu