From 6f068c5cdf4834bc194390ed947d769780fa0bfd Mon Sep 17 00:00:00 2001 From: zhangzhe Date: Fri, 21 Nov 2025 15:42:31 +0800 Subject: [PATCH 01/14] adapt ivorysql 5.0 --- README.md | 6 +++--- cloudnative/src/main/resources/application-native.yaml | 2 +- ivory-cloud_release_notes.txt | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ed76d91..210390c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Maven:Maven configuration is required,After configuration, execute the follo ``` mvn clean -mvn install +mvn package -Dmaven.test.skip=true ``` After the packaging is completed, you can find the `pkg` directory in the root directory of the project. It contains the jar package to be deployed. ### Deploy backend projects @@ -45,6 +45,6 @@ datasource: In the directory where the jar package is located, execute: ``` -nohup java -jar cloudservice-1.0-SNAPSHOT.jar > log_native 2>&1 & +nohup java -jar cloudnative-1.0-SNAPSHOT.jar > log_native 2>&1 & ``` -cloudservice-1.0-SNAPSHOT.jar is the name of the jar package; please replace it according to the actual situation. +cloudnative-1.0-SNAPSHOT.jar is the name of the jar package; please replace it according to the actual situation. diff --git a/cloudnative/src/main/resources/application-native.yaml b/cloudnative/src/main/resources/application-native.yaml index 7a7bf0d..9780eb0 100644 --- a/cloudnative/src/main/resources/application-native.yaml +++ b/cloudnative/src/main/resources/application-native.yaml @@ -38,7 +38,7 @@ common: # ivoryPgKernelVersion: 15 #数据库内核版本 # ivoryVersion: 2.3 #ivory版本 ivoryPgKernelVersion: 17 #数据库内核版本 - ivoryVersion: 4.5 #ivory版本 + ivoryVersion: 5.0 #ivory版本 logging: level: # com: diff --git a/ivory-cloud_release_notes.txt b/ivory-cloud_release_notes.txt index f049595..4071965 100644 --- a/ivory-cloud_release_notes.txt +++ b/ivory-cloud_release_notes.txt @@ -1,4 +1,8 @@ ivory-cloud RELEASE NOTES +******************v5.0****************** +1.IvorySqL 5.0适配 + + ******************v4.0****************** 1.IvorySqL operator 4.0适配(包括postgres-exporter、pgbackrest以及pgadmin的适配) From 1a3f529a11cf3d1897361ab390ed199588d78021 Mon Sep 17 00:00:00 2001 From: zhangzhe Date: Fri, 21 Nov 2025 17:57:58 +0800 Subject: [PATCH 02/14] fix circular dependency --- README.md | 2 +- .../apiserver/service/impl/AlertAutoScalingServiceImpl.java | 2 ++ .../platform/apiserver/service/impl/MonitorServiceImpl.java | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 210390c..40edf78 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Maven:Maven configuration is required,After configuration, execute the follo ``` mvn clean -mvn package -Dmaven.test.skip=true +mvn package -D maven.test.skip=true ``` After the packaging is completed, you can find the `pkg` directory in the root directory of the project. It contains the jar package to be deployed. ### Deploy backend projects diff --git a/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/AlertAutoScalingServiceImpl.java b/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/AlertAutoScalingServiceImpl.java index 79e8830..d71409b 100644 --- a/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/AlertAutoScalingServiceImpl.java +++ b/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/AlertAutoScalingServiceImpl.java @@ -57,6 +57,7 @@ import com.highgo.platform.exception.AutoScalingException; import com.highgo.platform.utils.AsyncTask; import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.PageRequest; @@ -99,6 +100,7 @@ public class AlertAutoScalingServiceImpl implements AlertAutoScalingService { private K8sClusterService k8sClusterService; @Resource(name = "asyncTask") + @Lazy private AsyncTask asyncTask; @Value("${common.serviceName}") diff --git a/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/MonitorServiceImpl.java b/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/MonitorServiceImpl.java index 6560ff3..468bbd3 100644 --- a/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/MonitorServiceImpl.java +++ b/cloudnative/src/main/java/com/highgo/platform/apiserver/service/impl/MonitorServiceImpl.java @@ -33,6 +33,7 @@ import com.highgo.platform.errorcode.ClusterError; import com.highgo.platform.exception.ClusterException; import com.highgo.platform.utils.AsyncTask; +import org.springframework.context.annotation.Lazy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -63,6 +64,7 @@ public class MonitorServiceImpl implements MonitorService { private K8sClusterInfoRepository k8sClusterInfoRepository; @Resource(name = "asyncTask") + @Lazy private AsyncTask asyncTask; @Value("${common.serviceName}") From f037cd0a017d56a717637932671ae113e1181075 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:44:46 +0800 Subject: [PATCH 03/14] change deploy steps --- README.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 40edf78..e45ffbf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # Installation -## Installation instructions +##Prerequisites + +- JDK 1.8 +- [Maven](http://maven.apache.org/) 3.0 and above +- IvorySQL 5.0 +- Kubernetes 1.23 (Must have default storage class) -As an open-source backend project, ivory-cloud requires the local installation of `git`, `jdk`, `maven`, etc., during the development process. +## Installation instructions Fork the backend repository of the open-source cloud platform to your own GitHub account, then clone it to your local machine, for example: @@ -28,11 +33,20 @@ Maven:Maven configuration is required,After configuration, execute the follo mvn clean mvn package -D maven.test.skip=true ``` -After the packaging is completed, you can find the `pkg` directory in the root directory of the project. It contains the jar package to be deployed. +After the packaging is completed, you can find the cloudnative-1.0-SNAPSHOT.jar file at the path ivory-cloud/cloudnative/target. ### Deploy backend projects -Install a database such as ivorysql on your server and start it. -Place the above jar package in your server, then edit [configuration file](./cloudnative/src/main/resources/application-native.yaml) -Among them, 5432 is the port on which the ivorysql database runs; please modify it according to the actual situation. +1. Install a database such as ivorysql on your server and start it. +2. create a directory to store the application files. For example: + mkdir -p /home/ivory +3. upload JAR file (cloudnative-1.0-SNAPSHOT.jar) to your server. +4. create a directory(name must be: config) under /home/ivory to store the application files. For example: + mkdir -p /home/ivory/config +5. Please upload below files from the source code path ivory-cloud/cloudnative/src/main/resources to the /home/ivory/config path on your server. + application.yaml + application-native.yaml + spring_pro_logback.xml +6. then edit /home/ivory/config/application-native.yaml +Please modify url, username, password parts according to your actual situation. ``` datasource: druid: @@ -42,9 +56,9 @@ datasource: username: ivorysql password: "ivory@123" ``` -In the directory where the jar package is located, execute: +7. Launch ivory-cloud app + cd /home/ivory/ ``` nohup java -jar cloudnative-1.0-SNAPSHOT.jar > log_native 2>&1 & ``` -cloudnative-1.0-SNAPSHOT.jar is the name of the jar package; please replace it according to the actual situation. From 396cae9bcb87da5fb80c202c74892d2261736069 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:45:08 +0800 Subject: [PATCH 04/14] Fix formatting of prerequisites section in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e45ffbf..143ed33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Installation -##Prerequisites +## Prerequisites - JDK 1.8 - [Maven](http://maven.apache.org/) 3.0 and above From 741e6bf13786a22751b05a1e655a637756cfd4c4 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:50:03 +0800 Subject: [PATCH 05/14] change deploy steps --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 143ed33..ab91dd6 100644 --- a/README.md +++ b/README.md @@ -37,15 +37,17 @@ After the packaging is completed, you can find the cloudnative-1.0-SNAPSHOT.jar ### Deploy backend projects 1. Install a database such as ivorysql on your server and start it. 2. create a directory to store the application files. For example: + mkdir -p /home/ivory -3. upload JAR file (cloudnative-1.0-SNAPSHOT.jar) to your server. -4. create a directory(name must be: config) under /home/ivory to store the application files. For example: - mkdir -p /home/ivory/config -5. Please upload below files from the source code path ivory-cloud/cloudnative/src/main/resources to the /home/ivory/config path on your server. +4. upload JAR file (cloudnative-1.0-SNAPSHOT.jar) to your server. +5. create a directory(name must be: config) under /home/ivory to store the application files. For example: + + mkdir -p /home/ivory/config +6. Please upload below files from the source code path ivory-cloud/cloudnative/src/main/resources to the /home/ivory/config path on your server. application.yaml application-native.yaml spring_pro_logback.xml -6. then edit /home/ivory/config/application-native.yaml +7. then edit /home/ivory/config/application-native.yaml Please modify url, username, password parts according to your actual situation. ``` datasource: From 2c476a488ca7d47bd4ec85e7a4526eb351d6cd90 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:09:14 +0800 Subject: [PATCH 06/14] change default db url and username --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab91dd6..38c4d42 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ datasource: druid: db-type: com.alibaba.druid.pool.DruidDataSource driver-class-name: org.postgresql.Driver - url: jdbc:postgresql://127.0.0.1:5432/ivory + url: jdbc:postgresql://127.0.0.1:5432/ivorysql username: ivorysql password: "ivory@123" ``` From 6c4dd7cb2251a993af5d8dcac990e5ffdc37903e Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 10:09:52 +0800 Subject: [PATCH 07/14] Update database connection details in YAML config --- cloudnative/src/main/resources/application-native.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudnative/src/main/resources/application-native.yaml b/cloudnative/src/main/resources/application-native.yaml index 9780eb0..190292b 100644 --- a/cloudnative/src/main/resources/application-native.yaml +++ b/cloudnative/src/main/resources/application-native.yaml @@ -9,9 +9,9 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource driver-class-name: org.postgresql.Driver - url: jdbc:postgresql://127.0.0.1:5432/ivory - username: postgres - password: "highgo@123" + url: jdbc:postgresql://127.0.0.1:5432/ivorysql + username: ivorysql + password: "ivory@123" jpa: show-sql: false open-in-view: false From 4a7a5091e872204f01b0286de86065c560471d33 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 11:21:03 +0800 Subject: [PATCH 08/14] change config_param_defination's cloumn description length --- cloudnative/src/main/resources/db/changelog/ivory/0000-init.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudnative/src/main/resources/db/changelog/ivory/0000-init.xml b/cloudnative/src/main/resources/db/changelog/ivory/0000-init.xml index 1ff9e81..636b8bd 100644 --- a/cloudnative/src/main/resources/db/changelog/ivory/0000-init.xml +++ b/cloudnative/src/main/resources/db/changelog/ivory/0000-init.xml @@ -114,7 +114,7 @@ - + From c40b5ac68db9968c70946de3b4efbe8306ce245a Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:10:36 +0800 Subject: [PATCH 09/14] change image tag --- cloudnative/src/main/resources/application-native.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudnative/src/main/resources/application-native.yaml b/cloudnative/src/main/resources/application-native.yaml index 190292b..b0419df 100644 --- a/cloudnative/src/main/resources/application-native.yaml +++ b/cloudnative/src/main/resources/application-native.yaml @@ -61,10 +61,10 @@ images: # pgadmin: docker.io/ivorysql/pgadmin:ubi8-7.4-1.1-1 # exporter: docker.io/ivorysql/postgres-exporter:ubi8-0.13.2-1.1-1 image: - db: docker.io/ivorysql/ivorysql:ubi8-4.5-4.0-1 - backrest: docker.io/ivorysql/pgbackrest:ubi8-2.54.1-4.0-1 - pgadmin: docker.io/ivorysql/pgadmin:ubi8-8.14.0-4.0-1 - exporter: docker.io/ivorysql/postgres-exporter:ubi8-0.17.0-4.0-1 + db: docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1 + backrest: docker.io/ivorysql/pgbackrest:ubi8-2.56.0-5.0-1 + pgadmin: docker.io/ivorysql/pgadmin:ubi8-9.9-5.0-1 + exporter: docker.io/ivorysql/postgres-exporter:ubi8-0.17.0-5.0-1 server: port: 8081 error: From e9bcc6f5f8764520a192a098a12b684df85626d8 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:27:13 +0800 Subject: [PATCH 10/14] modify format --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 38c4d42..e9180ec 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,20 @@ After the packaging is completed, you can find the cloudnative-1.0-SNAPSHOT.jar ### Deploy backend projects 1. Install a database such as ivorysql on your server and start it. 2. create a directory to store the application files. For example: - +``` mkdir -p /home/ivory +``` 4. upload JAR file (cloudnative-1.0-SNAPSHOT.jar) to your server. 5. create a directory(name must be: config) under /home/ivory to store the application files. For example: - +``` mkdir -p /home/ivory/config +``` 6. Please upload below files from the source code path ivory-cloud/cloudnative/src/main/resources to the /home/ivory/config path on your server. + application.yaml application-native.yaml spring_pro_logback.xml -7. then edit /home/ivory/config/application-native.yaml +8. then edit /home/ivory/config/application-native.yaml Please modify url, username, password parts according to your actual situation. ``` datasource: From c6e1dac72fd2c23cf9bd63c1652194de0357e4b2 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:28:07 +0800 Subject: [PATCH 11/14] Improve file list formatting in README Format the list of files for clarity. --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e9180ec..6230088 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,11 @@ After the packaging is completed, you can find the cloudnative-1.0-SNAPSHOT.jar mkdir -p /home/ivory/config ``` 6. Please upload below files from the source code path ivory-cloud/cloudnative/src/main/resources to the /home/ivory/config path on your server. - - application.yaml - application-native.yaml +``` + application.yaml + application-native.yaml spring_pro_logback.xml +``` 8. then edit /home/ivory/config/application-native.yaml Please modify url, username, password parts according to your actual situation. ``` From c8379f1b381bb987e8169e09ccccae1cc79b98b7 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:13:36 +0800 Subject: [PATCH 12/14] add dos2unix step to compile step --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6230088..3da8dc5 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,9 @@ cd ivory-cloud ## Deployment ### Compile and build +1. Please ensure that all files ending with .sh in the ivory-cloud\cloudnative\src\main\resources\monitor folder and all its subfolders are in UNIX format. If they are not, please run the dos2unix command to convert them to UNIX format. -Maven:Maven configuration is required,After configuration, execute the following command: +2. Maven:Maven configuration is required,After configuration, execute the following command: ``` mvn clean From 49dd7410bb466e6c1bbd14984e0757ec009d8893 Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:37:30 +0800 Subject: [PATCH 13/14] change ivoryPgKernelVersion to 18 --- cloudnative/src/main/resources/application-native.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudnative/src/main/resources/application-native.yaml b/cloudnative/src/main/resources/application-native.yaml index b0419df..2743267 100644 --- a/cloudnative/src/main/resources/application-native.yaml +++ b/cloudnative/src/main/resources/application-native.yaml @@ -37,7 +37,7 @@ common: linuxk8sConfigPath: /root/.kube/config # ivoryPgKernelVersion: 15 #数据库内核版本 # ivoryVersion: 2.3 #ivory版本 - ivoryPgKernelVersion: 17 #数据库内核版本 + ivoryPgKernelVersion: 18 #数据库内核版本 ivoryVersion: 5.0 #ivory版本 logging: level: From 2400433a2a1c4431c816a262dba0f656931859cf Mon Sep 17 00:00:00 2001 From: czhangzhang <44315411+czhangzhang@users.noreply.github.com> Date: Mon, 24 Nov 2025 16:40:08 +0800 Subject: [PATCH 14/14] remove commended params --- .../main/resources/application-native.yaml | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/cloudnative/src/main/resources/application-native.yaml b/cloudnative/src/main/resources/application-native.yaml index 2743267..a67e402 100644 --- a/cloudnative/src/main/resources/application-native.yaml +++ b/cloudnative/src/main/resources/application-native.yaml @@ -32,7 +32,6 @@ common: alert-path-prefix: alert serviceName: ivory namespace: ivory -# storageClassLabels: "{'cnp.inspurcloud.cn/system-storageclass': 'false'}" refreshWatcherTaskTime: 600000 # 单位ms 默认10分钟 linuxk8sConfigPath: /root/.kube/config # ivoryPgKernelVersion: 15 #数据库内核版本 @@ -41,25 +40,12 @@ common: ivoryVersion: 5.0 #ivory版本 logging: level: -# com: -# inspur: -# common: ERROR org: hibernate: error root: info config: config/spring_pro_logback.xml images: -# image: -# db: harbor.highgo.com/highgo/crunchy-highgo:sm3nodemx -# backrest: harbor.highgo.com/highgo/crunchy-pgbackrest:sm3-v2 -# pgadmin: harbor.highgo.com/highgo/crunchy-pgadmin4:hgadmin2 -# exporter: harbor.highgo.com/highgo/crunchy-postgres-exporter:v1.5 -# image: -# db: docker.io/ivorysql/ivorysql:ubi8-2.2-1.1-1 -# backrest: docker.io/ivorysql/pgbackrest:ubi8-2.45-1.1-1 -# pgadmin: docker.io/ivorysql/pgadmin:ubi8-7.4-1.1-1 -# exporter: docker.io/ivorysql/postgres-exporter:ubi8-0.13.2-1.1-1 image: db: docker.io/ivorysql/ivorysql:ubi8-5.0-5.0-1 backrest: docker.io/ivorysql/pgbackrest:ubi8-2.56.0-5.0-1 @@ -73,22 +59,13 @@ server: cluster: user: pguser -# user: hguser group: ivory-operator.ivorysql.org -# group: highgo-operator.inspur.com version: v1beta1 -# version: v1beta1 kind: IvoryCluster -# kind: PostgresCluster plural: ivoryclusters -# plural: highgoclusters singular: ivorycluster -# singular: highgocluster instanceIdName: ivory/instanceId -# instanceIdName: highgo/instanceId clusterId: ivory/clusterId -# clusterId: highgo/clusterId -# prometheusFilter: highgo/user prometheusFilter: ivory/user clusterNameLabel: ${cluster.group}/cluster clusterRoleLabel: ${cluster.group}/role @@ -96,8 +73,5 @@ cluster: crBackupAnnotation: ${cluster.group}/pgbackrest-backup crRestoreAnnotation: ${cluster.group}/pgbackrest-restore grafanaName: grafana -# grafanaName: crunchy-grafana alertManagerName: alertmanager -# alertManagerName: crunchy-alertmanager prometheusName: prometheus -# prometheusName: crunchy-prometheus