在ElasticSearch中,bind_host和publish_host有什么区别? [英] What's the difference between bind_host and publish_host in ElasticSearch?

查看:1513
本文介绍了在ElasticSearch中,bind_host和publish_host有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从本文档网络设置,我知道, publish_host 是群集中其他节点将通信的主机。但是我不明白 bind_host 的功能,这意味着:

From this document network settings, I know that publish_host is the host that other nodes in the cluster will communicate to. But I don't understand the functionality of bind_host, which means that:


network.bind_host设置允许控制主机不同的网络组件将绑定。默认情况下,绑定主机将为anyLocalAddress(通常为0.0.0.0或:: 0)。

The network.bind_host setting allows to control the host different network components will bind on. By default, the bind host will be anyLocalAddress (typically 0.0.0.0 or ::0).

network.host 将设置 network.bind_host network.publish_host 到相同的值。

And the network.host will set network.bind_host and network.publish_host to the same value.

所以我想知道为什么需要设置 network.bind_host ,如果可以设置 network.bind_host network.publish_host 到不同的值?

So I want to know why there's a need to set network.bind_host and if it's possible to set network.bind_host and network.publish_host to different values?

推荐答案

可以将它们设置为不同价值观,在某些情况下非常有用。这是我的用法:

It is possible to set them to different values and really useful in some cases. Here is my usage:

我在数据中心有一个本地网络,我运行由不同节点组成的弹性搜索集群。这意味着每个弹性搜索机都有两个ip地址,一个从外部机器到另一个地址,另一个在本地连接到同一网络中的其他机器。

I have a local network in a data center where I run the elasticsearch cluster composed of different nodes. This means that every elasticsearch machine has two ip addresses, one to reach it from an external machine and the other to connect locally to other machines in the same network.

内部ip(eth1)用于使弹性搜索的不同节点彼此通信,发现等,外部ip地址(eth0)是​​我的在另一个网络中的Web应用程序发出请求。

The internal ip (eth1) is used to let different nodes of elasticsearch communicate, discover, etc. each other and the external ip address (eth0) is the one which my web application, which is in another network, makes the requests to.

所以简单来说,bind_host(在我的情况下,两个ip,与附加所有接口的默认值0.0.0.0相同)是弹性搜索侦听和publish_host(内部ip在我的情况下)是弹性搜索与其他集群组件通信的位置。

So in simple words, bind_host (both ip in my case, the same as default value 0.0.0.0 that attaches all interfaces) is where elasticsearch listens and publish_host (internal ip in my case) is where elasticsearch communicates with other cluster components.

这样,我的Web应用程序在另一个网络中,可以从bind_host地址访问ES集群,而弹性搜索通过publish_host与集群进行通信。

This way, my web application being in another network, can access the ES cluster from the bind_host address, while elasticsearch communicates with the cluster with the publish_host.

这篇关于在ElasticSearch中,bind_host和publish_host有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆