View Code? Open in Web Editor
NEW
This project forked from duck105/mezzanine-docker
mezzanine app on docker
Shell 13.21%
Python 86.79%
mezzanine-docker's Introduction
Mezzanine + Mysql Master-slave replication + docker
- one machine for master and one for slave
- docker & docker-compose
- 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
- Clone the project
git clone https://github.com/duck105/mezzanine-docker.git projectdir
cd projectdir
git checkout feature/database_slave
- Set the local settings (docker-compose.yml)
- need to set server_id & master's ip
- master don't need to set MYSQL_MASTER_SERVER
- Run Docker Compose
Create database & collect static file
- Run bash interactively in the container
docker exec -it CONTAINER_NAME /bin/bash
- command:
python manage.py createdb --noinput
python manage.py collectstatic --noinput
- 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
Watchers