Riak KV: how to reinitialize data directories

1.4k Views Asked by At

Is it possible to "recreate"/"reinitialize" all data directories for database riak? I don't need to keep data - just to start from 0. If yes, how to do it?

2

There are 2 best solutions below

6
vempo On

Depending on the backend you are using, you may just stop Riak (riak stop), delete the data directory (usually under /var/lib/riak/bitcask or /var/lib/riak/leveldb) and start Riak (riak start). Riak should be able to start normally. If you are running a cluster, clean up all node of the cluster prior to starting them up, so that the data don't get re-populated from replicas.

Check out the Backing Up page, it will help you understand how Riak data directories work.

Clarification: The described procedure is for Riak KV and may not apply to other Riak products (e.g. Riak TS).

0
Mayank Patel On

I ran across this issue with Riak TS 1.5.2.

I was able to clear all tables on my development host (MacOSX) by stopping RiakTS and then removing the top-level data directory. When I restarted RiakTS, it recreated and reinitialized the data directory.

This is not an ideal development flow. I really hope Basho is able to add support for DROP TABLE construct.