简体   繁体   中英

The designated data directory MySQL is unusable

I use bitnami/mysql to use mysql in k8s. I used this command:

helm install my-sql bitnami/mysql --set global.storageClass=rook-cephfs --set image.debug=true --set auth.rootPassword="SAra131064" --set auth.username=ali --set auth.password=ali1234 --set volumePermissions.enabled=true

but I got error:

The designated data directory /bitnami/mysql/data/ is unusable

After that I use diagnosticMode and execute this command ( /opt/bitnami/scripts/mysql/entrypoint.sh /opt/bitnami/scripts/mysql/run.sh ) in pod and get that error again. before this command there isn't any file in /bitnami/mysql and

total 0
drwxrwxrwx 2 1001 1001  0 Dec 15 14:15 .
drwxr-xr-x 3 root root 19 May 11  2022 ..

After execute that command:

total 0
drwxrwxrwx 3 1001 1001  1 Dec 15 14:18 .
drwxr-xr-x 3 root root 19 May 11  2022 ..
drwxr-xr-x 2 1001 root  1 Dec 15 14:18 data

and there is auto.cnf in data directory.

What is the problem? What should I do? Please help me

2022-12-15T14:21:00.199807Z 1 [Warning] [MY-012582] [InnoDB] io_setup() failed with EAGAIN. Will make 5 attempts before giving up.
2022-12-15T14:21:00.199888Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 1.
2022-12-15T14:21:00.700312Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 2.
2022-12-15T14:21:01.200805Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 3.
2022-12-15T14:21:01.701219Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 4.
2022-12-15T14:21:02.201614Z 1 [Warning] [MY-012583] [InnoDB] io_setup() attempt 5.
2022-12-15T14:21:02.702315Z 1 [ERROR] [MY-012584] [InnoDB] io_setup() failed with EAGAIN after 5 attempts.
2022-12-15T14:21:02.702619Z 1 [ERROR] [MY-012954] [InnoDB] Cannot initialize AIO sub-system
2022-12-15T14:21:02.702731Z 1 [ERROR] [MY-012929] [InnoDB] InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2022-12-15T14:21:02.703266Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-12-15T14:21:02.703342Z 0 [ERROR] [MY-013236] [Server] The designated data directory /bitnami/mysql/data/ is unusable. You can remove all files that the server added to it.
2022-12-15T14:21:02.703591Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-12-15T14:21:02.704631Z 0 [System] [MY-010910] [Server] /opt/bitnami/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.29)

Disabling the innodb_use_native_aio as your storage doesn't support it.

Add this to your my_custom.cnf file like:

[mysqld]
innodb_use_native_aio=0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM