为elasticsearch创建集群

复制当前elasticsearch文件夹,拷贝两份,分别叫es_slave1 及 es_slave2 

 

主节点:

 vi /usr/local/elasticsearch/config/elasticsearch.yml
network.host: 39.107.36.209

bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: /.*/ cluster.name: wali node.name: master node.master: true

path.data: /data/master/data
启动 :sh /usr/local/elasticsearch/bin/elasticsearch -d

 

 

 

第一个节点:

vi /usr/local/es_slave1/config/elasticsearch.yml
 network.host: 39.107.36.209 
 bootstrap.system_call_filter: false
http.cors.enabled: true http.cors.allow-origin: /.*/ cluster.name: wali node.name: slave1 http.port: 8200 discovery.zen.ping.unicast.hosts: ["39.107.36.209"] path.data: /data/es_slave1/data
启动第一个节点: sh /usr/local/es_slave1/bin/elasticsearch -d





第二个节点:
vi /usr/local/es_slave2/config/elasticsearch.yml

network.host: 39.107.36.209

bootstrap.system_call_filter: false http.cors.enabled: true http.cors.allow-origin: /.*/ cluster.name: wali node.name: slave2 http.port: 8300 discovery.zen.ping.unicast.hosts: ["39.107.36.209"] path.data: /data/es_slave2/data

 



启动第二个节点:
sh /usr/local/es_slave2/bin/elasticsearch -d

bootstrap.system_call_filter: false

posted on 2018-06-05 00:35  ziyi_ang  阅读(103)  评论(0编辑  收藏  举报

导航