StarRocks is composed of three components: FE, BE, and CN. Among them, FE is essential. This document describes the logging and associated configurations for StarRocks components, including:
- Location of log storage;
- Default storage volume;
- Persisting logs;
- Logging to the console;
- Collecting logs into Datadog.
- The FE component's logs are located in:
/opt/starrocks/fe/log
, with key logs including:fe.out
,fe.log
,fe.warn.log
. - The BE component's logs are located in:
/opt/starrocks/be/log
, with key logs including:be.out
,be.INFO
,be.WARNING
. - The CN component's logs are located in:
/opt/starrocks/cn/log
, with key logs including:cn.out
,cn.INFO
,cn.WARNING
.
By default, all components use the emptyDir
storage volume. One inherent problem is that once a Pod restarts, logs
before the restart will not be accessible anymore, which obviously complicates troubleshooting. To address this, one of
two approaches can be adopted:
- Persist the logs so that logs from prior to the Pod restart remain available.
- Log to the console and view logs from prior to the restart using
kubectl logs my-pod -p
.
All component Spec definitions have a storageVolumes
field, allowing users to customize the storage volume. Taking FE
as an example:
spec:
starRocksFeSpec:
storageVolumes:
- mountPath: /opt/starrocks/fe/log
name: fe-storage-log
storageSize: 10Gi
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
If storageClassName
is left blank, the default storage class will be used. You can view available storage classes in
the Kubernetes cluster with kubectl get storageclass
. Note: selecting an appropriate storage class is crucial as it
dictates the type of storage volume. See https://kubernetes.io/docs/concepts/storage/persistent-volumes/ for more
information.
Attention: The Operator will create PVC resources for the StarRocks cluster. The storage class controller will then automatically generate the specific storage volume.
If you deployed the StarRocks cluster using Helm Chart, you can modify the values.yaml
content to persist logs. Here's
an example for the FE component:
For the kube-starrocks Helm Chart, you can configure as:
starrocks:
starrocksFESpec:
storageSpec:
name: "fe-storage"
storageSize: 10Gi
logStorageSize: 10Gi
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
For the starrocks Helm Chart, configure as:
starrocksFESpec:
storageSpec:
name: "fe-storage"
storageSize: 10Gi
logStorageSize: 10Gi
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
Note:
- In FE,
storageSize
specifies the size of the storage volume for metadata, whilelogStorageSize
designates the size of the storage volume for logs.- Fe container stop running if the storage volume free space which the fe meta residents, is less than 5Gi. Set it to at least 10GB or more.
By setting the environment variable LOG_CONSOLE = 1
, you can direct component logs to the console. Here's an example
for FE:
spec:
starRocksFeSpec:
feEnvVars:
- name: LOG_CONSOLE
value: "1"
If you've deployed the StarRocks cluster using Helm Chart, you can modify the values.yaml
content to set environment
variables. An example for the FE component:
For the kube-starrocks Helm Chart, configure as:
starrocks:
starrocksFESpec:
feEnvVars:
- name: LOG_CONSOLE
value: "1"
For the starrocks Helm Chart, configure as:
starrocksFESpec:
feEnvVars:
- name: LOG_CONSOLE
value: "1"
Refer to: Datadog.