默认情况下,首选IPV6。您可以通过将java.net.preferIPv4Stack系统属性设置为来更改此行为
true。
您还必须看到,默认情况下,ES绑定到
anyLocalAddress(通常是
0.0.0.0或
::0)。您可以通过设置
network.bind_host正确的IP地址来更改此设置。
参考[1.3]»模块»网络设置
更新:
首先,建议您在SO中禁用ipv6,您可以按照以下步骤操作:
在
/etc/sysctl.conf:
net.ipv6.conf.all.disable_ipv6 = 1net.ipv6.conf.default.disable_ipv6 = 1
要在正在运行的系统中禁用:
echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
要么
sysctl -w net.ipv6.conf.all.disable_ipv6=1sysctl -w net.ipv6.conf.default.disable_ipv6=1
之后,您必须更改两个节点
elasticsearch.yml的值以及
network.bind_host它们各自的IP
# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node# communication. (the range means that if the port is busy, it will automatically# try the next port).# Set the bind address specifically (IPv4 or IPv6):#network.bind_host: 10.0.0.1# Set the address other nodes will use to communicate with this node. If not# set, it is automatically derived. It must point to an actual IP address.#network.publish_host: 10.0.0.1
或设置
# Set both 'bind_host' and 'publish_host':#network.host: 10.0.0.1
最后,您必须验证网络适配器的配置,这两个适配器都必须使用之前使用的IP正确配置。
希望这可以帮助



