Skip to content

Instantly share code, notes, and snippets.

@ajayhn
Last active January 20, 2016 13:14
Show Gist options
  • Save ajayhn/ca334d93c3a979f44c6e to your computer and use it in GitHub Desktop.
Save ajayhn/ca334d93c3a979f44c6e to your computer and use it in GitHub Desktop.
contrail-db-row-replication-check
# REPLACE localhost with DB-IP %s/localhost/<IP>/g
#assume obj_fq_name_table keys as utf8;
#assume obj_fq_name_table comparator as utf8;
#assume obj_fq_name_table validator as utf8;
#assume obj_uuid_table keys as utf8;
#assume obj_uuid_table comparator as utf8;
#assume obj_uuid_table validator as utf8;
LOG_FILE=repl-check.out.$(date +%Y%m%d-%H%M%S)
echo "Starting logging to ${LOG_FILE}"
for x in $(cat << EOF | cassandra-cli -h localhost -f /dev/stdin | grep RowKey | awk '{ print $2 }'
use config_db_uuid;
list obj_fq_name_table;
quit;
EOF)
do
echo "$x replicated in:" >> ${LOG_FILE}
nodetool -h localhost getendpoints config_db_uuid obj_fq_name_table $x >> ${LOG_FILE};
done
for x in $(cat << EOF | cassandra-cli -h localhost -f /dev/stdin | grep RowKey | awk '{ print $2 }'
use config_db_uuid;
list obj_uuid_table;
quit;
EOF)
do
echo "$x replicated in:" >> ${LOG_FILE}
nodetool -h localhost getendpoints config_db_uuid obj_uuid_table $x >> ${LOG_FILE};
done
echo "Ending logging to ${LOG_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment