Problems with Java and Elasticsearch: JVM flavor 'sun6' not understood

Viewed 509

I'm preparing a Raspberry Pi 4 as a development environment, and I've hit a snag having installed and configured Java.

I've installed Elastic for Debian, which comes with Java 11.

I then appended "~/.bashrc" with:

export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-armhf"
export PATH=$PATH:$JAVA_HOME/bin

However, after installing Elastic, I got:

ā— elasticsearch.service - LSB: Starts elasticsearch Loaded: loaded (/etc/init.d/elasticsearch; generated) Active: active (exited) since Mon 2020-12-14 13:33:27 GMT; 1h 6min ago Docs: man:systemd-sysv-generator(8) Tasks: 0 (limit: 4915) CGroup: /system.slice/elasticsearch.service

Dec 14 13:33:27 raspberrypi systemd1: Starting LSB: Starts elasticsearch...

Dec 14 13:33:27 raspberrypi elasticsearch[1627]: [warning] /etc/init.d/elasticsearch: JVM flavor 'sun6' not understood

Dec 14 13:33:27 raspberrypi systemd1: Started LSB: Starts elastic

search.

I ran 'sudo journalctl --unit elasticsearch' and got:

Dec 14 13:33:22 raspberrypi systemd1: Stopping LSB: Starts elasticsearch...

Dec 14 13:33:22 raspberrypi elasticsearch[1592]: [warning] /etc/init.d/elasticsearch: JVM flavor 'sun6' not understood

Dec 14 13:33:22 raspberrypi systemd1: elasticsearch.service: Succeeded.

Dec 14 13:33:22 raspberrypi systemd1: Stopped LSB: Starts elasticsearch.

Dec 14 13:33:27 raspberrypi systemd1: Starting LSB: Starts elasticsearch...

Dec 14 13:33:27 raspberrypi elasticsearch[1627]: [warning] /etc/init.d/elasticsearch: JVM flavor 'sun6' not understood

Dec 14 13:33:27 raspberrypi systemd1: Started LSB: Starts elasticsearch.

Strange thing is, there's nothing in: cat var/log/elasticsearch

I'm assuming Elastic is struggling with the version of Java, but that's as far as my own DevOps takes me!

1 Answers

First, when you run a service using systemd, your ~/.bashrc environement variables are not necessarily sourced by the instance of your systemd services. You can define the environment variable in the systemd definition of your service (somewhere around /usr/lib/systemd/system or /etc/lib/systemd/system).

Then, I think it would be much more easy for you to replace systemd by docker or OCI containers that works pretty well on raspberrypi. And you're lucky because we're providing freely ARM-based images for elasticsearch, kibana and elastalert. Those images are kept up to date.

You'll find here the links of those OCI/docker images on dockerhub and an example of docker-compose file you can directly use: https://gitlab.comwork.io/oss/elasticstack/elasticstack-arm

Here you'll find another example of project that use those image to ingest the covid19 pandemic opendata and make some beautiful dashboards on kibana: https://gitlab.comwork.io/oss/covid19 (again arm-based docker containers are available in order to make everyone able to install this project on a raspberrypi easily and quickly).

Here you'll find some other tools around elasticsearch to handle snapshots or data rotation (again arm-based images are provided): https://gitlab.comwork.io/oss/elasticstack/elastic-indices-lifecycle

And if you're a French speaker, I made a talk on the Elastic meetup Paris some weeks ago and it's available on youtube: https://youtu.be/BC1iSnoe15k

With docker or OCI containers, no nightmare managing all dependancies (Kibana for example is much worst to handle by your own hands). Just install docker, pull and run those images, that's it.

Related