diff --git a/addons/auto-clustering/scripts/auto-cluster-logic.jps b/addons/auto-clustering/scripts/auto-cluster-logic.jps index e74fb806..699a2c7f 100644 --- a/addons/auto-clustering/scripts/auto-cluster-logic.jps +++ b/addons/auto-clustering/scripts/auto-cluster-logic.jps @@ -40,7 +40,7 @@ onInstall: REPLICA_PSWD: ${fn.password(20)} SCHEME: ${settings.scheme} - - install: + - install: jps: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master/addons/recovery/manifest.yml?_r=${fn.random} nodeGroup: sqldb targetNodes: sqldb diff --git a/addons/mariadb-cluster.json b/addons/mariadb-cluster.json index bc6c6618..fd13848e 100644 --- a/addons/mariadb-cluster.json +++ b/addons/mariadb-cluster.json @@ -1,5 +1,5 @@ { - "jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v2.4.1/addons/auto-clustering/auto-cluster.jps", + "jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0/addons/auto-clustering/auto-cluster.jps", "defaultState": false, "skipOnEnvInstall": true, "nodeGroupData": { diff --git a/addons/mariadb104-cluster.json b/addons/mariadb104-cluster.json index c18279fa..d1e3853a 100644 --- a/addons/mariadb104-cluster.json +++ b/addons/mariadb104-cluster.json @@ -1,5 +1,5 @@ { - "jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v2.3.0/addons/auto-clustering/auto-cluster.jps", + "jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0/addons/auto-clustering/auto-cluster.jps", "defaultState": false, "skipOnEnvInstall": true, "nodeGroupData": { diff --git a/addons/mysql-cluster.json b/addons/mysql-cluster.json index 5a98b9a3..f8a8617f 100644 --- a/addons/mysql-cluster.json +++ b/addons/mysql-cluster.json @@ -1,5 +1,5 @@ { - "jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v2.4.1/addons/auto-clustering/auto-cluster.jps", + "jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0/addons/auto-clustering/auto-cluster.jps", "defaultState": false, "skipOnEnvInstall": true, "nodeGroupData": { diff --git a/addons/recovery/manifest.yml b/addons/recovery/manifest.yml index 505f0b11..8793e1dd 100644 --- a/addons/recovery/manifest.yml +++ b/addons/recovery/manifest.yml @@ -5,7 +5,7 @@ description: text: The Database Cluster Recovery add-on performs a comprehensive diagnostic of your MySQL/MariaDB Cluster (Galera, Primary-Primary, Primary-Secondary) to detect any disruptions of the provisioned service. In case of errors, the automatic Cluster Recovery functionality can restore the cluster operability after most of the problems. short: The add-on performs a comprehensive diagnostic of your database cluster and can perform automatic recovery. -baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v2.5.0/addons/recovery +baseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/v3.0.0/addons/recovery targetNodes: nodeGroup: sqldb diff --git a/scripts/master-master.jps b/scripts/master-master.jps index 011b6e47..29db36f3 100644 --- a/scripts/master-master.jps +++ b/scripts/master-master.jps @@ -117,6 +117,6 @@ actions: setupSecondaryReplication: - cmd[${this}]: |- - curl --silent https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/stage-addon/addons/recovery/scripts/db-recovery.sh > /tmp/db-recovery.sh; + curl --silent https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master/addons/recovery/scripts/db-recovery.sh > /tmp/db-recovery.sh; bash /tmp/db-recovery.sh --scenario restore_secondary_from_primary --donor-ip ${globals.primary1_ip} --additional-primary ${globals.primary2_ip}; user: root diff --git a/scripts/proxy-common.yml b/scripts/proxy-common.yml index 7d6972bf..abe1d32b 100644 --- a/scripts/proxy-common.yml +++ b/scripts/proxy-common.yml @@ -4,7 +4,13 @@ actions: - cmd [proxy]: |- mysql -h 127.0.0.1 -P3360 -uroot -e "DROP DATABASE IF EXISTS orchestrator;" mysql -h 127.0.0.1 -P3360 -uroot -e "CREATE DATABASE IF NOT EXISTS orchestrator;" - mysql -h 127.0.0.1 -P3360 -uroot -e "GRANT ALL PRIVILEGES ON orchestrator.* TO 'admin'@'127.0.0.1' IDENTIFIED BY '${globals.ORCH_PASS}';" + major_version=$(rpm -qi mysql-community-server | grep Version | awk '{print $3}' | awk -F'.' '{print $1}'); + if [ $major_version -ge 8 ]; then + mysql -h 127.0.0.1 -P3360 -uroot -e "ALTER USER 'admin'@'127.0.0.1' IDENTIFIED BY '${globals.ORCH_PASS}';" + else + 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 ${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 diff --git a/scripts/setupUser.sh b/scripts/setupUser.sh index af753b78..13116911 100644 --- a/scripts/setupUser.sh +++ b/scripts/setupUser.sh @@ -9,8 +9,16 @@ cmd="CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASSWORD'; CREATE USER '$US unset resp; resp=$(mysql -u$USER -p$PASSWORD mysql --execute="SHOW COLUMNS FROM user") [ -z "$resp" ] && { - encPass=$(echo $ADMIN_PASSWORD | openssl enc -e -a -A -aes-128-cbc -nosalt -pass "pass:TFVhBKDOSBspeSXesw8fElCcOzbJzYed") - $JEM passwd set -p static:$encPass + openssl_version="$(openssl version | sed -r 's/^OpenSSL[[:blank:]]+([0-9]+)[.][^[:space:]]+[[:blank:]]+.*/\1/')" + if (( $openssl_version >= 3 )); then + openssl_parameters='-aes-256-cbc -pbkdf2 -md sha512 -iter 10000 -salt -S 429488b2f3870b4a -iv dcb9fe5ecb4011cd20114119930aadc3' + STATIC="static:" + else + openssl_parameters='-aes-128-cbc -nosalt -A -nosalt' + STATIC="static" + fi + encPass=$(echo $ADMIN_PASSWORD | openssl enc -e -a $openssl_parameters -pass "pass:TFVhBKDOSBspeSXesw8fElCcOzbJzYed") + $JEM passwd set -p $STATIC:$encPass $MYSQL -uroot -p${ADMIN_PASSWORD} --execute="$cmd" } || { echo "[Info] User $user has the required access to the database."