goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.94k stars 4.74k forks source link

how to reset dababase? #6038

Closed xiaochenluo closed 5 years ago

xiaochenluo commented 6 years ago

I choose OSS as storage first, then I found its performance unsatisfactory. So I changed storge to filesystem. But, I met a problem. To detect the push speed between OSS and Filesystem, I have deleted all the data in OSS dashboard(some log files and some image layer files which from an unsuccessful push). Then I pushed the same image to harbor(filesystem), and I received 500 error. After check logs, I found harbor attempt to search the data pushed before which have been deleted. So, how to reset the registry database? Or , the only choice to me is reinstall the harbor? Or, is there an API to delete layers which is come from failed push?

reasonerjt commented 6 years ago

For your case, so far you'll have to manually remove all data in the DB.

reasonerjt commented 6 years ago

@xiaochenluo Could you confirm you just want to remove the data about repository? If that's the case, here's a internal used env var you can try: https://github.com/goharbor/harbor/blob/master/make/common/templates/core/env#L9

After setting it to true Harbor will call registry's API and sync the data to repository table during restart.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.