Last active
March 24, 2022 10:13
-
-
Save rodneytamblyn/822d9b1b1c8f2f8d7df1c792720d4382 to your computer and use it in GitHub Desktop.
Revisions
-
rodneytamblyn revised this gist
Mar 24, 2022 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Read-me A method to safely stop Cassandra running in a Docker container before proceeding with reboot. There may be better ways using init.d but we do want to ensure that C* stops before we get on with anything else, and This method achieves that purpose After editing your bashrc and aliases file source to load new config: source ~/.bashrc -
rodneytamblyn created this gist
Mar 24, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ alias shutdown="cass-gracefulStopDatabase-and-reboot" This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ cass-gracefulStopDatabase-and-reboot() { logger -s "ob3 - Cassandra database docker container is gracefully stopping....." docker exec -it MYCASSANDRACONTAINERNAME nodetool flush docker exec -it MYCASSANDRACONTAINERNAME nodetool stopdaemon #dont stop docker database or it wont automatically restart on reboot logger -s "ob3 - C* stopped but container still running. Restart with docker stop database and docker start database" #don't just use shutdown as we have aliased that and it will loop... #continue shutdown/restart /usr/sbin/shutdown $1 $2 }