Evaluation failed: unknown or incorrect time zone: Asia/Beijing

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: evaluation failed: unknown or incorrect time zone: Asia/Beijing"

| username: TiDBer_6dAQuhFo

UOS Tongxin operating system simulates the deployment of a production environment cluster on a single machine, reporting a time zone error.

| username: TiDBer_6dAQuhFo | Original post link

The time zone has already been set on the operating system, but it still doesn’t work.

| username: shigp_TIDBER | Original post link

show variables like ‘%time_zone%’;

| username: TiDBer_6dAQuhFo | Original post link

I did not install the MySQL database, this is the first time deploying a cluster environment.

| username: 像风一样的男子 | Original post link

There is no Beijing time zone in the international time zones, just change it to Shanghai.
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

| username: TiDBer_6dAQuhFo | Original post link

I made the change, but it still doesn’t work.

| username: 像风一样的男子 | Original post link

I remember that the Tongxin server has a desktop where you can visually modify the time zone, or you can try restarting the server.

| username: TiDBer_6dAQuhFo | Original post link

I don’t have a desktop, and after restarting, it’s still the same :joy:

| username: DBAER | Original post link

tiup cluster check ./topology.yaml --user root [-p] [-i /home/root/.ssh/gcp_rsa]

Can it be automatically fixed? Try this:
tiup cluster check ./topology.yaml --apply --user root [-p] [-i /home/root/.ssh/gcp_rsa]

| username: 呢莫不爱吃鱼 | Original post link

I used the command timedatectl set-timezone Asia/Shanghai. I encountered this issue before and tried many commands.

| username: TiDBer_6dAQuhFo | Original post link

I have tried this as well, but it doesn’t work.

| username: Jasper | Original post link

Did you get an error when running tiup cluster check? Please paste the command result so we can take a look.

| username: Jasper | Original post link

You can also try upgrading tiup to the new version.

| username: yytest | Original post link

Set the time zone of the operating system.