updated keyspace

This commit is contained in:
Alfredo Oliviero 2024-07-25 15:24:11 +02:00
parent ede7aeb467
commit cdbf1e1198
1 changed files with 6 additions and 6 deletions

12
dump.sh
View File

@ -1,8 +1,7 @@
```sh
#!/bin/bash
# Configuration
KEYSPACE="dev_keyspace"
KEYSPACE="dev_keyspace_1"
LOCAL_DIR="data/dumps"
NODES=("cass-dev-01" "cass-dev-02" "cass-dev-03")
SSH_USER="alfredo.oliviero"
@ -36,13 +35,14 @@ snapshot_and_copy() {
done
}
# Export keyspace schema from the first node
echo "Exporting keyspace schema for $KEYSPACE from ${NODES[0]}"
ssh $SSH_USER@${NODES[0]} "$CQLSH $CQLSH_IP -e \"DESCRIBE KEYSPACE $KEYSPACE;\"" > data/dev_keyspace_schema.cql
# Create local directory if it doesn't exist
mkdir -p $LOCAL_DIR
# Export keyspace schema from the first node
echo "Exporting keyspace schema for $KEYSPACE from ${NODES[0]}"
ssh $SSH_USER@${NODES[0]} "$CQLSH $CQLSH_IP -e \"DESCRIBE KEYSPACE $KEYSPACE;\"" > data/${KEYSPACE}_schema.cql
# Perform snapshot and copy for each node in parallel
NODE_INDEX=1
for NODE in "${NODES[@]}"; do