目录
一、问题描述
二、问题排查
三、修改配置并运行成功
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并查看运行成功页面:文章来源:https://www.toymoban.com/news/detail-767677.html
文章来源地址https://www.toymoban.com/news/detail-767677.html
到了这里,关于【elasticsearch】windows安装运行.bat闪退问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!