Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replication support added #1093

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alysrylcn01
Copy link

@alysrylcn01 alysrylcn01 commented Oct 28, 2024

Tested on 8.0 folder

Example Master Usage

version: '3.8'

services:
  mysql:
    image: my-mysql-main-branch-test:latest
    container_name: master-mysql-test
    environment:
      MYSQL_ROOT_PASSWORD: password1
      MASTER_SLAVE_ROLE: MASTER
      MYSQL_REPLICATION_USER: REP_USER
      MYSQL_REPLICATION_PASSWORD: reppassword
    ports:
      - "3306:3306"
    restart: unless-stopped
    networks:
      - mysql_net

networks:
  mysql_net:
    external: true

And Slave;

version: '3.8'

services:
  mysql:
    image: my-mysql-main-branch-test:latest
    container_name: slave1-mysql-test
    environment:
      MYSQL_ROOT_PASSWORD: password1
      MASTER_SLAVE_ROLE: SLAVE
      MYSQL_MASTER_SERVICE_HOST: master-mysql-test
      MYSQL_REPLICATION_USER: REP_USER
      MYSQL_REPLICATION_PASSWORD: reppassword
    ports:
      - "3307:3306"
    restart: unless-stopped
    networks:
      - mysql_net

networks:
  mysql_net:
    external: true

@tianon
Copy link
Member

tianon commented Oct 28, 2024

I'm glad you were able to make this work for your use case! Unfortunately, this is not code we want to maintain.

The good news is that the entrypoint script is explicitly designed such that you can source it in a new script and re-use the functions to implement your own logic like this without too much overhead/maintenance burden (essentially just maintaining your new functionality; see #471 and docker-library/postgres#496 for details).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants