Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/auto-clustering/auto-cluster.jps
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description:
healthcheck and autodiscovery of newly added DB nodes
short: Scalable MySQL cluster with ProxySQL for even load distribution

baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0
baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/stage-cluster

logo: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master/images/mysql-logo.png

Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ logo: /images/mysql-mariadb-percona-logo.png?_r=1

onBeforeInit: /scripts/settings.js?_r=${fn.random}

baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0
baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/stage-cluster

settings:
fields:
Expand Down
2 changes: 1 addition & 1 deletion scripts/common.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
globals:
db_cluster_path: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0
db_cluster_path: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/stage-cluster
customConfigFile: /etc/mysql/conf.d/my_custom.cnf

actions:
Expand Down
14 changes: 13 additions & 1 deletion scripts/master-master.jps
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: mysql-master-master-replication-cluster
name: MySQL/MariaDB/Percona Primary-Primary Replication Database Cluster
description: 'DB Auto Clustering: 1 x Primary + N x Secondary'

baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0
baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/stage-cluster

success:
text: /texts/phpmyadmin-credentials.md
Expand Down Expand Up @@ -92,10 +92,16 @@ actions:
sed -i "s/report_host.*/report_host = node${this.id}/" /etc/mysql/conf.d/master.cnf;
sed -i "s/server-id.*/server-id = ${this.id}/" /etc/mysql/conf.d/master.cnf;
sed -i "s/auto-increment-offset.*/auto-increment-offset = ${this.increment}/" /etc/mysql/conf.d/master.cnf;

- if (/mysql/.test("${nodes.sqldb.nodeType}")):
- cmd[${this.id}]: |-
echo "master_info_repository=TABLE" >> /etc/mysql/conf.d/master.cnf;
echo "relay_log_info_repository=TABLE" >> /etc/mysql/conf.d/master.cnf;

- applyVersionConfiguration:
id: ${this.id}
conf_file: /etc/mysql/conf.d/master.cnf

- setupUsers:
id: ${this.id}
- setNodeDisplayName[${this.id}]: Primary
Expand All @@ -112,10 +118,16 @@ actions:
sed -i "s/server-id.*/server-id = ${this}/" /etc/mysql/conf.d/slave.cnf;
sed -i "s/report_host.*/report_host = node${this}/" /etc/mysql/conf.d/slave.cnf;
sed -i '/log-slave-updates/d' /etc/mysql/conf.d/slave.cnf;

- if (/mysql/.test("${nodes.sqldb.nodeType}")):
- cmd[${this}]: |-
echo "master_info_repository=TABLE" >> /etc/mysql/conf.d/slave.cnf;
echo "relay_log_info_repository=TABLE" >> /etc/mysql/conf.d/slave.cnf;

- applyVersionConfiguration:
id: ${this}
conf_file: /etc/mysql/conf.d/slave.cnf

- setupUsers:
id: ${this}
- setNodeDisplayName[${this}]: Secondary
Expand Down
12 changes: 11 additions & 1 deletion scripts/master-slave.jps
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: mysql-master-slave-replication-cluster
name: MySQL/MariaDB/Percona Primary-Secondary Replication Database Cluster
description: 'DB Auto Clustering: 1 x Primary + N x Secondary'

baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0
baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/stage-cluster

success:
text: /texts/phpmyadmin-credentials.md
Expand Down Expand Up @@ -77,6 +77,11 @@ actions:
sed -i "s/server-id.*/server-id = ${this}/" /etc/mysql/conf.d/master.cnf
sed -i "s/report_host.*/report_host = node${this}/" /etc/mysql/conf.d/master.cnf
sed -i "/auto-increment/d" /etc/mysql/conf.d/master.cnf

- applyVersionConfiguration:
id: ${this}
conf_file: /etc/mysql/conf.d/master.cnf

- if (!${settings.clone:false}):
- setupUsers:
id: ${this}
Expand All @@ -87,6 +92,11 @@ actions:
wget ${baseUrl}/configs/slave.cnf -O /etc/mysql/conf.d/slave.cnf &>> /var/log/run.log
sed -i "s/server-id.*/server-id = ${this}/" /etc/mysql/conf.d/slave.cnf
sed -i "s/report_host.*/report_host = node${this}/" /etc/mysql/conf.d/slave.cnf

- applyVersionConfiguration:
id: ${this}
conf_file: /etc/mysql/conf.d/slave.cnf

- setNodeDisplayName[${this}]: Secondary

addSlave:
Expand Down
5 changes: 1 addition & 4 deletions scripts/proxy-common.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
globals:
db_cluster_path: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0

actions:
setupOrchestrator:
- log: Orchestrator configuration
Expand All @@ -14,7 +11,7 @@ actions:
mysql -h 127.0.0.1 -P3360 -uroot -e "SET PASSWORD FOR 'admin'@'127.0.0.1' = PASSWORD('${globals.ORCH_PASS}');"
fi
mysql -h 127.0.0.1 -P3360 -uroot -e "FLUSH PRIVILEGES;"
wget ${globals.db_cluster_path}/configs/orchestrator.conf.json -O /etc/orchestrator.conf.json &>> /var/log/run.log
wget ${baseUrl}/configs/orchestrator.conf.json -O /etc/orchestrator.conf.json &>> /var/log/run.log
sed -i -e 's|orc_client_user|${globals.DB_USER}|g' /etc/orchestrator.conf.json
sed -i -e 's|orc_client_password|${globals.DB_PASS}|g' /etc/orchestrator.conf.json
sed -i -e 's|orc_server_user|admin|g' /etc/orchestrator.conf.json
Expand Down