Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8395841
99-reset-cassandra.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
957 B
Subscribers
None
99-reset-cassandra.sh
View Options
#!/usr/bin/env bash
set
-eu
SCRIPT_DIR
=
"
$(
pwd
$(
dirname
@0
))
"
source
"
${
SCRIPT_DIR
}
/environment.cfg"
CASSANDRA_NODES
=
"
$(
cat
${
SCRIPT_DIR
}
/cassandra_seeds.lst
|
tr
','
'\n'
)
"
echo
"*********************"
echo
"WARNING"
echo
"*********************"
echo
"Running this script will wipe out all the data of the cassandra cluster."
echo
"cassandra nodes:
$(
cat
${
SCRIPT_DIR
}
/cassandra_seeds.lst
)
"
echo
"Are you sure?"
read
-r
echo
"Stopping cassandra"
echo
-n
${
CASSANDRA_NODES
}
|
parallel
-v
-d
' '
ssh
"
${
SSH_USER
}
"
@
{}
systemctl
stop
cassandra
echo
"Removing data"
echo
-n
${
CASSANDRA_NODES
}
|
parallel
-v
-d
' '
ssh
"
${
SSH_USER
}
"
@
{}
rm
-rf
"/srv/cassandra/commitlogs/*"
"/srv/cassandra/data/*"
echo
"Starting cassandra"
echo
-n
${
CASSANDRA_NODES
}
|
parallel
-v
-d
' '
ssh
"
${
SSH_USER
}
"
@
{}
systemctl
start
cassandra
echo
"Starting cassandra"
echo
-n
${
CASSANDRA_NODES
}
|
parallel
-v
-d
' '
ssh
"
${
SSH_USER
}
"
@
{}
systemctl
start
cassandra
echo
"Done"
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Jun 4 2025, 7:45 PM (11 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239724
Attached To
rDSNIP Code snippets
Event Timeline
Log In to Comment