Maintaining your Cassandra database
You should perform regular maintenance on your Feature Server Cassandra database, to be certain that the database and its backups are all in sync. When any of these events occur, run the corresponding procedure:
- A week has passed.
- An upgrade triggered a Feature Server restart.
- You added new nodes to the ring, or removed nodes.
Run weekly on all Feature Server nodes
You can perform this procedure:
- as a cron job on Linux. (See https://en.wikipedia.org/wiki/Cron.)
- as a scheduled task on Windows.
https://intranet.genesys.com/pages/viewpage.action?title=SIPVM-3779+Cassandra+Maintenance+Procedure&spaceKey=RP
- Or you can use the procedure described in Backing up and restoring Cassandra data.
Run after a Feature Server restart
You can trigger a restart by adding or removing Feature Server nodes, in a new or existing data center.
cd /genesys/fs/work/jetty0.0.0.08080fs
war_fsany/webapp/WEBINF/lib java cp libthrift0.7.0. jar:cassandrathrift1.1.{{Editgrn_open}}12{{Editgrn_close}}. jar:commonscli1.1. jar:cassandraall1.1.{{Editgrn_open}}12{{Editgrn_close}}. jar org.apache.cassandra.tools.NodeCmd h localhost p 9192 repairRunning Nodetool on a Feature Server Host
The nodetool is a command-line interface for managing a Cassandra cluster.
- Change working directory: cd <Feature Server Installation Directory>/work/jetty-<vms_host>-<port>-fs.war-_fs-any-/webapp/WEB-INF/lib
where...
<Feature Server Installation Directory> is where Feature Server is installed for your company.
<vms_host> is the IP address of the vms host parameter that Feature Server started with, defined in launcher.xml or in the command line. The default is 0.0.0.0.
<port> is the port number that Feature Server started with, defined in launcher.xml. The default is 8080. - Run the nodetool utility.
- In Linux: (.jar separated by “:”)
java -cp libthrift-0.7.0.jar:cassandra-thrift-1.1.12.jar:commons-cli-1.1.jar:cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p <jmx_port> <nodetool command> - In Windows: (.jar separated by “;”)
java -cp libthrift-0.7.0.jar;cassandra-thrift-1.1.12.jar;commons-cli-1.1.jar;cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p <jmx_port> <nodetool command>
where...
<jmx_port> is the JMX port number that Feature Server started with, defined in launcher.xml. Default=9192.
<nodetool command> can be ring [keyspace name] OR removetoken <token> OR repair OR flush
- In Linux: (.jar separated by “:”)
For example, the following command line runs nodetool and sends <nodetool command> ring to Feature Server running on the local host:
cd genesys/fs/work/jetty-0.0.0.0-8080-fs.war-_fs-any-/webapp/WEB-INF/lib java -cp libthrift-0.7.0.jar:cassandra-thrift-1.1.12.jar:commons-cli-1.1.jar:cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p 9192 ring sipfs
Removing a Feature Server Cassandra Cluster Node
When you remove a node from the ring, you must also remove the corresponding tokens. Use these software procedures:
- Run nodetool ring to obtain tokens. (See Running Nodetool on a Feature Server Cassandra Host
- Run nodetool removetoken to remove nodes from the ring.
- Run nodetool repair.
- Run nodetool ring to validate removal.
For example, running nodetool ring...
On Linux:
java -cp libthrift-0.7.0.jar:cassandra-thrift-1.1.12.jar:commons-cli-1.1.jar:cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p 9192 ring
On Windows:
java -cp libthrift-0.7.0.jar;cassandra-thrift-1.1.12.jar;commons-cli-1.1.jar;cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p 9192 ring
…to see the following output returned:
10.51.29.117 usw1 RAC2 Up Normal 1.29 MB 100.00% 26003787676682001822918611294472056316
10.51.28.221 usw1 RAC1 Up Normal 1.17 MB 66.65% 167086018864645871692761019448293152722
10.52.89.189 aps2 RAC1 Down Normal 1.15 MB 25.90% 41007983964572150951275225962045789866
10.52.88.190 aps2 RAC2 Down Normal 1.16 MB 7.45% 53685600614278234503162023330018045221
The following nodetool commands remove <fs-host-IP3> and <fs-host-IP4> from the ring:
cd genesys/fs/work/jetty-0.0.0.0-8080-fs.war-_fs-any-/webapp/WEB-INF/lib
java -cp libthrift-0.7.0.jar:cassandra-thrift-1.1.12.jar:commons-cli-1.1.jar:cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p 9192 removetoken41007983964572150951275225962045789866
java -cp libthrift-0.7.0.jar:cassandra-thrift-1.1.12.jar:commons-cli-1.1.jar:cassandra-all-1.1.12.jar org.apache.cassandra.tools.NodeCmd -h localhost -p 9192 removetoken53685600614278234503162023330018045221
After token removal, running nodetool ring should provide the following output:
<fs-host-IP1> DC1 RAC1 Up Normal 1.17 MB 100.00% 167086018864645871692761019448293152722
<fs-host-IP2> DC1 RAC2 Up Normal 1.29 MB 100.00% 26003787676682001822918611294472056316
