gabriele-mastrapasqua / docker-percona-xtradb-cluster-57

docker percona xtradb cluster 5.7 with proxysql on swarm mode
10 stars 8 forks source link

Can't create/write to file '/var/lib/mysql/is_writable' #1

Open stevenmunro opened 5 years ago

stevenmunro commented 5 years ago

I'm getting the following error in both docker-compose up and swarm mode for the percona-xtradb-cluster containers.

    Running --initialize-insecure on /var/lib/mysql/,
    total 4.0K,
    drwxr-xr-x 1 root root    0 Jan 21 21:21 .,
    drwxr-xr-x 1 root root 4.0K Jan  4 10:11 ..,
    mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (Errcode: 13 - Permission denied),
    2019-01-21T21:22:44.144657Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. 
    Please use --explicit_defaults_for_timestamp server option (see documentation for more details).,
    2019-01-21T21:22:44.144775Z 0 [Warning] WSREP: Node is running in bootstrap/initialize mode. 
    Disabling pxc_strict_mode checks,
    2019-01-21T21:22:44.146614Z 0 [ERROR] --initialize specified but the data directory exists and is 
    not writable. Aborting.,
    2019-01-21T21:22:44.146694Z 0 [ERROR] Aborting,
stevenmunro commented 5 years ago

It appears that the official docker images now run as the mysql user, not the root user.

Further information about the breaking change here

I'm currently searching for a solution.

shudipta commented 5 years ago

Same error from me when I use percona/percona-xtradb-cluster:5.7.25 as container image of a Statefulset in Kubernetes.

Need an urgent solution.

alextesi commented 2 years ago

Simply solution:

chown 1001:1001 /var/lib/mysql/ -R

It worked for me. Let me know if it works for you. Thanks Alessandro

PS: i think we can close this issue!!