728x90
반응형
timezone 변경
default-timzone으로 변경하면 tz 자체가 변경되고
extraEnvVar로 설정하면, system_time_zone이 변경되고, tz이 system을 따라간다는것을 확인함
방법1: default-timezone primary: configuration: |- [mysqld] default-time-zone='+9:00' |
방법2: extraEnv로 적용 extraEnvVars: - name: TZ value: "Asia/Seoul" #"UTC" |
MariaDB [(none)]> show variables like '%time_zone%'; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | UTC | | time_zone | +09:00 | +------------------+--------+ 2 rows in set (0.001 sec) |
MariaDB [db_pqe]> show variables like '%time_zone%'; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | KST | | time_zone | SYSTEM | +------------------+--------+ 2 rows in set (0.001 sec) |
방법1: default-timezone
values.yaml
#primary, secondary 모두 추가
[mysqld] 섹션에 다음을 추가(수정)
default-time-zone=Asia/Seoul
primary:
command: []
args: []
lifecycleHooks: {}
hostAliases: []
configuration: |-
[mysqld]
default-time-zone='+9:00'
secondary:
command: []
args: []
lifecycleHooks: {}
hostAliases: []
configuration: |-
[mysqld]
default-time-zone='+9:00'
업데이트
$ helm upgrade --install mariadb-20220222 hgkim/mariadb -n mariadb -f values.yaml --debug --insecure-skip-tls-verify
MariaDB [(none)]> select now();
+---------------------+
| now() |
+---------------------+
| 2022-02-23 10:46:03 |
+---------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone, @@system_time_zone;
+--------------------+---------------------+--------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone | @@system_time_zone |
+--------------------+---------------------+--------------------+
| +09:00 | +09:00 | UTC |
+--------------------+---------------------+--------------------+
1 row in set (0.000 sec)
MariaDB [(none)]> show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | UTC |
| time_zone | +09:00 |
+------------------+--------+
2 rows in set (0.001 sec)
방법2: extraEnv로 적용
values.yaml
#extraEnvVars: []
extraEnvVars:
- name: TZ
value: "Asia/Seoul" #"UTC"
#extraEnvVars: []
extraEnvVars:
- name: TZ
value: "Asia/Seoul" #"UTC"
업데이트
$ helm upgrade --install mariadb-20220222 hgkim/mariadb -n mariadb -f values.yaml --debug --insecure-skip-tls-verify --set auth.replicationPassword=mysql
$ k get all -n mariadb
NAME READY STATUS RESTARTS AGE
pod/mariadb-20220222-primary-0 1/1 Running 0 52s
pod/mariadb-20220222-secondary-0 1/1 Running 0 52s
$ k exec -it pod/mariadb-20220222-primary-0 -n mariadb -n mariadb -- /bin/sh
MariaDB [db_pqe]> select now();
+---------------------+
| now() |
+---------------------+
| 2022-02-22 18:01:45 |
+---------------------+
1 row in set (0.000 sec)
MariaDB [db_pqe]> show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | KST |
| time_zone | SYSTEM |
+------------------+--------+
2 rows in set (0.001 sec)
MariaDB [db_pqe]> SELECT @@GLOBAL.time_zone, @@SESSION.time_zone, @@system_time_zone;
+--------------------+---------------------+--------------------+
| @@GLOBAL.time_zone | @@SESSION.time_zone | @@system_time_zone |
+--------------------+---------------------+--------------------+
| SYSTEM | SYSTEM | KST |
+--------------------+---------------------+--------------------+
설치는 아래 링크
https://mightytedkim.tistory.com/58
728x90
반응형
'Storage > mariadb' 카테고리의 다른 글
Kubernetes) helm mariadb innodb recovery 하기 (1) | 2022.09.21 |
---|---|
Mariadb) binary 파일 정리하기_k8s에서 pvc 넘침 (0) | 2022.04.28 |
mariadb) pvc 부족으로 인한 fail -> binary 파일이 원인 (0) | 2022.04.15 |
Kubernetes)Mariadb 설치_helm (0) | 2022.02.23 |