-
Notifications
You must be signed in to change notification settings - Fork 5
Fix broken SQL indents and run init.sh only once #2
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
base: master
Are you sure you want to change the base?
Changes from 5 commits
2aa77ea
85687e8
e115bd6
51eeffa
2b5db6a
5a3c5e8
7e4fd18
0b43da4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,10 @@ | |
|
|
||
| > MariaDB 10.3 dockerized with replication. Master/Slave setup in 30 seconds. | ||
|
|
||
| > Added features for Docker swarm setups | ||
|
|
||
| ## How to use | ||
|
|
||
| ### Docker run | ||
|
|
||
| @TODO | ||
|
|
||
| ### Docker compose | ||
|
|
||
| Example docker-compose.yml for mariadb replication: | ||
|
|
@@ -18,7 +15,7 @@ version: '3' | |
|
|
||
| services: | ||
| db-master: | ||
| image: caffeina/mariadb-replication | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @db260179, why force users to build the image when they can use the one already built? |
||
| image: *your docker registry* | ||
| restart: always | ||
| volumes: | ||
| - db-master-data:/var/lib/mysql:rw | ||
|
|
@@ -27,7 +24,7 @@ services: | |
| MYSQL_ROOT_PASSWORD: "mastersecret" | ||
|
|
||
| db-slave: | ||
| image: caffeina/mariadb-replication | ||
| image: *your docker registry* | ||
| restart: always | ||
| depends_on: | ||
| - db-master | ||
|
|
@@ -44,16 +41,14 @@ volumes: | |
| db-slave-data: | ||
| ``` | ||
|
|
||
| @TODO | ||
|
|
||
| ```bash | ||
| $ docker-compose up | ||
| ``` | ||
|
|
||
| @TODO | ||
| # Build and run | ||
|
|
||
| ```bash | ||
| $ docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build | ||
| $ docker-compose -f docker-compose.yml up --build | ||
| ``` | ||
|
|
||
|
|
||
|
|
@@ -63,7 +58,7 @@ The `mariadb-replication` image is an extension of `mariadb:10.3`, you can use a | |
|
|
||
| ### Enviroment variables | ||
|
|
||
| @TODO Sets the connection parameters to the master. The `MYSQL_MASTER_HOST` variable is required. | ||
| Sets the connection parameters to the master (for slave container). The `MYSQL_MASTER_HOST` variable is required. | ||
|
|
||
| ```yaml | ||
| MYSQL_MASTER_HOST: "db-master" | ||
|
|
@@ -72,27 +67,21 @@ MYSQL_MASTER_USER: "root" # (Optional) Default: 'root' | |
| MYSQL_MASTER_PASSWORD: "secret" # (Optional) Default: '' | ||
| ``` | ||
|
|
||
| @TODO The generated user and password will be printed to stdout. | ||
| The generated user and password will be printed to stdout. | ||
|
|
||
| ```yaml | ||
| MYSQL_GRANT_SLAVE_USER: "user" # (Optional) Default: *RANDOM STRING* | ||
| MYSQL_GRANT_SLAVE_PASSWORD: "secret" # (Optional) Default: *RANDOM STRING* | ||
| ``` | ||
|
|
||
| @TODO | ||
|
|
||
| ```yaml | ||
| SERVER_ID: 2 # (Optional) Default: *RANDOM INT* | ||
| ``` | ||
|
|
||
| @TODO | ||
|
|
||
| ```yaml | ||
| EXPIRE_LOGS_DAYS: 5 # (Optional) Default: '10' | ||
| ``` | ||
|
|
||
| @TODO | ||
|
|
||
| ```yaml | ||
| MAX_BINLOG_SIZE: "50M" # (Optional) Default: '100M' | ||
| ``` | ||
|
|
@@ -109,30 +98,3 @@ MYSQL_SLAVE_SKIP_ERRORS: "all" # (Optional) Default: 'OFF' | |
| - Add `innodb-read-only` parameter (Service restart on first run is needed); | ||
| - Move `/etc/mysql/conf.d/master-slave.cnf` in other path (So the user can bind a volume to `/etc/mysql/conf.d/` for custom configuration); | ||
| - Permit replication on existing database. | ||
|
|
||
|
|
||
| ## Contributing | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @db260179, please leave this section in README file.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are yes, sorry didn't realise I took it out |
||
|
|
||
| How to get involved: | ||
|
|
||
| 1. [Star](https://github.com/gadiener/docker-mariadb-replication/stargazers) the project! | ||
| 2. Answer questions that come through [GitHub issues](https://github.com/gadiener/docker-mariadb-replication/issues?state=open) | ||
| 3. [Report a bug](https://github.com/gadiener/docker-mariadb-replication/issues/new) that you find | ||
|
|
||
| This project follows the [GitFlow branching model](http://nvie.com/posts/a-successful-git-branching-model). The ```master``` branch always reflects a production-ready state while the latest development is taking place in the ```develop``` branch. | ||
|
|
||
| Each time you want to work on a fix or a new feature, create a new branch based on the ```develop``` branch: ```git checkout -b BRANCH_NAME develop```. Only pull requests to the ```develop``` branch will be merged. | ||
|
|
||
| Pull requests are **highly appreciated**. | ||
|
|
||
| Solve a problem. Features are great, but even better is cleaning-up and fixing issues in the code that you discover. | ||
|
|
||
|
|
||
| ## Versioning | ||
|
|
||
| This project is maintained by using the [Semantic Versioning Specification (SemVer)](http://semver.org). | ||
|
|
||
|
|
||
| ## Copyright and license | ||
|
|
||
| Copyright 2017 [Caffeina](http://caffeina.com) srl under the [MIT license](LICENSE.md). | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @db260179,
the mariadb image already runs the scripts inserted in
/docker-entrypoint-initdb.d/once, see: https://github.com/docker-library/mariadb/blob/44cfe68144976ce0ec135593ffe15c4bcca0dc6f/10.3/docker-entrypoint.sh#L80.So you do not need to manually check in the entrypoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, so no need for that change.
I've added a commit to allow the master to confirm to the slave its ready to start. Although you have a 30 second count down it isn't that reliable and relying on the depends_on is not a good method especially on docker swarm