add bootstrap command block
This commit is contained in:
parent
fa2c1614b0
commit
0fefed7bfa
1 changed files with 11 additions and 1 deletions
|
|
@ -9,11 +9,20 @@ services:
|
|||
- MARIADB_USER=${DB_ADMIN_USER}
|
||||
- MARIADB_PASSWORD=${DB_ADMIN_PASSWORD}
|
||||
- MARIADB_DATABASE=initial_db
|
||||
- BOOTSTRAP=${FIRST_DB_TOGGLE}
|
||||
volumes:
|
||||
- /docker/maria/data:/var/lib/mysql
|
||||
- /docker/maria/conf:/etc/mysql/conf.d
|
||||
- /docker/maria/init:/docker-entrypoint-initdb.d
|
||||
command:
|
||||
command: >
|
||||
bash -c '
|
||||
if [ "$BOOTSTRAP" = "true" ] && [ ! -d /var/lib/mysql/mysql ]; then
|
||||
echo "Bootstrapping first node";
|
||||
mysqld --wsrep-new-cluster
|
||||
else
|
||||
echo "Starting normal node";
|
||||
mysqld
|
||||
fi
|
||||
- mariadbd
|
||||
- --wsrep-on=ON
|
||||
- --wsrep-provider=/usr/lib/galera/libgalera_smm.so
|
||||
|
|
@ -28,6 +37,7 @@ services:
|
|||
- --wsrep-sst-auth=sstuser:${REPL_PASSWORD}
|
||||
# No manual weights needed anymore. Default weight=1 is perfect.
|
||||
- --wsrep-provider-options=pc.ignore_sb=true;pc.npvo=true
|
||||
|
||||
|
||||
|
||||
# Pass these through for the init script
|
||||
|
|
|
|||
Loading…
Reference in a new issue