I could easily reproduce the problem. I tried just removing the elasticsearch.in.sh script from the ES_HOME / bin directory and then tried to run. / elasticsearch from the ES_HOME / bin directory. I got,
You must set the ES_CLASSPATH var
The elasticsearch.in.sh file contains this path setting for this class. Therefore, please make sure that you have the elasticsearch.in.sh file in the ES_HOME / bin directory.
In accordance with. / elasticsearch script it looks for this elasticsearch.in.sh file in all of the following places. Therefore, placing it in any of the following places would be nice.
/usr/share/elasticsearch/elasticsearch.in.sh
/usr/local/share/elasticsearch/elasticsearch.in.sh
/opt/elasticsearch/elasticsearch.in.sh
~/.elasticsearch.in.sh
"$ES_HOME/bin/elasticsearch.in.sh"
Note that ES_HOME is the base installation directory for elasticsearch.
The contents of the elasticsearch.in.sh file for reference.
#!/bin/bash
if [ "x$ES_CLASSPATH" != "x" ]; then
cat >&2 << EOF
Error: Don't modify the classpath with ES_CLASSPATH. Best is to add
additional elements via the plugin mechanism, or if code must really be
added to the main classpath, add jars to lib/ (unsupported).
EOF
exit 1
fi
ES_CLASSPATH="$ES_HOME/lib/elasticsearch-5.0.0.jar:$ES_HOME/lib/*"
Note that it sets ES_CLASSPATH.
source
share