【elasticsearch】windows安装运行.bat闪退问题

文章描述了在Windows上安装Elasticsearch时遇到的问题,即当在elasticsearch.yml配置文件中设置本机IP后,程序启动时出现闪退。问题根源在于缺少了`cluster.initial_master_nodes`的配置。通过添加这一配置项并正确设置为节点名称,解决了启动问题,使得Elasticsearch能够成功运行。
摘要由CSDN通过智能技术生成

目录

一、问题描述

二、问题排查

三、修改配置并运行成功

1、正确配置

2、运行成功


一、问题描述

        在根据下面链接进行windows安装,并使用默认localhost或者127.0.0.0 IP进行访问配置时,点击bin/elasticsearch.bat进行运行可以正常运行;

【elasticsearch】Windows安装

       但是,如果在config文件夹下的elasticsearch.yml文件中配置本机IP,就会在bin/elasticsearch.bat启动时出现闪退现象;下面是闪退配置:

# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.XX.XX
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.

二、问题排查

        在bin目录下,按shift并右击鼠标进入窗口操作运行elasticsearch.bat:

         通过日志发现,少配置一项:

cluster.initial_master_nodes: ["node-1"]

三、修改配置并运行成功

1、正确配置

# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.XX.XX
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#

2、运行成功

点击bin/elasticsearch.bat并查看运行成功页面:

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

郝少

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值