繁体   English   中英

Elasticsearch 集群未显示

[英]Elasticsearch cluster isn't shown up

嗨,我在具有 3 个节点的集群上安装了 Elasticsearch 6.6 和 Ansible 剧本。 所有节点都在同一个端口上。

当我运行查询时:

curl  -u es_admin:<pass> -X GET 'https://<hostname1>:9201/_nodes/process?pretty' -k

我在集群中只看到一个节点:

{
  "_nodes" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "cluster_name" : "new_cluster",
  "nodes" : {
    "Qlqcbgs_QmWXpglNVoOApQ" : {
      "name" : "node1",
      "transport_address" : "<IP_address>:9301",
      "host" : "<hostname1>",
      "ip" : "<IP_address>",
      "version" : "6.6.0",
      "build_flavor" : "default",
      "build_type" : "rpm",
      "build_hash" : "<build_hash_number>",
      "roles" : [
        "master",
        "data",
        "ingest"
      ],
      "attributes" : {
        "ml.machine_memory" : "16653647872",
        "xpack.installed" : "true",
        "ml.max_open_jobs" : "20",
        "ml.enabled" : "true"
      },
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 11674,
        "mlockall" : false
      }
    }
  }
}

我分别为每个节点得到相同的 output :

curl  -u es_admin:<pass> -X GET 'https://<hostname2>:9201/_nodes/process?pretty' -k
curl  -u es_admin:<pass> -X GET 'https://<hostname3>:9201/_nodes/process?pretty' -k

在 elasticsearch.template.yml 下,我确实看到了其他节点。 例如,如果我 go 到 node1 我看到另外两个:

discovery.zen.ping.unicast.hosts:
- <hostname2>:9301
- <hostname3>:9301

这是 elasticsearch.yml:

node.name: node1

network.host: <hostname>

http.port: 9201

transport.tcp.port: 9301

node.master: true

node.data: true

node.ingest: true

search.remote.connect: true



#################################### Paths ####################################

# Path to directory containing configuration (this file and logging.yml):

path.data: /var/lib/elasticsearch/node1

path.logs: /var/log/elasticsearch/node1

discovery.zen.ping.unicast.hosts:
- <hostname2>:9301
- <hostname3>:9301



xpack.license.self_generated.type: trial


node.ml: true


xpack.ml.enabled: true


xpack.security.audit.enabled: true

xpack.security.enabled: true



xpack.security.transport.ssl.enabled: true
xpack.security.http.ssl.enabled: true
xpack.ssl.keystore.path: **path**
xpack.ssl.keystore.password: *passwd*
xpack.ssl.truststore.path: **path**
xpack.ssl.truststore.password: *passwd*

应该怎么做才能看到同一集群下的所有节点?

在 6.X 中,您还需要设置discovery.zen.minimum_master_nodes来告诉您的节点形成集群所需的最小主节点数是多少。

由于您没有设置它,因此您的每个节点都认为它们是主节点,它们不会加入任何集群。

在每个elasticsearch.yml文件中将其设置为discovery.zen.minimum_master_nodes: 2并重新启动您的节点。

我认为所有的 discovery.zen.ping.unicast.hosts 在所有节点中都必须相同。

discovery.zen.ping.unicast.hosts:
- <hostname1>:9301
- <hostname2>:9301
- <hostname3>:9301

请试试这个或只是:

discovery.zen.ping.unicast.hosts: ["hostname1:9301"]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM