温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Elasticsearch集群

发布时间:2020-07-06 03:57:50 来源:网络 阅读:4183 作者:yunlielai 栏目:大数据

1、两台机分别安装好Elasticsearch


其中为192.168.1.110,设为master节点,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集群

注:

如果另一台机直接复制前一台机;

启动后可能出现:

[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文件中示例一的节点数据,需要把示例二data文件下的文件清空。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI