Last active
January 13, 2023 02:50
-
-
Save JensRantil/dc544cac73a0e336d717963690c45b85 to your computer and use it in GitHub Desktop.
Hacky one-liner for estimating progress when adding a new Cassandra node. Run on the join that’s joining and be sure to set NODES to number of nodes in the cluster that are streaming to the new node.
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
#!/bin/bash | |
while [ 1 ];do date -Iseconds | tr -d '\n';sudo nodetool netstats | grep Receiving | grep -Eo '[0-9]* bytes' | sed 's/ bytes//' | awk 'BEGIN {NODES=6;} NR%2==1 {TOTAL+=$0;} NR%2==0 {PROGRESS+=$0;} END {NODESRUNNING=NR/2;NODESDONE=NODES-NODESRUNNING;print " progress:", 100*(NODESDONE/NODES+(NODESRUNNING/NODES)*(PROGRESS/TOTAL)) "%", "running:", NODESRUNNING, "done:", NODESDONE;}';sleep 30;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output:
2021-06-23T22:11:51+02:00progress: 89.2757% running: 1 done: 5