mirror of
https://github.com/elastic/logstash.git
synced 2025-04-19 04:15:23 -04:00
Ensure elasticsearch logs and data dirs exist before startup (#17531)
With a recent change in ES https://github.com/elastic/elasticsearch/pull/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 712b37e1df/qa/integration/services/elasticsearch_teardown.sh (L26-L27)
This commit is contained in:
parent
712b37e1df
commit
8e6e183adc
1 changed files with 4 additions and 1 deletions
|
@ -5,10 +5,13 @@ current_dir="$(dirname "$0")"
|
|||
source "$current_dir/helpers.sh"
|
||||
|
||||
ES_HOME="$current_dir/../../../build/elasticsearch"
|
||||
ES_DATA_PATH="/tmp/ls_integration/es-data"
|
||||
ES_LOGS_PATH="/tmp/ls_integration/es-logs"
|
||||
|
||||
start_es() {
|
||||
es_args=$@
|
||||
JAVA_HOME= $ES_HOME/bin/elasticsearch -Expack.security.enabled=false -Epath.data=/tmp/ls_integration/es-data -Ediscovery.type=single-node -Epath.logs=/tmp/ls_integration/es-logs $es_args -p $ES_HOME/elasticsearch.pid > /tmp/elasticsearch.log 2>/dev/null &
|
||||
mkdir -p $ES_DATA_PATH $ES_LOGS_PATH
|
||||
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 &
|
||||
count=120
|
||||
echo "Waiting for elasticsearch to respond..."
|
||||
while ! curl --silent localhost:9200 && [[ $count -ne 0 ]]; do
|
||||
|
|
Loading…
Add table
Reference in a new issue