yobasystems / alpine-mariadb

MariaDB running on Alpine Linux [Docker]
https://hub.docker.com/r/yobasystems/alpine-mariadb/
242 stars 72 forks source link

NFS volume fail starts #34

Closed marcopgordillo closed 4 years ago

marcopgordillo commented 5 years ago

Hello everybody, please help me with this installation of this image with this configuration: docker-compose.yml

version: "3"
services:
  mysql:
      image: yobasystems/alpine-mariadb
      volumes:
        - "nfsdb:/var/lib/mysql/"
      networks:
        - backend
      environment:
        MYSQL_ROOT_PASSWORD: somewordpress
        MYSQL_DATABASE: wordpressdb
        MYSQL_USER: wordpress
        MYSQL_PASSWORD: mariadb_root
volumes:
  nfsdb:
    driver: local
    driver_opts:
      type: nfs
      o: addr=storage01,hard,nolock,rw
      device: ":/shared/disk02"
networks:
  backend:
    driver: bridge

On NFS server I have:

/etc/exports
/shared/disk02           192.168.122.0/24(rw,async,no_wdelay,crossmnt,no_root_squash,insecure_locks,sec=sys,no_subtree_check)

NFS permissions server:

drwxr-sr-x  2 _apt   systemd-journal  4096 Oct 22 10:55 disk02

my initial permissions was: chown -R nobody:nogroup disk02 && chmod 777 disk02 When I try to run with docker-compose I have this error log and the data base don't start: Log error:

[i] mysqld not found, creating....
[i] MySQL data directory not found, creating initial DBs
2019-10-22 14:55:34 0 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
2019-10-22 14:55:34 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2019-10-22 14:55:35 0 [ERROR] Plugin 'InnoDB' init function returned error.
2019-10-22 14:55:35 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-10-22 14:55:35 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-10-22 14:55:35 0 [ERROR] Aborting

I'm using debian 10 buster as NFS server and my PC is ubuntu 18.04 with docker version 8.09.5

Thanks for advance.

dominictayloruk commented 5 years ago

There could be a couple of issues here;

  1. On your docker host, NOT the nfs server have you installed nfs-common & nfs-client?

    sudo apt update && sudo apt upgrade -y
    sudo apt install nfs-common
  2. On your docker host, check it can access your NFS server;

    ping storage01
  3. On your NFS host try the following;

    sudo chown nobody:nogroup /shared/disk02
    sudo chmod 777 /shared/disk02

Failing all of these then you'll need to do some extra research as it really isn't this docker image at fault, it's your underlying system.

Also i can say that this image works perfectly with NFS storage as thats how i run it in production.

marcopgordillo commented 5 years ago

Hi @dominictayloruk, thanks for your response, I already have installed this dependencies and updated the system the NFS server and docker server and the permissions that you say.

apt search nfs-common
Sorting... Done
Full Text Search... Done
nfs-common/stable,now 1:1.3.4-2.5 amd64 [installed]
  NFS support files common to client and server

Maybe can you show me an example about your configuration with NFS, please.

dominictayloruk commented 4 years ago

Did you manage to resolve this?

Nisgrak commented 4 years ago

I have the same error.

My enviroment has WSL, maybe it be related.