OS: Manjaro
STEPS:
-
I was following this tutorial in order to install elasticsearch
-
If I'm trying to run
elasticsearch
I will get this error:/usr/bin/elasticsearch-env: line 128: cd: /usr/share/elasticsearch/config: Permission denied
bin/elasticsearch-env: line 128: cd: /usr/share/elasticsearch/config: Permission denied -
I've checked the permissions via
ls -l
and there are all set to my uservlad
[vlad@vlad-tuf ~]$ ls -l ../../usr/share/elasticsearch/
total 568
drwxrwxrwx 1 vlad vlad 872 dec 14 18:54 bin
lrwxrwxrwx 1 vlad vlad 18 oct 16 14:01 config -> /etc/elasticsearch
lrwxrwxrwx 1 vlad vlad 22 oct 16 14:01 data -> /var/lib/elasticsearch
drwxrwxrwx 1 vlad vlad 1938 dec 14 18:54 lib
-rwxrwxrwx 1 vlad vlad 13675 oct 16 14:01 LICENSE.txt
lrwxrwxrwx 1 vlad vlad 22 oct 16 14:01 logs -> /var/log/elasticsearch
drwxrwxrwx 1 vlad vlad 1306 dec 14 18:54 modules
-rwxrwxrwx 1 vlad vlad 544318 oct 16 14:01 NOTICE.txt
drwxr-xr-x 1 elasticsearch elasticsearch 0 oct 16 14:01 plugins
-rwxrwxrwx 1 vlad vlad 7007 oct 16 14:01 README.asciidoc
- If I'm going to run with
sudo elasticsearch
I will get:
Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: JsonParseException[Duplicate field 'http.cors.allow-origin'
at [Source: (sun.nio.ch.ChannelInputStream); line: 91, column: 23]];
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1100)
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1073)
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:83)
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:100)
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:91)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:91)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.common.settings.KeyStoreCli.main(KeyStoreCli.java:43)
Caused by: com.fasterxml.jackson.core.JsonParseException: Duplicate field 'http.cors.allow-origin'
at [Source: (sun.nio.ch.ChannelInputStream); line: 91, column: 23]
at com.fasterxml.jackson.core.json.JsonReadContext._checkDup(JsonReadContext.java:204)
at com.fasterxml.jackson.core.json.JsonReadContext.setCurrentName(JsonReadContext.java:198)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:399)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:52)
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:645)
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:620)
at org.elasticsearch.common.settings.Settings.access$400(Settings.java:82)
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1096)
... 10 more
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Exception in thread "main" 2020-12-15 01:10:54,611 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: JsonParseException[Duplicate field 'http.cors.allow-origin'
at [Source: (sun.nio.ch.ChannelInputStream); line: 91, column: 23]];
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1100)
at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1073)
at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:83)
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:100)
at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:91)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Caused by: com.fasterxml.jackson.core.JsonParseException: Duplicate field 'http.cors.allow-origin'
at [Source: (sun.nio.ch.ChannelInputStream); line: 91, column: 23]
at com.fasterxml.jackson.core.json.JsonReadContext._checkDup(JsonReadContext.java:204)
at com.fasterxml.jackson.core.json.JsonReadContext.setCurrentName(JsonReadContext.java:198)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:399)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:52)
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:645)
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:620)
at org.elasticsearch.common.settings.Settings.access$400(Settings.java:82)
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1096)
Can any of you help me to understand what I'm doing wrong in order to run this elastic search?