mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 07:07:54 -04:00
This commit clears the `JAVA_HOME` variable when starting Elasticsearch to force it to use the bundled version of the JDK, rather than the default `JAVA_HOME` from the machine Logstash integration tests are being run on, and removes the likelihood of tests failing to run due to `JAVA_HOME` being set to a non-compliant JDK.
24 lines
700 B
Bash
Executable file
24 lines
700 B
Bash
Executable file
#!/bin/bash
|
|
set -ex
|
|
current_dir="$(dirname "$0")"
|
|
|
|
source "$current_dir/helpers.sh"
|
|
|
|
ES_HOME="$current_dir/../../../build/elasticsearch"
|
|
|
|
start_es() {
|
|
es_args=$@
|
|
JAVA_HOME= $ES_HOME/bin/elasticsearch -Epath.data=/tmp/ls_integration/es-data -Epath.logs=/tmp/ls_integration/es-logs $es_args -p $ES_HOME/elasticsearch.pid > /tmp/elasticsearch.log 2>/dev/null &
|
|
count=120
|
|
echo "Waiting for elasticsearch to respond..."
|
|
while ! curl --silent localhost:9200 && [[ $count -ne 0 ]]; do
|
|
count=$(( $count - 1 ))
|
|
[[ $count -eq 0 ]] && cat /tmp/elasticsearch.log && return 1
|
|
sleep 1
|
|
done
|
|
echo "Elasticsearch is Up !"
|
|
return 0
|
|
}
|
|
|
|
export ES_JAVA_OPTS="-Xms512m -Xmx512m"
|
|
start_es
|