-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle another node already having deleted the temporary index #88332
Merged
rudolf
merged 6 commits into
elastic:master
from
rudolf:so-migrations-v2-temp-index-not-found
Jan 21, 2021
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7599c05
Handle another node already having deleted the temporary index
rudolf 02b2bde
Merge branch 'master' into so-migrations-v2-temp-index-not-found
kibanamachine 3fb0088
Make run_multiple_kibana_nodes.sh script more generic
rudolf e7b1895
Merge branch 'master' into so-migrations-v2-temp-index-not-found
kibanamachine 6c934ae
Merge branch 'master' into so-migrations-v2-temp-index-not-found
kibanamachine aa52900
Add note about dependency on jq
rudolf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Licensed to Elasticsearch B.V. under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch B.V. licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
#!/bin/bash | ||
|
||
# | ||
# Script to run multiple kibana nodes in parallel on the same machine. | ||
# Make sure to run the script from kibana root directory. Some functions depend on the jq command-line utility | ||
# being installed. | ||
# | ||
# bash test/scripts/run_multiple_kibana_nodes.sh <function> [options] | ||
# functions: | ||
# start [instances] [args] - start multiple kibanas (3 default) | ||
# es [args] - run elasticsearch | ||
# tail - show logs of all kibanas | ||
# kill - kills all started kibana processes | ||
# clean - clean up nohup files | ||
# kibana_index - search .kibana index against es | ||
# | ||
|
||
FN="$1" | ||
|
||
if [ "${FN}" == "kill" ]; then | ||
echo "killing main processes" | ||
for pid in $(cat processes.out); do kill -9 $pid; done | ||
echo "killing trailing processes" | ||
for pid in $(pgrep -f scripts/kibana); do kill -9 $pid; done | ||
exit 0; | ||
fi | ||
|
||
if [ "${FN}" == "tail" ]; then | ||
tail -f nohup_* | ||
exit 0; | ||
fi | ||
|
||
if [ "${FN}" == "clean" ]; then | ||
rm -r nohup_*.out | ||
rm processes.out | ||
exit 0; | ||
fi | ||
|
||
if [ "${FN}" == "es" ]; then | ||
ARGS="$2" | ||
yarn es snapshot $ARGS | ||
exit 0; | ||
fi | ||
|
||
if [ "${FN}" == "kibana_index" ]; then | ||
# search the kibana index | ||
curl -XPOST http://elastic:changeme@localhost:9200/.kibana/_search -u elastic:changeme -d '' | jq | ||
rudolf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
exit 0; | ||
fi | ||
|
||
if [ "${FN}" == "start" ]; then | ||
NUM="$2" | ||
ARGS="$3" | ||
if test ! "${NUM-}"; then | ||
NUM=3 | ||
fi | ||
node scripts/build_kibana_platform_plugins --no-examples | ||
rm processes.out | ||
for i in $(seq 0 $(expr $NUM - 1)) | ||
do | ||
PORT="56${i}1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI doesn't run the script. Does it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it's just for manual QA |
||
PROXY="56${i}3" | ||
echo "starting kibana on port $PORT" | ||
nohup node scripts/kibana.js --dev.basePathProxyTarget=$PROXY --server.port=$PORT --dev --no-watch --no-optimizer --no-base-path $ARGS > nohup_$i.out & | ||
PROCESS_ID=$! | ||
echo "${PROCESS_ID}" >> processes.out | ||
done | ||
exit 0; | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional: Not everyone knows bash as well as JS. What functionality not supported by JS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's anything here that couldn't be implemented in JS, but I suspect it would just be a bit harder and more code to deal with async and streaming output between processes/files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, it would be good to have a long term goal of including multi-node upgrade migrations in automated tests. It would be much easier to implement such a test (and remove this script) once we have node clustering support #68626