Code Monkey home page Code Monkey logo

mezzanine-docker's Introduction

Mezzanine + Mysql Master-slave replication + docker

Prepare

  1. one machine for master and one for slave
  2. docker & docker-compose
  3. open 3306 port
    • iptables -t filter -A INPUT -p tcp --sport 3306 -j ACCEPT
    • iptables -t filter -A OUTPUT -p tcp --dport 3306 -j ACCEPT

Installation

  1. Clone the project
    • git clone https://github.com/duck105/mezzanine-docker.git projectdir
    • cd projectdir
    • git checkout feature/database_slave
  2. Set the local settings (docker-compose.yml)
    • need to set server_id & master's ip
    • master don't need to set MYSQL_MASTER_SERVER
  3. Run Docker Compose
    • docker-compose up

Create database & collect static file

  1. Run bash interactively in the container
    • docker exec -it CONTAINER_NAME /bin/bash
  2. command:
    • python manage.py createdb --noinput
    • python manage.py collectstatic --noinput

Done

  • Then we have a set of master-slave web service
  • Open the browser and go to http://[master's ip] or http://[slave's ip]
  • Create blog on master's web & check it has been replicated to the slave

mezzanine-docker's People

Contributors

s123unny avatar duck105 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.