Skip to content

Commit 77f9caa

Browse files
donoghucmergify[bot]
authored andcommitted
Ensure elasticsearch logs and data dirs exist before startup (#17531)
With a recent change in ES elastic/elasticsearch#125449 configuring path.data or path.logs to directories that do not exist cause ES to not be able to start up. This commit ensures those directories exist. The teardown script already ensures they are removed https://github.com/elastic/logstash/blob/712b37e1df333e8d156cb5d26fbc24aafcbfd2cd/qa/integration/services/elasticsearch_teardown.sh#L26-L27 (cherry picked from commit 8e6e183) # Conflicts: # qa/integration/services/elasticsearch_setup.sh
1 parent 70b9924 commit 77f9caa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: qa/integration/services/elasticsearch_setup.sh

+7
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@ current_dir="$(dirname "$0")"
55
source "$current_dir/helpers.sh"
66

77
ES_HOME="$current_dir/../../../build/elasticsearch"
8+
ES_DATA_PATH="/tmp/ls_integration/es-data"
9+
ES_LOGS_PATH="/tmp/ls_integration/es-logs"
810

911
start_es() {
1012
es_args=$@
13+
<<<<<<< HEAD
1114
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 &
15+
=======
16+
mkdir -p $ES_DATA_PATH $ES_LOGS_PATH
17+
JAVA_HOME= $ES_HOME/bin/elasticsearch -Expack.security.enabled=false -Epath.data=$ES_DATA_PATH -Ediscovery.type=single-node -Epath.logs=$ES_LOGS_PATH $es_args -p $ES_HOME/elasticsearch.pid > /tmp/elasticsearch.log 2>/dev/null &
18+
>>>>>>> 8e6e183ad (Ensure elasticsearch logs and data dirs exist before startup (#17531))
1219
count=120
1320
echo "Waiting for elasticsearch to respond..."
1421
while ! curl --silent localhost:9200 && [[ $count -ne 0 ]]; do

0 commit comments

Comments
 (0)