学习在windows server 2008R2安装elasticsearch2.4.4,安装参考文档
https://www.cnblogs.com/cxxjohnson/p/9083941.html
安装完成之后,发现只能用localhost或者127.0.0.1后加9200端口号访问,不能以IP地址访问,于是修改配置文件,重启结果发现,启动elasticsearch.bat出现黑窗闪退。
所以在cmd窗口下启动,报错日志如下:
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>cd D:\elasticsearch-2.4.4\bin
C:\Users\Administrator>d:
D:\elasticsearch-2.4.4\bin>elasticsearch.bat
Exception in thread "main" SettingsException[Failed to load settings from [elast
icsearch.yml]]; nested: MarkedYAMLException[while parsing a block mapping
in 'reader', line 17, column 3:
cluster.name: myescluster
^
expected <block end>, but found BlockMappingStart
in 'reader', line 21, column 4:
node.master: false
^
at [Source: # ======================== Elasticsearch Configuration ============
=============
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster
.
#
# Please see the documentation for further information on configuration options:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configur
ation.html>
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: myescluster
#
# ------------------------------------ Node ------------------------------------
#配置当前节点只保存数据:
node.master: false
node.data: true
#配置当前节点不保存数据,只做候选主节点:
node.master: false
node.data: true
# Use a descriptive name for the node:
#
# node.name: node-1
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comm
a):
#
# path.data: /path/to/data
#
# Path to log files:
#
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
# bootstrap.memory_lock: true
#
# Make sure that the `ES_HEAP_SIZE` environment variable is set to about half th
e memory
# available on the system and that the owner of the process is allowed to use th
is limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-networ
k.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number o
f nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 1
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discov
ery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gatewa
y.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true
; line: 17, column: 28]]; nested: ParserException[while parsing a block mapping
in 'reader', line 17, column 3:
cluster.name: myescluster
^
expected <block end>, but found BlockMappingStart
in 'reader', line 21, column 4:
node.master: false
^
];
Likely root cause: while parsing a block mapping
in 'reader', line 17, column 3:
cluster.name: myescluster
^
expected <block end>, but found BlockMappingStart
in 'reader', line 21, column 4:
node.master: false
^
at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Par
serImpl.java:570)
at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser
.java:340)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(J
sonXContentParser.java:53)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.seria
lizeObject(XContentSettingsLoader.java:99)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(
XContentSettingsLoader.java:67)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(
XContentSettingsLoader.java:45)
at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(Yaml
SettingsLoader.java:46)
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Set
tings.java:1080)
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Setti
ngs.java:1067)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvir
onment(InternalSettingsPreparer.java:88)
at org.elasticsearch.common.cli.CliTool.<init>(CliTool.java:107)
at org.elasticsearch.common.cli.CliTool.<init>(CliTool.java:100)
at org.elasticsearch.bootstrap.BootstrapCLIParser.<init>(BootstrapCLIPar
ser.java:48)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:242)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:45)
Refer to the log for complete error details.
D:\elasticsearch-2.4.4\bin>