elasticsearch - Elasticsearch 节点不相互通信
问题描述
我在两台不同的机器上安装了 elasticseaerch,两个节点都具有相同的集群名称,我还配置了另一个设置,以便拥有一个具有两个节点的集群,但它没有连接我不知道为什么。我的两个节点中的弹性搜索版本都是 7.3,并且我在与节点 1 的同一台机器上也有 kibana,虽然弹性搜索运行良好但没有连接可能是因为安全问题,因为我在弹性搜索中设置证书是出于安全目的. 请检查一下。
谢谢。
节点 1 elasticsearch.yml
# Use a descriptive name for your cluster:
#
cluster.name: ElasticsearchStaging
#xpack.security.enabled: true
#xpack.security.audit.enabled: true
#xpack.security.http.ssl.enabled: true
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
node.master: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
path.logs: /var/log/elasticsearch/
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: <internal_ip_node-1>
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: "node-1"
discovery.seed_hosts:
- internal_ip_node-1:9200
- internal_ip_node-2:9200
cluster.initial_master_nodes:
- node-1
- node-2
#
# For more information, consult the discovery and cluster formation module documentation.
#
#---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.audit.enabled: true
xpack:
security:
authc:
realms:
native:
native1:
order: 0
#xpack.security.audit.enabled: true
#xpack.monitoring.enabled: true
#---------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
节点 2 elasticsearch.yml
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: ElasticsearchStaging
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-2
node.data: true
#
# Add custom attributes to the node:
#
#node.master: false
#node.data: true
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: <internal_ip_node-2>
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: 10.128.0.24
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
discovery.seed_hosts:
- internal_ip_node-1:9200
- internal_ip_node-2:9200
cluster.initial_master_nodes:
- node-1
- node-2
# For more information, consult the discovery and cluster formation module documentation.
#discovery.zen.minimum_master_node: 2
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
解决方案
Elasticsearch 7.0 版本发生了重大变化。
您的zen配置将不再有效。
进入发现和集群形成设置部分,你会发现新的设置是
- 发现.seed_hosts
- cluster.initial_master_nodes
推荐阅读
- python - 在 Tensorflow 中将一组常数(1D 数组)与一组矩阵(3D 数组)相乘
- mobile-safari - PWA - 缓存的视频不会在 Mobile Safari (11.4) 中播放
- angular - Angular 6 - 如何通知子组件@output完成工作?
- php - 使用 PHP 跟踪过期的忠诚度积分
- angular - 为什么 Angular HTTP 在 POST 请求中不发送任何正文?
- python - 如何解决:使用 .csv Dictreader 导入文件的 Python 因未定义字符而失败
- css - 弯曲的内箱阴影
- php - 将二维数组插入mysql
- r - 具有两个 x 变量的 ggplot
- android - 在 Android 可穿戴设备中实现 MAP(蓝牙消息访问协议)