diff --git a/addons/auto-clustering/auto-cluster.jps b/addons/auto-clustering/auto-cluster.jps index d3209ef1..bc842dd4 100644 --- a/addons/auto-clustering/auto-cluster.jps +++ b/addons/auto-clustering/auto-cluster.jps @@ -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 diff --git a/manifest.yml b/manifest.yml index 8a86271a..2c7d3e52 100644 --- a/manifest.yml +++ b/manifest.yml @@ -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: diff --git a/scripts/common.yml b/scripts/common.yml index 69498905..6795c3fc 100644 --- a/scripts/common.yml +++ b/scripts/common.yml @@ -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: diff --git a/scripts/master-master.jps b/scripts/master-master.jps index 6ba2f33f..ccc4f913 100644 --- a/scripts/master-master.jps +++ b/scripts/master-master.jps @@ -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 @@ -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 @@ -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 diff --git a/scripts/master-slave.jps b/scripts/master-slave.jps index 2a69a53a..ca4bf53b 100644 --- a/scripts/master-slave.jps +++ b/scripts/master-slave.jps @@ -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 @@ -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} @@ -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: diff --git a/scripts/proxy-common.yml b/scripts/proxy-common.yml index dda8f914..abe1d32b 100644 --- a/scripts/proxy-common.yml +++ b/scripts/proxy-common.yml @@ -1,6 +1,3 @@ -globals: - db_cluster_path: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0 - actions: setupOrchestrator: - log: Orchestrator configuration @@ -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