Overview:
By default, we retain only the last 7 days of system metrics under the Stats menu. However, if there is a need to retain and display more than 7 days there are modifications that we can make to achieve this. In this example we will up retention to 40 days.
Action:
The initial consideration here is to understand that this will consume more disk space.
Step 1: Run the below command to check the current size of the relevant files:
du -h -d 2 /opt/gpudb/stats/graphite/
Here is what we get for the default 7 days:
[localhost]# du -h -d 2 /opt/gpudb/stats/graphite/
storage-* 4.0K /opt/gpudb/stats/graphite/<hostname>/lists
12K /opt/gpudb/stats/graphite/<hostname>/log/webapp
16K /opt/gpudb/stats/graphite/<hostname>/log
1.9M /opt/gpudb/stats/graphite/<hostname>/whisper/carbon
242M /opt/gpudb/stats/graphite/<hostname>/whisper/gpudb
244M /opt/gpudb/stats/graphite/<hostname>/whisper
4.0K /opt/gpudb/stats/graphite/<hostname>/rrd
244M /opt/gpudb/stats/graphite/<hostname>
Step 2: Edit the following file: /opt/gpudb/stats/graphite/
Give these parameters, changing 7d
to 40d
for each:
[carbon]
pattern = ^carbon\.
retentions = 60s:40d
[gpudb]
pattern = ^gpudb\.
retentions = 10s:40d
[stats]
pattern = ^stats\.
retentions = 10s:40d
[generic]
pattern = .*\.
retentions = 60s:40d
Step 3:
Clear the existing stats by running:/opt/gpudb/stats/gpudb-stats.
Step 4:
Restart the gpudb service, not sufficient to restart just stats:service gpudb restart
Step 5:
Verify the file size has increased using the same command as Step 1. With 40 days configured we now see:
[localhost]# du -h -d 2 /opt/gpudb/stats/graphite/
storage-* 4.0K /opt/gpudb/stats/graphite/<hostname>/lists
12K /opt/gpudb/stats/graphite/<hostname>/log/webapp
16K /opt/gpudb/stats/graphite/<hostname>/log
11M /opt/gpudb/stats/graphite/<hostname>/whisper/carbon
1.4G /opt/gpudb/stats/graphite/<hostname>/whisper/gpudb
1.4G /opt/gpudb/stats/graphite/<hostname>/whisper
4.0K /opt/gpudb/stats/graphite/<hostname>/rrd
1.4G /opt/gpudb/stats/graphite/<hostname>
Should you have any questions or concerns, please visit our Official Documentation and Support Page.
0 Comments