Comments (2)
Okay tested. I needed a single task after the java role and before the elasticsearch role.
---
# This avoids the java10 error: 'Unrecognized VM option 'UseParNewGC'
# for elasticsearch
# c.f. https://stackoverflow.com/questions/49623648/logstash-with-java10-get-error-unrecognized-vm-option-useparnewgc
# in a manner similar to the way elastic.elasticsearch handles it
# c.f. https://github.com/elastic/ansible-elasticsearch/blob/master/tasks/java.yml for redhat
- name: downgrade to 1.8 if available (Debian)
block:
- name: Get the installed java path (for Debian)
shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep java-8 | head -1"
become: yes
register: java_full_path
failed_when: false
changed_when: false
- name: set java alternatives to 1.8
alternatives:
name: java
path: "{{ java_full_path.stdout }}"
link: /usr/bin/java
when: java_full_path is defined
when: ansible_os_family == 'Debian'
- name: downgrade to 1.8 if available (RedHat)
block:
- name: Get the installed java path (for RedHat)
shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0 | head -1"
become: yes
register: java_full_path
failed_when: false
changed_when: false
- name: set java alternatives to 1.8
alternatives:
name: java
path: "{{ java_full_path.stdout }}"
link: /usr/bin/java
when: java_full_path is defined
when: ansible_os_family == 'RedHat'
This downgrades java before starting the elasticsearch server. (Theoretically, it could go anywhere but if put before the roles, java might not be installed, and if put after then the script will fail/hang waiting for the server to start.
I only tested this for Ubuntu 18.04 LTS
from ansible-role-elasticsearch.
Yeah: https://travis-ci.org/geerlingguy/ansible-role-elasticsearch/jobs/445212649
The actual failure (if you go in and monitor syslog
when it tries starting the service) is:
Oct 23 20:31:51 instance systemd[1]: Started Elasticsearch.
Oct 23 20:31:51 instance elasticsearch[5805]: Unrecognized VM option 'UseParNewGC'
Oct 23 20:31:51 instance elasticsearch[5805]: Error: Could not create the Java Virtual Machine.
Oct 23 20:31:51 instance elasticsearch[5805]: Error: A fatal exception has occurred. Program will exit.
It looks like this role is still on ES 2.x (yikes!). Upgrading to the latest version of Elasticsearch should make it compatible with Java 10...
from ansible-role-elasticsearch.
Related Issues (20)
- invalid configuration for xpack.security.transport.ssl when installing ElasticSearch 8.x
- /etc/elasticsearch/jvm.options.d does not exist
- Support for OpenSearch ?
- Changing configuration values does not restart elasticsearch HOT 1
- X-Pack security support HOT 2
- Different heap size for jvm causes issue when starting the es service HOT 3
- Older version HOT 3
- Timeout when waiting for elastic to start if setting network.host to an interface name HOT 2
- Recent Ansible moans about repository file permissions HOT 1
- Elasticsearch won't start because of Unrecognized VM option 'UseConcMarkSweepGC' HOT 3
- Elasticsearch won't start because of Unrecognized VM option 'UseConcMarkSweepGC HOT 1
- variabilize path.data and path.log in elasticsearch.yml HOT 3
- Do not start Elasticsearch when it is configured to not be started HOT 3
- Installing elasticsearch 6.x fails as /etc/elasticsearch/jvm.options.d does not exist
- "sorry, geerlingguy.ansible-role-elasticsearch was not found on https://galaxy.ansible.com/api/" HOT 3
- Unable to install specific version of elastic-search HOT 3
- Startup failed of ElasticSearch 6.8.15 on Ubuntu 20.04 with JDK 11 HOT 3
- Elasticsearch service timeouts HOT 2
- '${ES_TMPDIR}' does not exist HOT 2
- Feature: option to install ElasticSearch plugins HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-elasticsearch.