修改Nacos2.4.1源码-适配达梦数据库麒麟ARM系统(国产XC化)

news/2024/12/24 4:20:17/文章来源:https://www.cnblogs.com/zhoutuo/p/18442988

前言:应集团公司现在推广XC化,其中基础环境需要用麒麟ARM操作系统和达梦数据库,而官网的nacos默认适配mysql,需要重新编译源码来适配需要对接的数据库,2.4.2试验了一把,安装启动后 nacos 控制台出现 “创建命名空间失败 / 数据库语法问题”,经分析,问题出在源码的sql语法上,参考以下链接1。鉴于项目架构搭建时间紧急,最快的解决办法是重新编译 一版2.4.1 版本的源码包。下面将具体修改源码的方法和心得与大家分享下,另外鸣谢“链接2”作者的提点。

链接1: https://github.com/alibaba/nacos/issues/12625
链接2: https://blog.csdn.net/qq_26018075/article/details/141399170?spm=1001.2014.3001.5506
maven下载地址链接: https://maven.apache.org/download.cgi
达梦JDBC驱动包下载地址链接: https://eco.dameng.com/download/
jdk下载地址链接: https://www.oracle.com/java/technologies/downloads/#java17
nacos源码包下载链接: https://gitcode.com/gh_mirrors/na/nacos/tags/

第一步:安装达梦驱动到maven本地仓库
先进入存放DmJdbcDriver-1.8.jar的路径:
cd C:\Users\ztt\Desktop\nacos-2.4.1源码改造-适配达梦\nacos-2.4.1源码改造-适配达梦
安装驱动命令:
mvn install:install-file -Dfile=DmJdbcDriver-1.8.jar -DgroupId=dm.jdbc -DartifactId=DmJdbcDriver -Dversion=1.8 -Dpackaging=jar

待输出:BUILD SUCCESS,说明安装成功

第二步:添加DM(达梦)驱动
1、nacos-all的pom.xml文件

<properties><dm-jdbc.version>1.8</dm-jdbc.version>  
</properties>

<dependencies>
<dependency>  <groupId>dm.jdbc</groupId>  <artifactId>DmJdbcDriver</artifactId>  <version>${dm-jdbc.version}</version>  
</dependency>
</dependencies>

2、nacos-common、nacos-naming、nacos-config的pom.xml文件

<dependencies>
<dependency>  <groupId>dm.jdbc</groupId>  <artifactId>DmJdbcDriver</artifactId>  <version>${dm-jdbc.version}</version>  
</dependency>
</dependencies>

第三步:修改源码-代码
1、DataSourceConstant 数据源常量修改

class: com.alibaba.nacos.plugin.datasource.constants.DataSourceConstant
添加 public static final String DM = “dm”;

添加:

public class DataSourceConstant {  public static final String MYSQL = "mysql";  public static final String DERBY = "derby";  public static final String DM = "dm";  
}

2、添加TrustedDmFunctionEnum
复制Mysql的TrustedMysqlFunctionEnum枚举到dm目录,并修改名称为:TrustedDmFunctionEnum。也可以展开

3、修改Mapper
链接:https://gitcode.com/gh_mirrors/ma/Mapper/overview?utm_source=highlight_word_gitcode&word=mapper&isLogin=1
目录: com.alibaba.nacos.plugin.datasource.impl
①复制com.alibaba.nacos.plugin.datasource.impl.mysql -> com.alibaba.nacos.plugin.datasource.impl.dm
②修改mapper中的getDataSource方法,改为DataSourceConstant.DM
③修改AbstractMapperByDm中的getFunction方法com.alibaba.nacos.plugin.datasource.impl.dm.AbstractMapperByDm,使用TrustedDmFunctionEnum枚举

4、修改resoure
将datasource(nacos-datasource-plugin)工程 resources目录下的META-INF/services/com.alibaba.nacos.plugin.datasource.mapper.Mapper修改为:DM后缀

com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoAggrMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoBetaMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigInfoTagMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.ConfigTagsRelationMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.HistoryConfigInfoMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.TenantInfoMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.TenantCapacityMapperByDm  
com.alibaba.nacos.plugin.datasource.impl.dm.GroupCapacityMapperByDm

5、添加DM程序适配器
PersistenceConstant添加:public static final String DM = "dm";
目录:class: com.alibaba.nacos.persistence.constants.PersistenceConstant`

6、添加DM分页适配器
目录: com.alibaba.nacos.plugin.auth.impl.persistence.handler.support
在该目录下添加DM适配器类

public class DmPageHandlerAdapter implements PageHandlerAdapter {  @Override  public boolean supports(String dataSourceType) {  return PersistenceConstant.DM.equals(dataSourceType);  }  @Override  public OffsetFetchResult addOffsetAndFetchNext(String fetchSql, Object[] arg, int pageNo, int pageSize) {  if (!fetchSql.contains(AuthPageConstant.LIMIT)) {  fetchSql += " " + AuthPageConstant.LIMIT_SIZE;  List<Object> newArgsList = new ArrayList<>(Arrays.asList(arg));  newArgsList.add((pageNo - 1) * pageSize);  newArgsList.add(pageSize);  Object[] newArgs = newArgsList.toArray(new Object[0]);  return new OffsetFetchResult(fetchSql, newArgs);  }  return new OffsetFetchResult(fetchSql, arg);  }  }

7、分页适配工厂添加DM分页适配器
目录: com.alibaba.nacos.plugin.auth.impl.persistence.handler.PageHandlerAdapterFactory
添加分页适配器:

private PageHandlerAdapterFactory() {  List<PageHandlerAdapter> handlerAdapters = new ArrayList<>(3);  Map<String, PageHandlerAdapter> handlerAdapterMap = new HashMap<>(3);  Consumer<PageHandlerAdapter> addHandlerAdapter = handlerAdapter -> {  handlerAdapters.add(handlerAdapter);  handlerAdapterMap.put(handlerAdapter.getClass().getName(), handlerAdapter);  };  // DmPageHandlerAdapter  addHandlerAdapter.accept(new DmPageHandlerAdapter());  // MysqlPageHandlerAdapter  addHandlerAdapter.accept(new MysqlPageHandlerAdapter());  // DerbyPageHandlerAdapter  addHandlerAdapter.accept(new DerbyPageHandlerAdapter());  // DefaultPageHandlerAdapter  addHandlerAdapter.accept(new DefaultPageHandlerAdapter());  this.handlerAdapters = Collections.unmodifiableList(handlerAdapters);  this.handlerAdapterMap = Collections.unmodifiableMap(handlerAdapterMap);  
}

8、修改数据源配置类ExternalDataSourceProperties
目录: com.alibaba.nacos.persistence.datasource.ExternalDataSourceProperties
添加属性: private List jdbcDriverName

private List<String> jdbcDriverName = new ArrayList<>();  public List<String> getJdbcDriverName() {  return jdbcDriverName;  
}  public void setJdbcDriverName(List<String> jdbcDriverName) {  this.jdbcDriverName = jdbcDriverName;  
}

9、修改 build方法中的数据源驱动部分
目录: com.alibaba.nacos.persistence.datasource.ExternalDataSourceProperties#build
添加:
poolProperties.setDriverClassName(getOrDefault(jdbcDriverName,index,jdbcDriverName.get(index)).trim());

第四步:修改配置文件
①修改工程distribution下的配置文件application.properties路径distribution/conf/application.properties;
②spring.sql.init.platform的值改为dm;
③添加db.jdbc-driver-name.0=dm.jdbc.driver.DmDriver;
④修改url为db.url.0=jdbc:dm://IP:5236/DB;

第五步:添加sql
将dm-scheme.sql添加到distribution的conf目录下
sql内容:

CREATE TABLE "USERS"  
(  "USERNAME" VARCHAR(50) NOT NULL,  "PASSWORD" VARCHAR(500) NOT NULL,  "ENABLED" TINYINT NOT NULL  
);  CREATE TABLE "TENANT_INFO"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "KP" VARCHAR(128) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "TENANT_NAME" VARCHAR(128) DEFAULT ''  NULL,  "TENANT_DESC" VARCHAR(256) NULL,  "CREATE_SOURCE" VARCHAR(32) NULL,  "GMT_CREATE" BIGINT NOT NULL,  "GMT_MODIFIED" BIGINT NOT NULL  
);  CREATE TABLE "TENANT_CAPACITY"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NOT NULL,  "QUOTA" BIGINT DEFAULT 0  NOT NULL,  "USAGE" BIGINT DEFAULT 0  NOT NULL,  "MAX_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_COUNT" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_HISTORY_COUNT" BIGINT DEFAULT 0  NOT NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL  
);  CREATE TABLE "ROLES"  
(  "USERNAME" VARCHAR(50) NOT NULL,  "ROLE" VARCHAR(50) NOT NULL  
);  CREATE TABLE "PERMISSIONS"  
(  "ROLE" VARCHAR(50) NOT NULL,  "RESOURCE" VARCHAR(255) NOT NULL,  "ACTION" VARCHAR(8) NOT NULL  
);  CREATE TABLE "HIS_CONFIG_INFO"  
(  "ID" DECIMAL(20,0) NOT NULL,  "NID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL,  "OP_TYPE" CHAR(10) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "ENCRYPTED_DATA_KEY" TEXT NOT NULL  
);  CREATE TABLE "GROUP_CAPACITY"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "GROUP_ID" VARCHAR(128) DEFAULT ''  NOT NULL,  "QUOTA" BIGINT DEFAULT 0  NOT NULL,  "USAGE" BIGINT DEFAULT 0  NOT NULL,  "MAX_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_COUNT" BIGINT DEFAULT 0  NOT NULL,  "MAX_AGGR_SIZE" BIGINT DEFAULT 0  NOT NULL,  "MAX_HISTORY_COUNT" BIGINT DEFAULT 0  NOT NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL  
);  CREATE TABLE "CONFIG_TAGS_RELATION"  
(  "ID" BIGINT NOT NULL,  "TAG_NAME" VARCHAR(128) NOT NULL,  "TAG_TYPE" VARCHAR(64) NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "NID" BIGINT IDENTITY(1,1) NOT NULL  
);  CREATE TABLE "CONFIG_INFO_TAG"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "TAG_ID" VARCHAR(128) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL  
);  CREATE TABLE "CONFIG_INFO_BETA"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "BETA_IPS" VARCHAR(1024) NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "ENCRYPTED_DATA_KEY" TEXT NOT NULL  
);  CREATE TABLE "CONFIG_INFO_AGGR"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NOT NULL,  "DATUM_ID" VARCHAR(255) NOT NULL,  "CONTENT" CLOB NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) NOT NULL,  "APP_NAME" VARCHAR(128) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL  
);  CREATE TABLE "CONFIG_INFO"  
(  "ID" BIGINT IDENTITY(1,1) NOT NULL,  "DATA_ID" VARCHAR(255) NOT NULL,  "GROUP_ID" VARCHAR(128) NULL,  "CONTENT" CLOB NOT NULL,  "MD5" VARCHAR(32) NULL,  "GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP()  NOT NULL,  "SRC_USER" TEXT NULL,  "SRC_IP" VARCHAR(50) NULL,  "APP_NAME" VARCHAR(128) NULL,  "TENANT_ID" VARCHAR(128) DEFAULT ''  NULL,  "C_DESC" VARCHAR(256) NULL,  "C_USE" VARCHAR(64) NULL,  "EFFECT" VARCHAR(64) NULL,  "TYPE" VARCHAR(64) NULL,  "C_SCHEMA" TEXT NULL,  "ENCRYPTED_DATA_KEY" TEXT NOT NULL  
);  SET IDENTITY_INSERT "CONFIG_INFO" ON;  
SET IDENTITY_INSERT "CONFIG_INFO" OFF;  
SET IDENTITY_INSERT "CONFIG_INFO_AGGR" ON;  
SET IDENTITY_INSERT "CONFIG_INFO_AGGR" OFF;  
SET IDENTITY_INSERT "CONFIG_INFO_BETA" ON;  
SET IDENTITY_INSERT "CONFIG_INFO_BETA" OFF;  
SET IDENTITY_INSERT "CONFIG_INFO_TAG" ON;  
SET IDENTITY_INSERT "CONFIG_INFO_TAG" OFF;  
SET IDENTITY_INSERT "CONFIG_TAGS_RELATION" ON;  
SET IDENTITY_INSERT "CONFIG_TAGS_RELATION" OFF;  
SET IDENTITY_INSERT "GROUP_CAPACITY" ON;  
SET IDENTITY_INSERT "GROUP_CAPACITY" OFF;  
SET IDENTITY_INSERT "HIS_CONFIG_INFO" ON;  
SET IDENTITY_INSERT "HIS_CONFIG_INFO" OFF;  
INSERT INTO "ROLES"("USERNAME","ROLE") VALUES('nacos','ROLE_ADMIN');  SET IDENTITY_INSERT "TENANT_CAPACITY" ON;  
SET IDENTITY_INSERT "TENANT_CAPACITY" OFF;  
SET IDENTITY_INSERT "TENANT_INFO" ON;  
SET IDENTITY_INSERT "TENANT_INFO" OFF;  
INSERT INTO "USERS"("USERNAME","PASSWORD","ENABLED") VALUES('nacos','$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu',1);  ALTER TABLE "USERS" ADD CONSTRAINT  PRIMARY KEY("USERNAME") ;  ALTER TABLE "TENANT_INFO" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "TENANT_INFO" ADD CONSTRAINT "UK_TENANT_INFO_KPTENANTID" UNIQUE("KP","TENANT_ID") ;  ALTER TABLE "TENANT_CAPACITY" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "TENANT_CAPACITY" ADD CONSTRAINT "UK_TENANT_ID" UNIQUE("TENANT_ID") ;  ALTER TABLE "ROLES" ADD CONSTRAINT "IDX_USER_ROLE" UNIQUE("USERNAME","ROLE") ;  ALTER TABLE "PERMISSIONS" ADD CONSTRAINT "UK_ROLE_PERMISSION" UNIQUE("ROLE","RESOURCE","ACTION") ;  ALTER TABLE "HIS_CONFIG_INFO" ADD CONSTRAINT  PRIMARY KEY("NID") ;  ALTER TABLE "GROUP_CAPACITY" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "GROUP_CAPACITY" ADD CONSTRAINT "UK_GROUP_ID" UNIQUE("GROUP_ID") ;  ALTER TABLE "CONFIG_TAGS_RELATION" ADD CONSTRAINT  PRIMARY KEY("NID") ;  ALTER TABLE "CONFIG_TAGS_RELATION" ADD CONSTRAINT "UK_CONFIGTAGRELATION_CONFIGIDTAG" UNIQUE("ID","TAG_NAME","TAG_TYPE") ;  ALTER TABLE "CONFIG_INFO_TAG" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO_TAG" ADD CONSTRAINT "UK_CONFIGINFOTAG_DATAGROUPTENANTTAG" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID","TAG_ID") ;  ALTER TABLE "CONFIG_INFO_BETA" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO_BETA" ADD CONSTRAINT "UK_CONFIGINFOBETA_DATAGROUPTENANT" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID") ;  ALTER TABLE "CONFIG_INFO_AGGR" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO_AGGR" ADD CONSTRAINT "UK_CONFIGINFOAGGR_DATAGROUPTENANTDATUM" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID","DATUM_ID") ;  ALTER TABLE "CONFIG_INFO" ADD CONSTRAINT  PRIMARY KEY("ID") ;  ALTER TABLE "CONFIG_INFO" ADD CONSTRAINT "UK_CONFIGINFO_DATAGROUPTENANT" UNIQUE("DATA_ID","GROUP_ID","TENANT_ID") ;  CREATE UNIQUE INDEX "PRIMARY"  
ON "USERS"("USERNAME");  COMMENT ON COLUMN "USERS"."USERNAME" IS 'username';  COMMENT ON COLUMN "USERS"."PASSWORD" IS 'password';  COMMENT ON COLUMN "USERS"."ENABLED" IS 'enabled';  CREATE INDEX "IDX_TENANT_ID"  
ON "TENANT_INFO"("TENANT_ID");  CREATE UNIQUE INDEX "INDEX134402165964299"  
ON "TENANT_INFO"("ID");  COMMENT ON TABLE "TENANT_INFO" IS 'tenant_info';  COMMENT ON COLUMN "TENANT_INFO"."ID" IS 'id';  COMMENT ON COLUMN "TENANT_INFO"."KP" IS 'kp';  COMMENT ON COLUMN "TENANT_INFO"."TENANT_ID" IS 'tenant_id';  COMMENT ON COLUMN "TENANT_INFO"."TENANT_NAME" IS 'tenant_name';  COMMENT ON COLUMN "TENANT_INFO"."TENANT_DESC" IS 'tenant_desc';  COMMENT ON COLUMN "TENANT_INFO"."CREATE_SOURCE" IS 'create_source';  COMMENT ON COLUMN "TENANT_INFO"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "TENANT_INFO"."GMT_MODIFIED" IS '修改时间';  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("QUOTA" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_HISTORY_COUNT" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_AGGR_SIZE" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_AGGR_COUNT" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("MAX_SIZE" >= 0) ENABLE ;  ALTER TABLE "TENANT_CAPACITY" ADD CHECK ("USAGE" >= 0) ENABLE ;  CREATE UNIQUE INDEX "INDEX134403016796300"  
ON "TENANT_CAPACITY"("ID");  COMMENT ON TABLE "TENANT_CAPACITY" IS '租户容量信息表';  COMMENT ON COLUMN "TENANT_CAPACITY"."ID" IS '主键ID';  COMMENT ON COLUMN "TENANT_CAPACITY"."TENANT_ID" IS 'Tenant ID';  COMMENT ON COLUMN "TENANT_CAPACITY"."QUOTA" IS '配额,0表示使用默认值';  COMMENT ON COLUMN "TENANT_CAPACITY"."USAGE" IS '使用量';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_SIZE" IS '单个配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_AGGR_COUNT" IS '聚合子配置最大个数';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_AGGR_SIZE" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "TENANT_CAPACITY"."MAX_HISTORY_COUNT" IS '最大变更历史数量';  COMMENT ON COLUMN "TENANT_CAPACITY"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "TENANT_CAPACITY"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "ROLES"."USERNAME" IS 'username';  COMMENT ON COLUMN "ROLES"."ROLE" IS 'role';  COMMENT ON COLUMN "PERMISSIONS"."ROLE" IS 'role';  COMMENT ON COLUMN "PERMISSIONS"."RESOURCE" IS 'resource';  COMMENT ON COLUMN "PERMISSIONS"."ACTION" IS 'action';  ALTER TABLE "HIS_CONFIG_INFO" ADD CHECK ("ID" >= 0) ENABLE ;  CREATE INDEX "IDX_DID"  
ON "HIS_CONFIG_INFO"("DATA_ID");  CREATE INDEX "IDX_GMT_MODIFIED"  
ON "HIS_CONFIG_INFO"("GMT_MODIFIED");  CREATE INDEX "IDX_GMT_CREATE"  
ON "HIS_CONFIG_INFO"("GMT_CREATE");  CREATE UNIQUE INDEX "INDEX134404266256800"  
ON "HIS_CONFIG_INFO"("NID");  COMMENT ON TABLE "HIS_CONFIG_INFO" IS '多租户改造';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."ID" IS 'id';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."NID" IS 'nid, 自增标识';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."CONTENT" IS 'content';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."MD5" IS 'md5';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."SRC_IP" IS 'source ip';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."OP_TYPE" IS 'operation type';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."TENANT_ID" IS '租户字段';  COMMENT ON COLUMN "HIS_CONFIG_INFO"."ENCRYPTED_DATA_KEY" IS '密钥';  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("QUOTA" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_HISTORY_COUNT" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_AGGR_SIZE" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_AGGR_COUNT" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("MAX_SIZE" >= 0) ENABLE ;  ALTER TABLE "GROUP_CAPACITY" ADD CHECK ("USAGE" >= 0) ENABLE ;  CREATE UNIQUE INDEX "INDEX134405629453900"  
ON "GROUP_CAPACITY"("ID");  COMMENT ON TABLE "GROUP_CAPACITY" IS '集群、各Group容量信息表';  COMMENT ON COLUMN "GROUP_CAPACITY"."ID" IS '主键ID';  COMMENT ON COLUMN "GROUP_CAPACITY"."GROUP_ID" IS 'Group ID,空字符表示整个集群';  COMMENT ON COLUMN "GROUP_CAPACITY"."QUOTA" IS '配额,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."USAGE" IS '使用量';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_SIZE" IS '单个配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_AGGR_COUNT" IS '聚合子配置最大个数,,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_AGGR_SIZE" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';  COMMENT ON COLUMN "GROUP_CAPACITY"."MAX_HISTORY_COUNT" IS '最大变更历史数量';  COMMENT ON COLUMN "GROUP_CAPACITY"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "GROUP_CAPACITY"."GMT_MODIFIED" IS '修改时间';  CREATE INDEX "INDEX134406418558100"  
ON "CONFIG_TAGS_RELATION"("TENANT_ID");  CREATE UNIQUE INDEX "INDEX134406537578900"  
ON "CONFIG_TAGS_RELATION"("NID");  COMMENT ON TABLE "CONFIG_TAGS_RELATION" IS 'config_tag_relation';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."TAG_NAME" IS 'tag_name';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."TAG_TYPE" IS 'tag_type';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."TENANT_ID" IS 'tenant_id';  COMMENT ON COLUMN "CONFIG_TAGS_RELATION"."NID" IS 'nid, 自增长标识';  CREATE UNIQUE INDEX "INDEX134407033963000"  
ON "CONFIG_INFO_TAG"("ID");  COMMENT ON TABLE "CONFIG_INFO_TAG" IS 'config_info_tag';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."TENANT_ID" IS 'tenant_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."TAG_ID" IS 'tag_id';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."CONTENT" IS 'content';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."MD5" IS 'md5';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "CONFIG_INFO_TAG"."SRC_IP" IS 'source ip';  CREATE UNIQUE INDEX "INDEX134407798104699"  
ON "CONFIG_INFO_BETA"("ID");  COMMENT ON TABLE "CONFIG_INFO_BETA" IS 'config_info_beta';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."CONTENT" IS 'content';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."BETA_IPS" IS 'betaIps';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."MD5" IS 'md5';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."SRC_IP" IS 'source ip';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."TENANT_ID" IS '租户字段';  COMMENT ON COLUMN "CONFIG_INFO_BETA"."ENCRYPTED_DATA_KEY" IS '密钥';  CREATE UNIQUE INDEX "INDEX134408619300900"  
ON "CONFIG_INFO_AGGR"("ID");  COMMENT ON TABLE "CONFIG_INFO_AGGR" IS '增加租户字段';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."DATUM_ID" IS 'datum_id';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."CONTENT" IS '内容';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO_AGGR"."TENANT_ID" IS '租户字段';  CREATE UNIQUE INDEX "INDEX134409166029299"  
ON "CONFIG_INFO"("ID");  COMMENT ON TABLE "CONFIG_INFO" IS 'config_info';  COMMENT ON COLUMN "CONFIG_INFO"."ID" IS 'id';  COMMENT ON COLUMN "CONFIG_INFO"."DATA_ID" IS 'data_id';  COMMENT ON COLUMN "CONFIG_INFO"."GROUP_ID" IS 'group_id';  COMMENT ON COLUMN "CONFIG_INFO"."CONTENT" IS 'content';  COMMENT ON COLUMN "CONFIG_INFO"."MD5" IS 'md5';  COMMENT ON COLUMN "CONFIG_INFO"."GMT_CREATE" IS '创建时间';  COMMENT ON COLUMN "CONFIG_INFO"."GMT_MODIFIED" IS '修改时间';  COMMENT ON COLUMN "CONFIG_INFO"."SRC_USER" IS 'source user';  COMMENT ON COLUMN "CONFIG_INFO"."SRC_IP" IS 'source ip';  COMMENT ON COLUMN "CONFIG_INFO"."APP_NAME" IS 'app_name';  COMMENT ON COLUMN "CONFIG_INFO"."TENANT_ID" IS '租户字段';  COMMENT ON COLUMN "CONFIG_INFO"."C_DESC" IS 'configuration description';  COMMENT ON COLUMN "CONFIG_INFO"."C_USE" IS 'configuration usage';  COMMENT ON COLUMN "CONFIG_INFO"."EFFECT" IS '配置生效的描述';  COMMENT ON COLUMN "CONFIG_INFO"."TYPE" IS '配置的类型';  COMMENT ON COLUMN "CONFIG_INFO"."C_SCHEMA" IS '配置的模式';  COMMENT ON COLUMN "CONFIG_INFO"."ENCRYPTED_DATA_KEY" IS '密钥';

第六步:编译打包
可以将修改好的源码包拷贝到Linux-麒麟ARM系统上进行编译打包,也可以在本机直接打包
命令:mvn -Prelease-nacos clean install -Dmaven.test.skip=true -Dcheckstyle.skip=true -Dpmd.skip=true -Drat.skip=true -U
编译好的包通常会出现在源码根目录下的target文件夹中,一个为.tar.gz,一个为.zip文件

最后收到集团高级架构师和领导的好评:


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/806670.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

怎么查看网站是否被谷歌收录,你会查看网站被谷歌收录的方法吗

查看网站是否被谷歌收录是一个相对简单的过程,以下是几种常用的方法,可以帮助你确定网站或其特定页面是否已被谷歌搜索引擎索引: 一、使用“site:”搜索指令 打开谷歌搜索引擎(Google)。 在搜索框中输入“site:你的网站域名”(注意使用英文冒号,并将“你的网站域名”替换…

操作系统:保护模式(二)内存模型

平坦内存模型 现代操作系统一般不会使用过于复杂的分段机制,而是采用平坦内存模型 + 分页模型来管理内存。 平坦内存模型(Flat Memory Model),这是现代操作系统(如 Linux 和 Windows)常用的内存模型。在这种模型中,所有段的段基址都为 0,段界限为 4GB,使得整个内存空间…

操作系统:保护模式(五)特权

特权机制 特权特权级数值越大,级别越小。通常,因为操作系统是为所有程序服务的,可靠性最高,而且必须对软硬件有完全的控制权,所以它的主体部分必须拥有特权级0,并处于整个环形结构的中心。也正是因为这样,操作系统的主体部分通常又被称做内核(Kernel、 Core)。 特权级1和…

操作系统:保护模式(一)GDT 与分段机制

GDT 与分段机制 CPU开机时运行于实模式,寻址方式是段寄存器 \(\times\) 10+偏移寄存器=物理地址,主要原因是因为 8086 地址线和数据线不匹配导致的。但是这种寻址方式既不安全也不支持现代操作系统所需的、多任务支持、cpu 特权模式等。 在实模式下,对于基址,变址寻址的寄存…

CSP2024-30

A 题意:将一个圆等分为 \(K\) 分,给出其中 \(n\) 个等分点的编号,\(x_i < x_{i + 1}\)。 有向边 \(i \to j\) 存在,当且仅当 \(j\) 是距离 \(i\) 最大的点(不唯一),且与图中其他边无交点(端点不算)。 求图中最多有多少条边。\(3 \le K \le 10^9, 3 \le n \le \min(…

小白上手Arcgis—用于结合Netlogo、matlab等进行复杂网络操作

小白上手Arcgis(Netlogo复杂网络数据预处理) 1.前言废话:昨天突然想到可以写一下博客,用来记录一下自己的工作,主要是涉及复杂网络方面。情况简介:本人Arcgis小白,之前只是略微知道有这么个软件,以及知道怎么打开软件。学渣一个,而且不是学gis方向的,但由于工作需要,要…

windows10如何安装jdk8,并且配置java home环境?超详细!

前言 大家好,我是小徐啊。记得我刚学习Java的时候,我的老师第一步就是教我们如何安装jdk并且配置java环境。这应该算是学习Java的第一步吧。虽然这个安装过程对我来说已经不是非常难了,但是我知道,对于一些刚入门的小伙伴还是经常容易搞错的,所以,今天小徐就写一篇详细的…

安装小雅问题

如何卸载重装小雅、apt remove xiaoya docker stop 01ec8396b2c529819bb7c95091a88a9af6999c042bcb7ab57662837c97dca5cd docker rm 01ec8396b2c529819bb7c95091a88a9af6999c042bcb7ab57662837c97dca5cdsystemctl start cpolar 开启cplpr systemctl status cpolar

leetcode24 两两交换链表中的节点(swap-nodes-in-pairs)

题目描述: 给你一个链表,两两交换其中相邻的节点,并返回交换后链表的头节点。你必须在不修改节点内部的值的情况下完成本题(即,只能进行节点交换)。 示例 1:输入:head = [1,2,3,4] 输出:[2,1,4,3]示例 2: 输入:head = [] 输出:[]示例 3: 输入:head = [1] 输出:[…

第一章:Borel测度

第1章 Borel测度 在正式讨论我们的内容之前我们先做几点说明 1.我们只讨论\(\mathbb{R}^n\) 上的测度,因此如果不作特别说明,我们均认为测度和集合为于\(\mathbb{R}^n\) 中: 2.我们不特别区分外测度和测度,因为将外测度限制在可测集上就是可测集上的测度: 3.我们默认读者已…

TypeScript在vue中的使用-----事件类型的获取

当我们要对事件定义类型。一种是通过console.log(e)来看事件的类型。另外一种是@事件名的时候,将$event写好,鼠标放上去看事件类型。再讲$event删除。 如下: 然后我们定义函数的时候就可以指定事件类型了const clickMi = (e:MouseEvent)=>{console.log(e.pageX, e.pageY…

信息学奥赛复赛复习08-CSP-J2020-03表达式前置知识点-后缀表达式、栈、字符读取

PDF文档公众号回复关键字:202410011 P1449 后缀表达式 [题目描述] 所谓后缀表达式是指这样的一个表达式:式中不再引用括号,运算符号放在两个运算对象之后,所有计算按运算符号出现的顺序,严格地由左而右新进行(不用考虑运算符的优先级) 本题中运算符仅包含 + - * / 。保证…