I am trying to start Elasticsearch 5.0.0 using ansible playbook and I am getting the below error I tried to by giving ES_JAVA_OPTS="-Xms1g -Xmx1g" in elasticsearch.j2 (template) but still unable to resolve the below error
fatal: [10.247.0.31]: FAILED! => {"changed": true, "cmd": ["sudo", "service", "master_node_elasticsearch", "start"], "delta": "0:00:00.086526", "end": "2016-11-09 07:46:34.015391", "failed": true, "rc": 1, "start": "2016-11-09 07:46:33.928865", "stderr": "", "stdout": "Starting elasticsearch: Error: encountered environment variables that are no longer supported\nUse jvm.options or ES_JAVA_OPTS to configure the JVM\nES_HEAP_SIZE=1g: set -Xms1g and -Xmx1g in jvm.options or add "-Xms1g -Xmx1g" to ES_JAVA_OPTS\n[FAILED]", "stdout_lines": ["Starting elasticsearch: Error: encountered environment variables that are no longer supported", "Use jvm.options or ES_JAVA_OPTS to configure the JVM", "ES_HEAP_SIZE=1g: set -Xms1g and -Xmx1g in jvm.options or add "-Xms1g -Xmx1g" to ES_JAVA_OPTS", "[FAILED]"], "warnings": ["Consider using 'become', 'become_method', and 'become_user' rather than running sudo"]}
I had a little doubt in setting up ES 5.0 and I am following ES 5.x support active work but getting below error,
fatal: [10.247.0.5]: FAILED! => {"changed": true, "cmd": ["sudo", "service", "master_node_elasticsearch", "start"], "delta": "0:00:00.054053", "end": "2016-11-14 05:09:33.621534", "failed": true, "rc": 7, "start": "2016-11-14 05:09:33.567481", "stderr": "", "stdout": "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set", "stdout_lines": ["MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set"], "warnings": ["Consider using 'become', 'become_method', and 'become_user' rather than running sudo"]}
Though I have given the es_heap_size value in my playbook but still getting the error.
I have attached the my playbook for your reference and somewhere I am doing mistake & pls correct me
You don't need to use es_java_opts. But you should probably make sure that jvm.options goes in /etc/elasticsearch/jvm.options. Doesn't seem like this file is working in default.path.conf. I believe there is an open issue about this. Playbook needs modified to support that (It does delete the default jvm.options).
Also make sure there is nothing in /usr/share/elasticsearch/plugins/
Remove this
# TODO: Re-enable when fixed in ES 5.0.1
#- name: Delete Default JVM Options File (5.x)
# file: dest=/etc/elasticsearch/jvm.options state=absent
And change to this
# TODO: Disable when fixed in ES 5.0.1
- name: Copy jvm.options File for Instance
template: src=jvm.options.j2 dest=/etc/elasticsearch/jvm.options owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
notify: restart elasticsearch
when: es_version | version_compare('5.0', '>=')
Hopefully that helps your situation. That's how I could run 3 process on the same server.
I have tried the same setting as you suggested and I could see its trying to start ES from the path /usr/share/elasticsearch/bin/elasticsearch
but It fails to start ES and I got the following error,
fatal: [10.247.0.5]: FAILED! => {"changed": true, "cmd": ["service", "master_node_elasticsearch", "start"], "delta": "0:00:00.050567", "end": "2016-11-17 01:26:21.900953", "failed": true, "rc": 7, "start": "2016-11-17 01:26:21.850386", "stderr": "", "stdout": "/usr/share/elasticsearch/bin/elasticsearch\nMAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set", "stdout_lines": ["/usr/share/elasticsearch/bin/elasticsearch", "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set"], "warnings": ["Consider using service module rather than running service"]}
when I check jvm_options file path it placed in /etc/elasticsearch and heap size value also append to the min & max
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.