Change the location of couchbase stats_data dir

We have a 3-node Couchbase cluster installed in the location /opt/couchbase with date storage and index storage path pointing to /u02/couchbase/data . Couchbase is writing some stats data in the location /opt/couchbase/var/lib/couchbase/stats_data which is causing the consumption of a lot of space in the root directory.

Eventually, all the space in the root directory gets occupied by these stats hence, Couchbase is unable to service any further requests.

Is there any way that we can change the location of this stats_data directory to a custom location?

Any help is greatly appreciated.

@shweta_julur Have you tried changing that directory to a symbolic link to a directory on another storage device, or making that directory into the mount point of a storage device?

@Kevin.Cherkauer I will try the symbolic link approach however, want to know the what data this stats_data directory contains, what is the significance of this data?

@shweta_julur Searching the code I find stats_dir is used by Prometheus Monitoring to store snapshots for serving(?) or from(?) the /api/v1/admin/tsdb/snapshot REST endpoint. This code is owned by the Cluster Manager team – perhaps someone from that team can chime in with more detail.

Here is Couchbase’s documentation page for the Prometheus Monitoring feature:
https://docs.couchbase.com/operator/current/tutorial-prometheus.html

Lot of stats are getting generated with .tmp on one of the couchbase node Location: /opt/couchbase/var/lib/couchbase/stats and it is occupying complete opt/couchbase filesystem
what happens if we delete .tmp files. How to housekeep them. And why these are generating very frequently with big size?

Note: my couchbase down due to some issue node with encryption. Working on it to bring up. meanwhile the opt/couchbase is getting filled…

What will happen if we delete those .tmp files

Eg:,., stats_archiver-bucket.month.gz1689248978835225_7620.tmp

Can some one help on this and let me know if we can delete those old .tmp files and keeping latest one

can someone confirm if we can delete those .tmp files

Apologies for the delay in getting back to you @kilarivijay. Yes, you should be safe to delete those .tmp files and we believe this issue is resolved already in a later version.

Hi Perry!
Could you advise in which exactly "later version " it was fixed and how?

In 7.x, we rewrote the whole statistics infrastructure which is now based on Prometheus.