hystax / optscale

FinOps, MLOps and cloud cost optimization tool. Supports AWS, Azure, GCP, Alibaba Cloud and Kubernetes.
https://hystax.com
Apache License 2.0
1.18k stars 165 forks source link

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

Closed saileshsp closed 4 weeks ago

saileshsp commented 1 month ago

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

stanfra commented 1 month ago

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