I’m trying to set up percona server on Amazon ECS, using CloudFormation.
If I just start percona server without setting up volumes for persistence, the container starts just fine. The problem occurs only after setting volumes. Starting server always fails with following errors.
Running --initialize-insecure datadir: /var/lib/mysql/
mysqld: Can’t create/write to file ‘/var/lib/mysql/is_writable’ (Errcode: 13 - Permission denied)
2018-03-25T13:09:29.624331Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-03-25T13:09:29.624386Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-03-25T13:09:29.624523Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-25T13:09:29.625959Z 0 [ERROR] --initialize specified but the data directory exists and is not writable. Aborting.
2018-03-25T13:09:29.626041Z 0 [ERROR] Aborting
Here is my CloudFormation template to create an ECS cluster with percona-server and adminer.
If I use mysql:5.7 instead of percona/percona-server 5.7, the server starts fine. Somehow this problem only occurs with percona-server.
Probably I need to fix permissions in some way, but why the same configuration does not work on percona-server? (And how to do that on ECS’s task definition?)