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:
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:
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:
- Restart the ElasticSearch service manually
- Take a look into the
service elasticsearch restart
Waiting for ElasticSearch.............................
WARNING: ElasticSearch may have failed to start.
INFO | jvm 2 | 2013/11/04 18:35:16 | # There is insufficient memory for the Java Runtime Environment to continue.
INFO | jvm 2 | 2013/11/04 18:35:16 | # Native memory allocation (malloc) failed to allocate xyz bytes for committing reserved memory.
INFO | jvm 2 | 2013/11/04 18:35:16 | # An error report file with more information is saved as:
INFO | jvm 2 | 2013/11/04 18:35:16 | # /opt/elasticsearch-x.xx.x/hs_err_pid25503.log
STATUS | wrapper | 2013/11/04 18:35:21 | Launching a JVM...
ERROR | wrapper | 2013/11/04 18:35:21 | JVM exited while loading the application.
INFO | jvm 3 | 2013/11/04 18:35:21 | Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(...) failed; error='Cannot allocate memory' (errno=12)
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
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!