PhoenixAI Logging and Related Configurations
PhoenixAI is composed of two components: FE and CN. Among them, FE is essential. This document describes the logging and associated configurations for PhoenixAI components, including:
- Location of log storage;
- Default storage volume;
- Persisting logs;
- Logging to the console;
- Collecting logs into Datadog.
1. Location of Log Storage
- The FE component's logs are located in:
/opt/starrocks/fe/log, with key logs including:fe.out,fe.log,fe.warn.log. - The CN component's logs are located in:
/opt/starrocks/cn/log, with key logs including:cn.out,cn.INFO,cn.WARNING.
2. Default Storage Volume
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.
3. Persisting Logs
All component Spec definitions have a storageVolumes field, allowing users to customize the storage volume. Taking FE
as an example:
spec:
phoenixAIFeSpec:
storageVolumes:
- mountPath: /opt/starrocks/fe/log
name: fe-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 PhoenixAI cluster. The storage class controller will then automatically generate the specific storage volume.
3.1 Helm Chart Supports Persisting Logs
If you deployed the PhoenixAI 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-anywhere Helm Chart, you can configure as:
phoenixai:
phoenixAIFeSpec:
storageSpec:
name: "fe"
storageSize: 10Gi
logStorageSize: 10Gi
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
For the phoenixai Helm Chart, configure as:
phoenixAIFeSpec:
storageSpec:
name: "fe"
storageSize: 10Gi
logStorageSize: 10Gi
# storageClassName: "" # If storageClassName is not set, Kubernetes will use the default storage class.
Note:
- In FE,
storageSizespecifies the size of the storage volume for metadata, whilelogStorageSizedesignates 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.
4. Logging to the Console
By setting the environment variable LOG_CONSOLE = 1, you can direct component logs to the console. Here's an example
for FE:
spec:
phoenixAIFeSpec:
feEnvVars:
- name: LOG_CONSOLE
value: "1"
4.1 Helm Chart Supports Environment Variable Settings
If you've deployed the PhoenixAI cluster using Helm Chart, you can modify the values.yaml content to set environment
variables. An example for the FE component:
For the kube-anywhere Helm Chart, configure as:
phoenixai:
phoenixAIFeSpec:
feEnvVars:
- name: LOG_CONSOLE
value: "1"
For the phoenixai Helm Chart, configure as:
phoenixAIFeSpec:
feEnvVars:
- name: LOG_CONSOLE
value: "1"
5. Collecting Logs into Datadog
Refer to: Datadog.