我以此方式安装了Elsatic搜索。单节点有效,但群集不起作用(2个节点无法建立连接)。
请问缺少什么?
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.2.0-linux-x86_64.tar.gz
tar -xzf elasticsearch-7.2.0-linux-x86_64.tar.gz
cd elasticsearch-7.2.0/
# Set config for Elastic Search (in ./config/elasticsearch.yml)
# Master:
echo "" >> ./config/elasticsearch.yml
echo "xpack.security.enabled: true" >> ./config/elasticsearch.yml
echo "cluster.name: es-int" >> ./config/elasticsearch.yml
echo "node.name: node-1" >> ./config/elasticsearch.yml
echo "path.data: /tmp/elasticsearch.data" >> ./config/elasticsearch.yml
echo "path.logs: /tmp/elasticsearch.log" >> ./config/elasticsearch.yml
echo "network.host: 0.0.0.0" >> ./config/elasticsearch.yml
echo 'discovery.seed_hosts: ["master-ip", "slave-ip" ]' >> ./config/elasticsearch.yml
echo 'cluster.initial_master_nodes: ["master-ip"]' >> ./config/elasticsearch.yml
echo "http.port: 9200" >> ./config/elasticsearch.yml
echo "transport.host: localhost" >> ./config/elasticsearch.yml
echo "transport.tcp.port: 9300" >> ./config/elasticsearch.yml
# Slave:
echo "" >> ./config/elasticsearch.yml
echo "xpack.security.enabled: true" >> ./config/elasticsearch.yml
echo "cluster.name: es-int" >> ./config/elasticsearch.yml
echo "node.name: node-2" >> ./config/elasticsearch.yml
echo "path.data: /tmp/elasticsearch.data" >> ./config/elasticsearch.yml
echo "path.logs: /tmp/elasticsearch.log" >> ./config/elasticsearch.yml
echo "network.host: 0.0.0.0" >> ./config/elasticsearch.yml
echo "http.port: 9200" >> ./config/elasticsearch.yml
echo 'discovery.seed_hosts: ["master-ip", "slave-ip" ]' >> ./config/elasticsearch.yml
echo 'cluster.initial_master_nodes: ["master-ip"]' >> ./config/elasticsearch.yml
echo "transport.host: localhost" >> ./config/elasticsearch.yml
echo "transport.tcp.port: 9300" >> ./config/elasticsearch.yml
./bin/elasticsearch
错误:
[WARN ][o.e.c.c.ClusterFormationFailureHelper] [node-1] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [master-ip] to bootstrap a cluster: have discovered []; discovery will continue using [master-ip:9300, slave-ip:9300] from hosts providers and [{node-1}{Auontlf87A}{hJQJg9JD-IA}{localhost}{127.0.0.1:9300}{ml.machine_memory=8201650176, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
答案 0 :(得分:0)
我认为这与this有关。您是否尝试过将network.host
IP设置为实际的主IP地址和从IP地址?
edit :链接在这里可能根本不相关。而是将node.master: true
设置为允许将一个节点选举为主节点。
edit2 :可能也不是,因为这是默认设置。不幸的是我很茫然