Kubernetes上的Redis企业软件日志

本节提供有关日志如何存储和访问的信息。

日志

每个redis-enterprise容器将其日志存储在/var/opt/redislabs/log下。 当使用持久存储时,此路径会自动挂载到redis-enterprise-storage卷。 这个卷可以很容易地通过一个sidecar访问,即位于同一个pod上的容器。

例如,在REC(Redis企业集群)规范中,您可以添加一个sidecar容器,例如busybox,并将日志挂载到那里:

sideContainersSpec:
  - name: busybox
    image: busybox
    args:
      - /bin/sh
      - -c
      - while true; do echo "hello"; sleep 1; done

    volumeMounts:
    - name: redis-enterprise-storage
      mountPath: /home/logs
      subPath: logs

现在可以从边车访问日志。例如,通过运行

kubectl exec -it <pod-name> -c busybox tail home/logs/supervisord.log

边车容器由用户决定,可用于以指定的格式和协议格式化、处理和共享日志。

RATE THIS PAGE
Back to top ↑