docker-mysql-master-slave icon indicating copy to clipboard operation
docker-mysql-master-slave copied to clipboard

FIX: #6 Add logs folder mount

Open sarbesh opened this issue 2 years ago • 4 comments

Migrated log_bin and replay-log from /var/log/mysql to /var/lib/mysql as mysql:5.7 doesn't contain the /var/log/mysql folder.

reference: https://stackoverflow.com/questions/26648821/how-can-i-enable-mysql-binary-logging-using-the-official-docker-image

sarbesh avatar Aug 28 '22 07:08 sarbesh

@vbabak @renanbenedicto please help verify the changes and approve the PR.

sarbesh avatar Aug 31 '22 06:08 sarbesh

Reverted back to original config for logs in the /var/log/mysql folder by adding volume mount as suggested in #6 by @matdurand.

also made some other changes like:

  1. Added healthcheck for master and updated client depends on master to be healthy.
  2. Updated .gitignore with logs folder

@vbabak @renanbenedicto please help review

sarbesh avatar Sep 18 '22 04:09 sarbesh

@sarbesh I think you should add the 2 empty "logs" folder, with a .gitkeep file inside to make sure they exists when we checkout and start the docker-compose setup.

matdurand avatar Sep 19 '22 18:09 matdurand

@vbabak @matdurand the logs folder is auto created when running the build.sh. should we still create logs folder with .gitkeep.

sarbesh avatar Sep 20 '22 04:09 sarbesh

@sarbesh I don't see anything that creates the log folder in the build.sh file. If they are created when we start docker compose, then it's too late to map them is it not?

matdurand avatar Sep 21 '22 15:09 matdurand

@matdurand yes I believe the folders are getting created when docker compose is ran, We can still add the logs folder with .gitkeep to be on safe side.

sarbesh avatar Sep 21 '22 16:09 sarbesh

@sarbesh I would add "logs" folder similar to "data", including ".gitkeep". Could you also update build.sh and add logs cleanup?

vbabak avatar Jan 16 '23 21:01 vbabak

@vbabak apologies for the delay. Made the changes as requested above. Please review.

sarbesh avatar Feb 11 '23 07:02 sarbesh