Hyper-V安装CentOS7 的方式不在此赘述了,直接上安装elasticsearch7.4的时候遇到的问题
centos7使用了虚机固定ip以及访问外网的两个网络配置器,因此是两个网卡。
config/elasticsearch.yml配置如下:
在启动es时一直显示:
[WARN ][o.e.c.c.ClusterFormationFailureHelper] [localhost.localdomain] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes] is empty on this node: have discovered [{localhost.localdomain}{yt0QqIpTS3C8colQrUfnPg}{mTQIF50BS_mKSvKa9FqTLg}{172.18.40.13}{172.18.40.13:9300}{dilm}{ml.machine_memory=2073255936, xpack.installed=true, ml.max_open_jobs=20}]; discovery will continue using [0.0.0.0:9300, [::1]:9300] from hosts providers and [{localhost.localdomain}{yt0QqIpTS3C8colQrUfnPg}{mTQIF50BS_mKSvKa9FqTLg}{172.18.40.13}{172.18.40.13:9300}{dilm}{ml.machine_memory=2073255936, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
启动警告未找到主节点,标记的地址是我第二个网卡的动态地址(访问外网的映射地址),我所配置的内网地址并没有使用
导致,在创建索引时,一直报master not discovered这个错。
修改的方案:
修改配置文件 config/elasticsearch.yml,如下:
此问题,仅自己在使用的过程中遇到的问题,如有不好的地方,请尽情补充