简体   繁体   English

Elasticsearch 集群未显示

[英]Elasticsearch cluster isn't shown up

Hi I installed Elasticsearch 6.6 with Ansible playbook over a cluster with 3 nodes.嗨,我在具有 3 个节点的集群上安装了 Elasticsearch 6.6 和 Ansible 剧本。 All nodes are on the same port.所有节点都在同一个端口上。

When I run the query:当我运行查询时:

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

I see only one node in the cluster:我在集群中只看到一个节点:

{
  "_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
      }
    }
  }
}

I get the same output for each node separately:我分别为每个节点得到相同的 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

Under elasticsearch.template.yml I do see the other nodes.在 elasticsearch.template.yml 下,我确实看到了其他节点。 For example if I go to node1 I see the other two:例如,如果我 go 到 node1 我看到另外两个:

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

here is elasticsearch.yml:这是 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*

What should be done in order to see all the nodes under the same cluster?应该怎么做才能看到同一集群下的所有节点?

In 6.X you also need to set discovery.zen.minimum_master_nodes to say to your nodes what is the minimum number of master nodes required to form a cluster.在 6.X 中,您还需要设置discovery.zen.minimum_master_nodes来告诉您的节点形成集群所需的最小主节点数是多少。

Since you didn't set it, each of your nodes think they are the master node and they won't join any cluster.由于您没有设置它,因此您的每个节点都认为它们是主节点,它们不会加入任何集群。

Set it to discovery.zen.minimum_master_nodes: 2 in each elasticsearch.yml file and restart your nodes.在每个elasticsearch.yml文件中将其设置为discovery.zen.minimum_master_nodes: 2并重新启动您的节点。

I think all discovery.zen.ping.unicast.hosts must be the same in all node.我认为所有的 discovery.zen.ping.unicast.hosts 在所有节点中都必须相同。

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

please try this or just:请试试这个或只是:

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

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

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