Skip to content
Merged
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
45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -21,30 +26,46 @@ 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
mvn install
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
```
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
```
8. then edit /home/ivory/config/application-native.yaml
Please modify url, username, password parts according to your actual situation.
```
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"
```
In the directory where the jar package is located, execute:
7. Launch ivory-cloud app
cd /home/ivory/

```
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.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -99,6 +100,7 @@ public class AlertAutoScalingServiceImpl implements AlertAutoScalingService {
private K8sClusterService k8sClusterService;

@Resource(name = "asyncTask")
@Lazy
private AsyncTask asyncTask;

@Value("${common.serviceName}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -63,6 +64,7 @@ public class MonitorServiceImpl implements MonitorService {
private K8sClusterInfoRepository k8sClusterInfoRepository;

@Resource(name = "asyncTask")
@Lazy
private AsyncTask asyncTask;

@Value("${common.serviceName}")
Expand Down
44 changes: 9 additions & 35 deletions cloudnative/src/main/resources/application-native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,39 +32,25 @@ 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 #数据库内核版本
# ivoryVersion: 2.3 #ivory版本
ivoryPgKernelVersion: 17 #数据库内核版本
ivoryVersion: 4.5 #ivory版本
ivoryPgKernelVersion: 18 #数据库内核版本
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-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:
Expand All @@ -73,31 +59,19 @@ 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
clusterDataLabel: ${cluster.group}/data
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
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<column name="max" type="VARCHAR(36)"/>
<column name="enum_value" type="VARCHAR(512)"/>
<column name="rule" type="VARCHAR(64)"/>
<column name="description" type="VARCHAR(255)"/>
<column name="description" type="VARCHAR(512)"/>
<column name="created_at" type="datetime"/>
<column name="updated_at" type="datetime"/>
<column name="deleted_at" type="datetime"/>
Expand Down
4 changes: 4 additions & 0 deletions ivory-cloud_release_notes.txt
Original file line number Diff line number Diff line change
@@ -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的适配)
Expand Down