Skip to content

Instantly share code, notes, and snippets.

@dominicsayers
Last active August 12, 2024 08:14
Show Gist options
  • Save dominicsayers/8319752 to your computer and use it in GitHub Desktop.
Save dominicsayers/8319752 to your computer and use it in GitHub Desktop.

Revisions

  1. dominicsayers revised this gist Jan 8, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions elasticsearch.md
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,21 @@
    What I actually did
    -------------------

    *`/etc/security/limits.conf`*
    */etc/security/limits.conf*

    ```
    elasticsearch hard memlock 100000
    ```

    1. In `/etc/default/elasticsearch` set
    */etc/default/elasticsearch*

    ```
    ES_HEAP_SIZE=128m
    MAX_LOCKED_MEMORY=100000
    ES_JAVA_OPTS=-server
    ```

    1. In `/etc/elasticsearch/elasticsearch.yml` set
    */etc/elasticsearch/elasticsearch.yml*

    ```
    index.number_of_shards: 1
  2. dominicsayers revised this gist Jan 8, 2014. 1 changed file with 15 additions and 3 deletions.
    18 changes: 15 additions & 3 deletions elasticsearch.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,23 @@
    What I actually did
    -------------------

    1. In `/etc/security/limits.conf` added a line `elasticsearch hard memlock 100000`
    1. In `/etc/default/elasticsearch` set `ES_HEAP_SIZE=128m`, `MAX_LOCKED_MEMORY=100000` & `ES_JAVA_OPTS=-server`
    *`/etc/security/limits.conf`*

    ```
    elasticsearch hard memlock 100000
    ```

    1. In `/etc/default/elasticsearch` set

    ```
    ES_HEAP_SIZE=128m
    MAX_LOCKED_MEMORY=100000
    ES_JAVA_OPTS=-server
    ```

    1. In `/etc/elasticsearch/elasticsearch.yml` set

    ```conf
    ```
    index.number_of_shards: 1
    index.number_of_replicas: 0
    ```
  3. dominicsayers created this gist Jan 8, 2014.
    48 changes: 48 additions & 0 deletions elasticsearch.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    What I actually did
    -------------------

    1. In `/etc/security/limits.conf` added a line `elasticsearch hard memlock 100000`
    1. In `/etc/default/elasticsearch` set `ES_HEAP_SIZE=128m`, `MAX_LOCKED_MEMORY=100000` & `ES_JAVA_OPTS=-server`
    1. In `/etc/elasticsearch/elasticsearch.yml` set

    ```conf
    index.number_of_shards: 1
    index.number_of_replicas: 0
    ```

    Advice I read
    -------------
    http://blog.lavoie.sl/2012/09/configure-elasticsearch-on-a-single-host.html (for an old version)

    ```
    Edit /etc/security/limits.conf and add: elasticsearch hard memlock 100000
    Edit the init script: /etc/init.d/elasticsearch
    Change ES_HEAP_SIZE to 10-20% of your machine, I used 128m
    Change MAX_LOCKED_MEMORY to 100000 Be sure to set it at the same value as 1.1
    Change JAVA_OPTS to "-server"
    Edit the config file: /etc/elasticsearch/elasticsearch.yml
    index.number_of_shards: 1
    index.number_of_replicas: 0
    index.term_index_interval: 256
    index.term_index_divisor: 5
    network.host: 127.0.0.1
    network.tcp.block: true
    ```

    http://stackoverflow.com/questions/18132719/how-to-change-elasticsearch-max-size

    ```
    /etc/security/limits.conf:
    elasticsearch - nofile 65535
    elasticsearch - memlock unlimited
    /etc/default/elasticsearch:
    ES_HEAP_SIZE=512m
    MAX_OPEN_FILES=65535
    MAX_LOCKED_MEMORY=unlimited
    /etc/elasticsearch/elasticsearch.yml:
    bootstrap.mlockall: true
    ```