Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

performance-analyzer-agent does not use JAVA_HOME passed by parameter #302

Open
sbruno opened this issue Apr 9, 2021 · 0 comments
Open

Comments

@sbruno
Copy link

sbruno commented Apr 9, 2021

performance-analyzer-agent allows setting a specific ES_HOME path as first argument and a JAVA_HOME path as second argument.
In fact, the installation in a non-systemd system suggests using this command for starting it:

sh /usr/share/elasticsearch/plugins/opendistro-performance-analyzer/pa_bin/performance-analyzer-agent /usr/share/elasticsearch -d

OpenDistro documentation specifies to install JDK in the system, however elasticsearch has its embedded JDK and is possible to use it without installing other JDK, so this command could be used for starting the agent:
sh /usr/share/elasticsearch/plugins/opendistro-performance-analyzer/pa_bin/performance-analyzer-agent /usr/share/elasticsearch /usr/share/elasticsearch/jdk -d

The problem is that even though the folder exist and is valid, it is not taken into account and displays the message:
ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

This happens because inside the script, JAVA_HOME is defined as a variable but the agent is started using exec, and the variable is not available in its environment.

This works if JAVA_HOME is exported, in a similar way as JAVA_OPTS is exported in the same script.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant