Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: k8s部署tidb 设置时区问题
Yes, you can modify the timezone in the above configuration. If you want to set it to UTC+8, you can configure it as follows:
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: advanced-tidb
namespace: default
spec:
#######################
# Basic Configuration #
#######################
## TiDB cluster version
version: "v5.4.0"
## Time zone of TiDB cluster Pods
timezone: UTC+8
Directly modify the YAML file.
I followed your instructions and made the changes, but they didn’t take effect. If I create a new cluster, the changes do take effect. Is the configuration stored in the PV or somewhere else?
Edit tc found it also took effect, but executing select now; in the MySQL client still shows UTC time.
Have all the pods been rebuilt?
Rebuilt it, deleting and recreating it is the same.
Directly enter the pod and take a look.
Which pod should I enter? How do I check it?
Try running kubectl get pod --show-labels
to check.
Change both PD and server, and give it a try.
The time zone is configured when the cluster is first created. Subsequent adjustments can be made using SET GLOBAL time_zone = timezone;
This topic will be automatically closed 60 days after the last reply. No new replies are allowed.