株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

メッセージ

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できないみたい

対策

  • いいのかはわからないけれど、起動時にいったんディレクトリをクリアする処理を入れるととりあえずは起動した
        - name: persistent-storage
          mountPath: /var/lib/mysql
        lifecycle:
          postStart:
            exec:
              command:
                - sh
                - -c
                - "rm -fr /var/lib/mysql/*"

 

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)