要停止Elasticsearch节点之间的通信,可以通过更改配置文件来实现。以下是一种方法,该方法不使用防火墙阻止端口,而是通过配置文件禁用节点间的通信。
打开Elasticsearch的配置文件elasticsearch.yml。
找到以下行:
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
# Disable network communication between nodes
#
#discovery.type: single-node
network.host: 127.0.0.1
保存并关闭配置文件。
重新启动Elasticsearch节点。
通过这种方式,您禁用了节点间的通信,并且节点将无法发现和连接其他节点。请注意,此方法可能会导致集群无法正常工作,因此请仔细考虑您的需求和环境。
上一篇:不使用方法和其他类型来排序字符串
下一篇:不使用方括号初始化整数数组。