溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Elasticsearch集群

發(fā)布時間:2020-07-06 03:57:50 來源:網(wǎng)絡 閱讀:4185 作者:yunlielai 欄目:大數(shù)據(jù)

1、兩臺機分別安裝好Elasticsearch


其中為192.168.1.110,設為master節(jié)點,elasticsearch.yml配置如下

cluster.name: my-application
node.name: node-111

network.host: 192.168.1.110
http.port: 9200

http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.1.110"]

另一臺機:的ip位192.168.1.108,elasticsearch.yml配置如下:

cluster.name: my-application
node.name: node-102

network.host: 192.168.1.108
http.port: 9200

http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: false
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.1.110"]


分別啟動兩臺機

訪問head:


master:

Elasticsearch集群

從的:

Elasticsearch集群

注:

如果另一臺機直接復制前一臺機;

啟動后可能出現(xiàn):

[node-2] failed to send join request to master [{node-1}{WbcP0pC_T32jWpYvu5is1A}{2_LCVHx1QEaBZYZ7XQEkMg}{10.10.11.200}{10.10.11.200:9300}], reason [RemoteTransportException[[node-1][10.10.11.200:9300][internal:discovery/zen/join]]; nested: IllegalArgumentException[can't add node {node-2}{WbcP0pC_T32jWpYvu5is1A}{p-HCgFLvSFa

解決:

原因是:是因為復制的elasticsearch文件夾下包含了data文件中示例一的節(jié)點數(shù)據(jù),需要把示例二data文件下的文件清空。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI