メッセージ
1 2 3 4 5 6 7 8 |
yuta:~ $ kubectl logs mysql-56f96469ff-8rwjv 2020-10-01 11:25:43+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started. 2020-10-01 11:25:44+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2020-10-01 11:25:44+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started. 2020-10-01 11:25:44+00:00 [Note] [Entrypoint]: Initializing database files 2020-10-01T11:25:44.094657Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2020-10-01T11:25:44.095833Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting. 2020-10-01T11:25:44.095860Z 0 [ERROR] Aborting |
原因
–/var/lib/mysql
内になにかあると、initializeできないみたい
対策
- いいのかはわからないけれど、起動時にいったんディレクトリをクリアする処理を入れるととりあえずは起動した
1 2 3 4 5 6 7 8 9 |
- name: persistent-storage mountPath: /var/lib/mysql lifecycle: postStart: exec: command: - sh - -c - "rm -fr /var/lib/mysql/*" |