关于安装elasticsearch出现的问题

Exception in thread "main" 2020-03-15 22:49:52,911 main ERROR No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: MarkedYAMLException[while scanning a simple key
 in 'reader', line 56, column 1:
    network.host:0.0.0.0 
    ^
could not find expected ':'
 in 'reader', line 57, column 1:
    #
    ^

 at [Source: sun.nio.ch.ChannelInputStream@707194ba; line: 37, column: 42]]; nested: ScannerException[while scanning a simple key
 in 'reader', line 56, column 1:
    network.host:0.0.0.0 
    ^
could not find expected ':'
 in 'reader', line 57, column 1:
    #
    ^
];
    at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1139)
    at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1112)
    at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:100)
    at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:95)
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
    at org.elasticsearch.cli.Command.main(Command.java:90)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)
Caused by: com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: while scanning a simple key
 in 'reader', line 56, column 1:
    network.host:0.0.0.0 
    ^
could not find expected ':'
 in 'reader', line 57, column 1:
    #
    ^

 at [Source: sun.nio.ch.ChannelInputStream@707194ba; line: 37, column: 42]
    at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException.from(MarkedYAMLException.java:27)
    at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:343)
    at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:52)
    at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:675)
    at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:650)
    at org.elasticsearch.common.settings.Settings.access$500(Settings.java:82)
    at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1135)
    ... 8 more
Caused by: while scanning a simple key
 in 'reader', line 56, column 1:
    network.host:0.0.0.0 
    ^
could not find expected ':'
 in 'reader', line 57, column 1:
    #
    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:465)
    at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:280)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:225)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:557)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:157)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:167)
    at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:340)
    ... 13 more
 

 

 

仔细看了一下,这里报错的原因是配置文件的格式有问题

vim elasticsearch.yml

结果发现

network.host:0.0.0.0 

这里少了一个空格

network.host: 0.0.0.0

这样就可以了。所以写配置文件,还是要走点心的。 

你可能感兴趣的:(关于安装elasticsearch出现的问题)