Elasticsearch Linux Installation: Permission Denied

(Krushnat Khawale) #1

Following error I am getting while running ES on amazon linux server:

ubuntu@ip-1XX-XX-XX-1X5:~/elasticsearch-2.2.1$ bin/elasticsearch
-bash: bin/elasticsearch: Permission denied

(Tat Dat Pham) #2

do you run Elasticsearch with Root permission ??
I saw you using user "Ubuntu" permission

(Krushnat Khawale) #3

I used chmod +x bin/elasticsearch command and it ran successfully.

But now is not listening on port. Following is console,

ubuntu@ip-XXX-31-XX-1X5:~/elasticsearch-2.2.1$ chmod +x bin/elasticsearch
ubuntu@ip-XXX-31-XX-1X5:~/elasticsearch-2.2.1$ bin/elasticsearch
[2016-03-16 07:35:52,437][INFO ][node                     ] [Bart Hamilton] vers                                                                                        ion[2.2.1], pid[25248], build[d045fc2/2016-03-09T09:38:54Z]
[2016-03-16 07:35:52,438][INFO ][node                     ] [Bart Hamilton] init                                                                                        ializing ...
[2016-03-16 07:35:53,097][INFO ][plugins                  ] [Bart Hamilton] modu                                                                                        les [lang-groovy, lang-expression], plugins [], sites []
[2016-03-16 07:35:53,129][INFO ][env                      ] [Bart Hamilton] usin                                                                                        g [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [6.1gb], net total                                                                                        _space [7.7gb], spins? [no], types [ext4]
[2016-03-16 07:35:53,129][INFO ][env                      ] [Bart Hamilton] heap                                                                                         size [1015.6mb], compressed ordinary object pointers [true]
[2016-03-16 07:35:53,130][WARN ][env                      ] [Bart Hamilton] max                                                                                         file descriptors [4096] for elasticsearch process likely too low, consider incre                                                                                        asing to at least [65536]
[2016-03-16 07:35:55,255][INFO ][node                     ] [Bart Hamilton] init                                                                                        ialized
[2016-03-16 07:35:55,256][INFO ][node                     ] [Bart Hamilton] star                                                                                        ting ...
[2016-03-16 07:35:55,318][INFO ][transport                ] [Bart Hamilton] publ                                                                                        ish_address {}, bound_addresses {}, {[::1]:9300}
[2016-03-16 07:35:55,326][INFO ][discovery                ] [Bart Hamilton] elas                                                                                        ticsearch/A3L6OemYTZuKacvycyCt2g
[2016-03-16 07:35:58,361][INFO ][cluster.service          ] [Bart Hamilton] new_                                                                                        master {Bart Hamilton}{A3L6OemYTZuKacvycyCt2g}{}{}, reaso                                                                                        n: zen-disco-join(elected_as_master, [0] joins received)
[2016-03-16 07:35:58,382][INFO ][http                     ] [Bart Hamilton] publ                                                                                        ish_address {}, bound_addresses {}, {[::1]:9200}
[2016-03-16 07:35:58,382][INFO ][node                     ] [Bart Hamilton] star                                                                                        ted
[2016-03-16 07:35:58,452][INFO ][gateway                  ] [Bart Hamilton] reco                                                                                        vered [0] indices into cluster_state

(Magnus Bäck) #4

Please posts logs that aren't truncated.

How is it possible that bin/elasticsearch wasn't executable? That might be a symptom of an underlying problem that could cause additional problems down the road. I suggest you figure out what happened.

(Krushnat Khawale) #5

This is what I've got in logs.

After pinging from browser and CURL for 10 - 15 times, I stopped pinging. And Putty gets hung.
(FYI: I am accessing AWS instance, using putty from WINDOWS. )

I've simply used FileZilla, and uploaded to AWS instance with default user 'UBUNTU'.

and then, ran it.

(Krushnat Khawale) #6

I tried running ES from root permission, and then it came with following message,

[2016-03-16 10:12:57,828][ERROR][bootstrap                ] Exception
java.lang.RuntimeException: don't run elasticsearch as root.
	at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

(Krushnat Khawale) #9

Now able to run ES, successfully,

    ubuntu@ip-XXX-X1-XX-1X5:~/elasticsearch-2.1.1$ bin/elasticsearch
    [2016-03-16 12:46:10,700][INFO ][node ] [Zom] version[2.1.1], pid[3678], build[40e2c53/2015-12-15T13:05:55Z]
    [2016-03-16 12:46:10,700][INFO ][node ] [Zom] initializing ...
    [2016-03-16 12:46:10,831][INFO ][plugins ] [Zom] loaded [], sites []
    [2016-03-16 12:46:10,887][INFO ][env ] [Zom] using [1] data paths, mounts [[/ (/dev/xvda1)]], net usable_space [5.9gb], net total_space [7.7gb], spins? [no], types [ext4]
    [2016-03-16 12:46:13,070][INFO ][node ] [Zom] initialized
    [2016-03-16 12:46:13,070][INFO ][node ] [Zom] starting ...
    [2016-03-16 12:46:13,121][INFO ][transport ] [Zom] publish_address {}, bound_addresses {}, {[::1]:9300}
    [2016-03-16 12:46:13,128][INFO ][discovery ] [Zom] elasticsearch/Zg5K2mxFToWZmP3G1hMrFw
    [2016-03-16 12:46:16,193][INFO ][cluster.service ] [Zom] new_master {Zom}{Zg5K2mxFToWZmP3G1hMrFw}{}{}, reason: zen-disco-join(elected_as_master, [0] joins received)
    [2016-03-16 12:46:16,217][INFO ][http ] [Zom] publish_address {}, bound_addresses {}, {[::1]:9200}
    [2016-03-16 12:46:16,217][INFO ][node ] [Zom] started
    [2016-03-16 12:46:16,224][INFO ][gateway ] [Zom] recovered [0] indices into cluster_state

Now how can I send my topbeat logs to this server? CURL command says timeout.

(Magnus Bäck) #10

Unless you'll only be sending logs from localhost you need to start by adjusting the network.host setting so that ES binds to other interfaces.

(Krushnat Khawale) #11

yeah, I saw this field,


in elasticsearch.yml file, what shold be the value of this attribute?

(Mark Walkom) #12

Why not just use out deb repos to install it?

(system) #13