-
-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a setup script and according makefile target to upgrade ES keysto…
…re from older versions of java
- Loading branch information
1 parent
fd7f419
commit 78715d8
Showing
3 changed files
with
37 additions
and
1 deletion.
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,25 @@ | ||
# Exit on Error | ||
set -e | ||
|
||
KEYSTORE_TO_UPGRADE=/secrets/keystore/elasticsearch.keystore | ||
KEYSTORE_TO_UPGRADE_BACKUP=$KEYSTORE_TO_UPGRADE.pre-upgrade | ||
KEYSTORE_LOCATION_FOR_TOOL=/usr/share/elasticsearch/config/elasticsearch.keystore | ||
|
||
if [ -f $KEYSTORE_TO_UPGRADE_BACKUP ]; then | ||
echo "A backup of a previous run of this script was found at $KEYSTORE_TO_UPGRADE_BACKUP. Aborting execution!" | ||
echo "Please remove the backup file and run the script again if you're sure that you want to run the upgrade script again." | ||
exit 1 | ||
fi | ||
|
||
echo "=========== Upgrading Elasticsearch Keystore ==========" | ||
|
||
cp $KEYSTORE_TO_UPGRADE $KEYSTORE_LOCATION_FOR_TOOL | ||
|
||
echo "Running elasticsearch-keystore upgrade" | ||
elasticsearch-keystore upgrade | ||
|
||
mv $KEYSTORE_TO_UPGRADE $KEYSTORE_TO_UPGRADE_BACKUP | ||
mv $KEYSTORE_LOCATION_FOR_TOOL $KEYSTORE_TO_UPGRADE | ||
|
||
echo "======= Keystore upgrade completed successfully =======" | ||
echo "Old keystore was backed up to $KEYSTORE_TO_UPGRADE_BACKUP" |