Docker MariaDB cannot use mount NAS folder

Hi everyone,

Im having issue when trying to mount a folder from NAS to use when deploying mariadb.

  • I have a folder share in another machine: //10.2.2.2/shared_folder/
  • Create a volume:
    docker volume create --driver local --opt type=cifs --opt device=//10.2.2.2/shared_folder/mariadb --opt o=username=nas,password=naspassword,file_mode=0777,dir_mode=0777 --name mariadbVolume
  • docker run using that volume
    docker run -p 3306:3306 --name mariadb-test -e MYSQL_ROOT_PASSWORD=“abcxyz” --mount source=mariadbVolume,target=/var/lib/mysql --rm mariadb:latest

ERROR:
2023-05-16 04:36:26+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.2+maria~ubu2204 started.
2023-05-16 04:36:26+00:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2023-05-16 04:36:26+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.2+maria~ubu2204 started.
2023-05-16 04:36:26+00:00 [Note] [Entrypoint]: Initializing database files
2023-05-16 4:36:26 0 [Warning] mariadbd: io_uring_queue_init() failed with ENOMEM: try larger memory locked limit, ulimit -l, or systemd - MariaDB Knowledge Base under systemd (262144 bytes required)
2023-05-16 4:36:26 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
2023-05-16 4:36:26 0 [Warning] InnoDB: Retry attempts for writing partial data failed.
2023-05-16 4:36:26 0 [ERROR] InnoDB: Write to file ./ibdata1 failed at offset 0, 1048576 bytes should have been written, only 0 were written. Operating system error number 22. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.
2023-05-16 4:36:26 0 [ERROR] InnoDB: Error number 22 means ‘Invalid argument’
2023-05-16 4:36:26 0 [ERROR] InnoDB: Could not set the file size of ‘./ibdata1’. Probably out of disk space
2023-05-16 4:36:26 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2023-05-16 4:36:26 0 [ERROR] Plugin ‘InnoDB’ init function returned error.
2023-05-16 4:36:26 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2023-05-16 4:36:26 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-05-16 4:36:26 0 [ERROR] Aborting

Other image like nginx, ipam, gitlab worked, only mariadb failed. I tried on another machine, everything from scratch but still fail.

Any suggestion please?

Thanks

It will not work with a cifs share. It should work with a nfsv4 share.

In general database vendors discourage to store the database state on remote shares.

1 Like

Thanks @meyay, I will have a look at nfsv4.