How do I restore a dump file from mysqldump using kubernetes?

前端 未结 3 1135
孤城傲影
孤城傲影 2021-01-25 04:07

I know how to restore a dump file from mysqldump. Now, I am attempting to do that using kubernetes and a docker container. The database files are in persistent (nfs) mount. The

3条回答
  •  感动是毒
    2021-01-25 04:24

    What I did was this:

    • Create an NFS mount with two sub0drectories: mysql and initd.
    • In initd, I added several ,sql files, including the dump.
    • Mount initd as /docker-entrypoint-initdb.d in the deployment.This causes all the files to be read at initialisation time provided that it is the first time we run.
    • The mysql directory is mounted as /var/lib/mysql and contains all the mariaDB files.

    If I need to revert, I trash all the contents of the mysql directory and re-create the deployment.

提交回复
热议问题