Installing ElasticSearch into a workspace


Hi, I need ElasticSearch to be installed in my workspace. I just installed Oracle Java-8 JDK and ElasticSearch 2.4.1 but when I try to start the service via command

sudo /etc/init.d/elasticsearch start

I see the next error:

* Starting Elasticsearch Server 
/etc/init.d/elasticsearch: 158: ulimit: error setting limit (Operation not permitted) 
sysctl: setting key "vm.max_map_count": Read-only file system

Does anybody knows a solution for running ElasticSearch inside a workspace?


Can you list the steps you did to install Elasticsearch?


At first, I installed Java 8:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

Then, I’ve downloaded a .deb package from the official site:

Installed it with the command:

sudo dpkg -i elasticsearch-2.4.1.deb

Then, I’ve fixed a config file elasticsearch.yml following the next tutorial for specify the cluster’s name and data path:

And at last I’ve tried to start ElasticSearch with:

sudo /etc/init.d/elasticsearch start

After that, I’ve seen the next error:

 * Starting Elasticsearch Server
/etc/init.d/elasticsearch: 158: ulimit: error setting limit (Operation not permitted)
sysctl: setting key "vm.max_map_count": Read-only file system


Thank you.

Additionally, can you please share the contents of elasticsearch.yml?


It’s also possible @Sladix could help out since he got it solved here: Elastic Search installation & usage


Brady that link points to this thread.


The error doesn’t prevent ES from running, I get the same everytime I start it but it works anyway !

You can try to do a curl from the bash command window. If you have any problems accessing it from outside, please read This thread


Woops, changed the link now. Thanks @BigChief45 and @Sladix!


Hi all, and thanks for this thread.

I’m trying to install Elasticsearch on a private Cloud9 workspace. Whenever I try to curl ES locally, I get the following error message:

scorintha:~/workspace (master) $ curl
curl: (7) Failed to connect to port 9200: Connection refused
scorintha:~/workspace (master) $ curl localhost:9200/_cat/health?v
curl: (7) Failed to connect to localhost port 9200: Connection refused
scorintha:~/workspace (master) $ curl
curl: (7) Failed to connect to port 9200: Connection refused

This is after setting the to, as @Sladix mentioned in the other thread. Is there a way to open the port locally, through iptables or some other method? Thanks.


You might need to edit Elasticsearch configuration file to change port to one of the allowed C9 ports such as 8080 or 8081. Then re-start Elasticsearch and try again.


Does that apply to local connections? I’m just trying to connect from a Rails instance to ES on 9200.

Thanks in advance, @BigChief45.


I’m also having trouble with this. I’ve got my elasticsearch.yml updated as per the above tips to say:
http.port: 8080-8081

I’ve also updated config.yml/local.yml to use that port for ES as well, in the hope of getting it to play nicely with Rails.

I get the same error on starting the server as above, and get this error on curl:

curl 'localhost:8080/_cat/nodes?v'
curl: (7) Failed to connect to localhost port 8080: Connection refused


Hi I have same error and I’ve also added two lines above. and I still get the fail… did you at least solve the fail issue though??


No, I still get the fail.


Hi cesy, after my comment I have tried and read some QnAs and I concluded that this problem is due to the fact that c9 is not allowing us to change “vm.max_map_count”. And I also found out that if I try using low version of elastic, it works(I tried 1.7.2). probably some changes had made when elastic updated to 5.x… anyway I guess its time for us to go local! have a great day!


The version 5 of elastic search requires much more memory than older versions did, it runs fine on cloud9 workspaces with 2.5gb of ram, but gets killed by oem on smaller workspaces.
The warning about sysctl can be silenced by editing /etc/init.d/elasticsearch (search for sys and comment out the first if statement)


Hello harutyun,

I made all previous installation, and when i start elasticsearch alone, it start but as soon as i want to add property like port to listen to, i got the message error you are talking about with vm.max_map_count=262144
I tried to modify with vim sysctl but read only on C9, i also tried : vim /etc/init.d/elasticsearch but it’s opening a new file so i can’t really comment any sys related message, what should i put into it ? sorry i’m quit new on all of this, any clue on how i can bypass that ?

(I code with a chromebook and i travel a lot so i can’t go local :/, or i would have to spend some money on a real machine, if it’s possible to avoid that by doing as you said i’ll be glad if you can help)

Thanks in advance !


Unfortunately it is not possible to increase this limit on cloud9, if there is no way for elasticsearch to work with the low limit, you may have to use ssh workspace to work with it.


ok too bad, thanks for your quick answer

What whas the option you talked about to make elasticsearch ignore that limit ? How do you do that ? I tried /etc/init.d/elasticsearch but this does not exist unfortunately :confused:


I found I could edit /etc/init.d/elasticsearch with sudo, which removed the vm.max_map_count error, but starting elasticsearch still produced …fail! - how can we get a higher limit on cloud9, or how can we run version 5 of elasticsearch?