i am deployed my crate db in kubernetes service using below yaml file
i set the volume as
volumeClaimTemplates:
# Use persistent storage.
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storage is 1Gi . now i noticed that , my total volume usage is reached due to crate db log files.
there is 16 log files and total size is 877 Mb. how do i rotate the log based on size.?
How to i set log rotation in yaml?
How to rotate weekly>
could you please help this?
when i enter into the kubernetes pod following values are get
kubectl exec -it crate-1 -- ./../bin/bash
[root@crate-1 data]# cd log
[root@crate-1 log]# ls -ltr
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.01
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.11
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.12
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.13
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.14
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.15
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.02
-rw-r--r-- 1 crate crate 64M Jun 16 04:38 gc.log.04
-rw-r--r-- 1 crate crate 64M Jun 16 04:38 gc.log.03
-rw-r--r-- 1 crate crate 62M Jun 16 04:38 gc.log.05
-rw-r--r-- 1 crate crate 63M Jun 16 04:38 gc.log.06
-rw-r--r-- 1 crate crate 60M Jun 16 04:38 gc.log.07
-rw-r--r-- 1 crate crate 42M Jun 16 04:38 gc.log.08
-rw-r--r-- 1 crate crate 65M Jun 16 08:27 gc.log.10
-rw-r--r-- 1 crate crate 11M Jun 16 08:53 gc.log.0
-rw-r--r-- 1 crate root 2.9M Jun 16 09:12 gc.log
Then i edit the statefulset of crate controller and
below is values based on below link
then my vaules are
# Environment variables passed through to the container. env: # This is variable is detected by CrateDB. - name: CRATE_GC_LOG_SIZE value: "10m" - name: CRATE_GC_LOG_FILES value: 3 - name: CRATE_HEAP_SIZE value: "256m"
Then i delete the old log file.
but when a new file created . it have more thatn 10mb and created more than 3 files