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.java:125) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[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(Bootstrap.java:105) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]
	... 6 more

the configuration of elasticsearch

cluster.name: cluster-1
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
node.master: true
node.data: false
index.number_of_shards: 1
index.number_of_replicas: 0
network.host: "192.168.2.44"
#
path.data: /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 HERE
output {
stdout { }
elasticsearch{
    type => "log"
    embedded => false
    host => "192.168.2.183"
    port => "9200"
    cluster => "cluster-1"
    node_name => "node-1"
    }
}

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

Start ^^ :smiley:

2 Likes

Also you have the IP 192.168.2.44 configured as network.host and Logstash tries to connect to 192.168.2.183

Changed to

network.host: "0.0.0.0"
#
# 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.