optscale icon indicating copy to clipboard operation
optscale copied to clipboard

is there a way to clear all the tables and run the migrations freshly in mongodb

Open saileshsp opened this issue 1 year ago • 1 comments

i changed the mongod collection path to symlink due to that facing some issues like below pymongo.errors.DuplicateKeyError: E11000 duplicate key error collection: restapi.raw_expenses index

DB::Exception: Table default.expenses doesn't exist. Stack trace:

  1. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, bool) @ 0x9451d1a in /usr/bin/clickhouse
  2. DB::Exception::Exception<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&&) @ 0x9580c83 in /usr/bin/clickhouse cloud_accounts?details=true api getting failed

wanted to know is there a way to reset db and start freshly or somesolution to fix this issues

saileshsp avatar Aug 06 '24 05:08 saileshsp

Hi @saileshsp, to clear all the tables in db, if you do not have important information on your cluster which you would like to save I recommend you to perform next steps:

  1. Delete cluster using runkube.py with -d flag(you can use command which you use to start the cluster and add "-d" after ./runkube.py)
  2. Delete /optscale folder
  3. Start runkube.py again like you do to start the cluster

All data bases will be cleaned and you will have new cluster

stanfra avatar Aug 07 '24 05:08 stanfra