單機(jī)多節(jié)點(diǎn),集群?jiǎn)栴}
來(lái)來(lái)回回看來(lái)很多遍本地集群的搭建,單個(gè)節(jié)點(diǎn)都已經(jīng)啟動(dòng),并且訪問(wèn)192.168.7.223:9200或者8200都沒(méi)問(wèn)題.但是http://192.168.7.223:8200/_cat/nodes?v的話(huà)就只有一個(gè)節(jié)點(diǎn),老師是哪里還有配置沒(méi)有提到嗎
cluster.name: myDemo
node.name: myDemo_node-1
path.data: /usr/local/elasticsearch-6.3.2/path/to/data
path.logs: /usr/local/elasticsearch-6.3.2/path/to/logs
network.host: 192.168.7.223
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
啟動(dòng)命令,bin目錄下
主:./elasticsearch
第二:./elasticsearch -Ehttp.port=8200 -Epath.data=node2
第三:./elasticsearch -Ehttp.port=7200 -Epath.data=node3
http://192.168.7.223:9200/_cat/nodes?v
ip????????????heap.percent?ram.percent?cpu?load_1m?load_5m?load_15m?node.role?master?name 192.168.7.223???????????35??????????29???0????0.00????0.01?????0.05?mdi???????*??????myDemo_node-1
http://192.168.7.223:8200/_cat/nodes?v
ip????????????heap.percent?ram.percent?cpu?load_1m?load_5m?load_15m?node.role?master?name 192.168.7.223???????????18??????????29???0????0.00????0.01?????0.05
nodes2和nodes3的目錄在bin目錄下面,位置/usr/local/elasticsearch-6.3.2/bin/node2
2018-08-18
你的 node name 注釋掉就可以了,或者加一個(gè) -Enode.name 自己定義,現(xiàn)在這兩個(gè) node name 一樣了
2018-08-17
你要發(fā)你的配置或者每個(gè)節(jié)點(diǎn)的啟動(dòng)命令來(lái)給我看下,否則我沒(méi)法幫你解決問(wèn)題呢
2018-11-08
最近在阿里服務(wù)器上搭建elastic集群,這個(gè)elastic單機(jī)多節(jié)點(diǎn)部署其實(shí)很簡(jiǎn)單。先常規(guī)部署一個(gè)elastic正常運(yùn)行情況下,同一個(gè)文件夾復(fù)制一個(gè)安裝包。假如我的是
cp -R elasticsearch-5.6.3 elasticsearch-5.6.3-node-2,然后注意elasticsearch.yml配置
只需要將node.name: node-1 修改為 node-2和
修改端口,比如一個(gè)是9200,一個(gè)是9201,就可以啦。另外還要執(zhí)行一個(gè)操作??chown -R es:es /opt/elasticsearch/elasticsearch-5.6.3-node-2 把/opt/elasticsearch/elasticsearch-5.6.3-node-2的擁有者設(shè)置為 es,不然會(huì)報(bào)錯(cuò)!
2018-10-11
hello, 你的問(wèn)題解決了嗎?
你可以嘗試下修改:
elasticsearch.yml
添加:
discovery.zen.ping.unicast.hosts: ['192.168.7.223']
我在搭的過(guò)程中也碰到了這個(gè)問(wèn)題, 我的思考過(guò)程是這樣的:
既然是集群, 那么肯定有一項(xiàng)配置是使集群中的各個(gè)子節(jié)點(diǎn)相互發(fā)現(xiàn)相互通訊, 查看elasticsearch.yml有這樣一項(xiàng)配置說(shuō)明
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
根據(jù)這項(xiàng)配置, 就可以解決該問(wèn)題了.
2018-08-18
謝謝老師,我的配置
elasticsearch.yml
network.host: 192.168.7.223
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
其他均是注釋
啟動(dòng)命令,bin目錄下
主:./elasticsearch
第二:./elasticsearch -Ehttp.port=8200 -Epath.data=node2
第三:./elasticsearch -Ehttp.port=7200 -Epath.data=node3
http://192.168.7.223:9200/_cat/nodes?v
http://192.168.7.223:8200/_cat/nodes?v