Amazon EC2 Micro Instance and Graylog2 / ElasticSearch

Ok, this is not becoming my next “How to install …”
Instead I will only give a tip to those people trying to run Graylog2 on an Amazon EC2 instance type t1.micro.

If you just started and your first project includes the installaton of Graylog2 do not expect miracles from your tiny t1.micro instance 😉

The AWS instance type site lists the specifications for all instance types:

t1_micro

Graylog2 comes with its own full-fledged MongoDB, ElasticSearch and Ruby on Rails web interface + web server.
Running all this stuff with only 0.615 GiB of Memory probably looks like this:

graylog_error

So if you get this “Could not connect to ElasticSearch” error in your Graylog2 web interface it is likely that everything you did was totally OK but your memory is not sufficient.
Try the following steps:

  1. Restart the ElasticSearch service manually
  2. Take a look into the elasticsearch/wrapper.log

I think this Java memory allocation error is a very common appearance on EC2 micro instances.
As far as I can tell, only two possibilities remain to solve this error:

1. Reduce Java Memory
Edit in your elasticsearch.conf the ES_HEAP_SIZE from 1024 to 512, 256, 128, …
Test and check your memory.

2. Upgrade to a bigger instance
I have chosen this way: updated to “small” and it worked like a charm.
If you have a system that consumes a lot of memory then give it the necessary memory and don’t try to use tricks.

Good luck with your installation!

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload the CAPTCHA.