![](/img/trans.png)
[英]Shell scripts specified in _SCRIPTS primary isn't shown in dist tarball
[英]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.