Error: Elasticsearch

Getting error, when starting elasticsearch

root@ip-192-168-2-183:/usr/share/elasticsearch# ./bin/elasticsearch 
[2018-04-26T10:42:39,743][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Elasticsearch.init( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.execute( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling( ~[elasticsearch-cli-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.Command.main( ~[elasticsearch-cli-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.main( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.main( ~[elasticsearch-6.2.4.jar:6.2.4]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.setup( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.init( ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.init( ~[elasticsearch-6.2.4.jar:6.2.4]
	... 6 more

the configuration of elasticsearch cluster-1
# ------------------------------------ Node ------------------------------------
# Use a descriptive name for the node:
# node-1
node.master: true false
index.number_of_shards: 1
index.number_of_replicas: 0 ""
# /var/lib/elasticsearch
# Path to log files:
path.logs: /var/log/elasticsearch
# Set a custom port for HTTP:
http.port: 9200

and logstash pipeline configuration

output {
stdout { }
    type => "log"
    embedded => false
    host => ""
    port => "9200"
    cluster => "cluster-1"
    node_name => "node-1"

It seems that, the port is not opened
plz help to solve

Start ^^ :smiley:


Also you have the IP configured as and Logstash tries to connect to

Changed to ""
# Set a custom port for HTTP:
http.port: 9200

ok, can give me some explanation for this, and how to do it

So if you don't run ES as root, does it work now?

am just changing the ownership of the home folder of elasticsearch

Just log out of root and try to start again.

now it seems to like this

ubuntu@ip-192-168-2-183:/usr/share/elasticsearch$ bin/elasticsearch
bin/elasticsearch-env: line 70: /etc/default/elasticsearch: Permission denied

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.