Startup scripts: Set vm.max_map_count #4397

Closed
spinscale opened this Issue Dec 10, 2013 · 6 comments

Comments

Projects
None yet
4 participants
@spinscale
Member

spinscale commented Dec 10, 2013

All the startup scripts in the packages (init and systemd scripts!) should set the above config parameter in order to support the newly default mmapfs setting as good as possible.

@ghost ghost assigned spinscale Dec 10, 2013

@spinscale spinscale closed this in 81e13a8 Dec 11, 2013

spinscale added a commit that referenced this issue Dec 11, 2013

Packaging: Ensure setting of sysctl vm.max_map_count
In order to be sure that memory mapped lucene directories are working
one can configure the kernel about how many memory mapped areas
a process may have. This setting ensure for the debian and redhat initscripts
as well as the systemd startup, that this setting is set high enough.

Closes #4397
@recastrodiaz

This comment has been minimized.

Show comment
Hide comment
@recastrodiaz

recastrodiaz Dec 12, 2013

Running spinscale@81e13a8#diff-3866fe1739aff326f455c3ec4473ab48R160 on Ubuntu 12.04 throws the following error:

~$ sudo service elasticsearch start
 * Starting ElasticSearch Server                                                                                                                                                                                                             error: Unknown parameter "-qw"
usage:  sysctl [-n] [-e] variable ...
        sysctl [-n] [-e] [-q] -w variable=value ...
        sysctl [-n] [-e] -a
        sysctl [-n] [-e] [-q] -p <file>   (default /etc/sysctl.conf)
        sysctl [-n] [-e] -A

Should it be

sysctl -q -w vm.max_map_count=65535

instead?

Running spinscale@81e13a8#diff-3866fe1739aff326f455c3ec4473ab48R160 on Ubuntu 12.04 throws the following error:

~$ sudo service elasticsearch start
 * Starting ElasticSearch Server                                                                                                                                                                                                             error: Unknown parameter "-qw"
usage:  sysctl [-n] [-e] variable ...
        sysctl [-n] [-e] [-q] -w variable=value ...
        sysctl [-n] [-e] -a
        sysctl [-n] [-e] [-q] -p <file>   (default /etc/sysctl.conf)
        sysctl [-n] [-e] -A

Should it be

sysctl -q -w vm.max_map_count=65535

instead?

@spinscale

This comment has been minimized.

Show comment
Hide comment
@spinscale

spinscale Dec 12, 2013

Member

yeah, tested it with current debian and ubuntu distros.. which obviously handle -qw in one parameter..

will fix it

Member

spinscale commented Dec 12, 2013

yeah, tested it with current debian and ubuntu distros.. which obviously handle -qw in one parameter..

will fix it

@recastrodiaz

This comment has been minimized.

Show comment
Hide comment

cheers!

@spinscale

This comment has been minimized.

Show comment
Hide comment
@spinscale

spinscale Dec 12, 2013

Member

pushed the change... thx a lot for testing!

Member

spinscale commented Dec 12, 2013

pushed the change... thx a lot for testing!

@BanzaiMan BanzaiMan referenced this issue in travis-ci/travis-ci Mar 24, 2014

Closed

Error starting ElasticSearch server #2094

@Yashin-s

This comment has been minimized.

Show comment
Hide comment
@Yashin-s

Yashin-s Mar 18, 2015

Hello, I am running elasticsearch on a VPS centOS server and I am getting this issue as well. Elasticsearch is starting well but with the error. I can prevent the error by commenting out vm.max_map_count setting but my service runs only for a couple of hours or minutes. Is it because the default value which is 65530 ( instead of 262144 ) is too weak? I do not have permission to change this value, what can I do to prevent elasticsearch from crashing, even if it is iddle?

Hello, I am running elasticsearch on a VPS centOS server and I am getting this issue as well. Elasticsearch is starting well but with the error. I can prevent the error by commenting out vm.max_map_count setting but my service runs only for a couple of hours or minutes. Is it because the default value which is 65530 ( instead of 262144 ) is too weak? I do not have permission to change this value, what can I do to prevent elasticsearch from crashing, even if it is iddle?

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Packaging: Ensure setting of sysctl vm.max_map_count
In order to be sure that memory mapped lucene directories are working
one can configure the kernel about how many memory mapped areas
a process may have. This setting ensure for the debian and redhat initscripts
as well as the systemd startup, that this setting is set high enough.

Closes #4397
@Blarne

This comment has been minimized.

Show comment
Hide comment
@Blarne

Blarne Feb 21, 2018

In Docker client terminal (Docker CLI) use commands:

docker-machine ssh
sudo sysctl -w vm.max_map_count=262144
exit

.. and everything is ok.

Blarne commented Feb 21, 2018

In Docker client terminal (Docker CLI) use commands:

docker-machine ssh
sudo sysctl -w vm.max_map_count=262144
exit

.. and everything is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment