Cheatsheet on clearing the Usergrid Cassandra DB for a clean Usergrid environment.
Before making changes to Cassandra, stop Usergrid. You can do this by completely shutting down tomcat
sudo service tomcat7 stop
Or you can connect to the Tomcat manager user interface and stop Usergrid. The URL for the Tomcat manager is:
http://<server>:8080/manager
Login to the system running Cassandra and run the Cassandra shell:
sudo /usr/local/cassandra/bin/cqlsh
Let's look to see that our Usergrid keyspaces are there with this command:
describe keyspaces;
which should return something like this:
"Usergrid_Applications" system_traces "Usergrid" system
Now enter these commands to remove the Usergrid keyspaces:
drop keyspace "Usergrid"; drop keyspace "Usergrid_Applications";
If you stopped Tomcat earlier, restart it with the command:
sudo service tomcat7 start
If you used the Tomcat manager, reconnect to the manager in the browser and press Start
.
Once you've restarted Tomcat and/or Usergrid use your web browser to visit the URLs below to re-initialized the database. While you do this you might want to watch the logs under tomcat/logs for clues, just in case anything goes wrong.
Database setup URL - http://localhost:8080/system/database/setup
You'll be prompted to login. Use the sysadmin credentials you entered in the usergrid properties file.
Superuser setup URL - http://localhost:8080/system/superuser/setup