nacos适配达梦数据库

一、下载源码

        源码我直接下载gitee上nacos2.2.3的,具体链接:https://gitee.com/mirrors/Nacos/tree/2.2.3,具体如下图:

二、集成达梦数据库驱动

        解压源码包,用idea打开源码,等idea和maven编译完成,若是Jdk8的话,最好安装300以上的小版本。

        获取达梦数据库驱动,驱动包在安装目录的jdbc下,该驱动包是windows安装包里勾选了驱动,才会生成这些驱动。具体如下图所示:

        将驱动包复制到 nacos-config、nacos-naming 两个模块的resources/lib目录下,并添加依赖:

<dependency>
<groupId>com.dameng</groupId>
<artifactId>Dm8JdbcDriver18</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/DmJdbcDriver18.jar</systemPath>
</dependency>

三、修改启动配置

        修改nacos-console模块的application.properties,具体如下:

其中,url参数详见链接:DM JDBC 编程指南 | 达梦技术文档

四、达梦数据库初始化SQL

        在达梦数据库运行下面SQL:

-- 创建表空间
CREATE TABLESPACE  "NACOS" DATAFILE 'NACOS.DBF' SIZE 300 autoextend on maxsize 67108863 CACHE = NORMAL;
-- 创建用户
CREATE USER "NACOS" IDENTIFIED BY "NACOS*12345678" LIMIT PASSWORD_LOCK_TIME 1, PASSWORD_GRACE_TIME 10 DEFAULT TABLESPACE "NACOS";
-- 给用户授权
GRANT "RESOURCE","PUBLIC","DBA","VTI" TO "NACOS";-- 创建nacos用到的的表
CREATE TABLE "NACOS"."CONFIG_INFO"
("ID" BIGINT IDENTITY(1, 1) NOT NULL,"DATA_ID" VARCHAR(255) NOT NULL,"GROUP_ID" VARCHAR(255),"CONTENT" CLOB NOT NULL,"MD5" VARCHAR(32),"GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"SRC_USER" TEXT,"SRC_IP" VARCHAR(50),"APP_NAME" VARCHAR(128),"TENANT_ID" VARCHAR(128) DEFAULT '',"C_DESC" VARCHAR(256),"C_USE" VARCHAR(64),"EFFECT" VARCHAR(64),"TYPE" VARCHAR(64),"C_SCHEMA" TEXT,"ENCRYPTED_DATA_KEY" TEXT NOT NULL,NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_CONFIGINFO_DATAGROUPTENANT" UNIQUE("DATA_ID", "GROUP_ID", "TENANT_ID")) ;COMMENT ON TABLE "NACOS"."CONFIG_INFO" IS 'config_info';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."ID" IS 'id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."DATA_ID" IS 'data_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."CONTENT" IS 'content';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."MD5" IS 'md5';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."GMT_MODIFIED" IS '修改时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."SRC_USER" IS 'source user';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."SRC_IP" IS 'source ip';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO"."TENANT_ID" IS '租户字段';CREATE UNIQUE  INDEX "INDEX16097400477400" ON "NACOS"."CONFIG_INFO"("ID" ASC) ;CREATE TABLE "NACOS"."CONFIG_INFO_AGGR"
("ID" BIGINT IDENTITY(1, 1) NOT NULL,"DATA_ID" VARCHAR(255) NOT NULL,"GROUP_ID" VARCHAR(255) NOT NULL,"DATUM_ID" VARCHAR(255) NOT NULL,"CONTENT" CLOB NOT NULL,"GMT_MODIFIED" TIMESTAMP(0) NOT NULL,"APP_NAME" VARCHAR(128),"TENANT_ID" VARCHAR(128) DEFAULT '',NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_CONFIGINFOAGGR_DATAGROUPTENANTDATUM" UNIQUE("DATA_ID", "GROUP_ID", "TENANT_ID", "DATUM_ID")) ;COMMENT ON TABLE "NACOS"."CONFIG_INFO_AGGR" IS '增加租户字段';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."ID" IS 'id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."DATA_ID" IS 'data_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."GROUP_ID" IS 'group_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."DATUM_ID" IS 'datum_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."CONTENT" IS '内容';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."GMT_MODIFIED" IS '修改时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_AGGR"."TENANT_ID" IS '租户字段';CREATE UNIQUE  INDEX "INDEX16097305729100" ON "NACOS"."CONFIG_INFO_AGGR"("ID" ASC) ;CREATE TABLE "NACOS"."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),"CONTENT" CLOB NOT NULL,"BETA_IPS" VARCHAR(1024),"MD5" VARCHAR(32),"GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"SRC_USER" TEXT,"SRC_IP" VARCHAR(50),"TENANT_ID" VARCHAR(128) DEFAULT '',"ENCRYPTED_DATA_KEY" TEXT NOT NULL,NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_CONFIGINFOBETA_DATAGROUPTENANT" UNIQUE("DATA_ID", "GROUP_ID", "TENANT_ID")) ;COMMENT ON TABLE "NACOS"."CONFIG_INFO_BETA" IS 'config_info_beta';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."ID" IS 'id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."DATA_ID" IS 'data_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."GROUP_ID" IS 'group_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."APP_NAME" IS 'app_name';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."CONTENT" IS 'content';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."BETA_IPS" IS 'betaIps';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."MD5" IS 'md5';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."GMT_MODIFIED" IS '修改时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."SRC_USER" IS 'source user';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."SRC_IP" IS 'source ip';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_BETA"."TENANT_ID" IS '租户字段';CREATE UNIQUE  INDEX "INDEX16097203229000" ON "NACOS"."CONFIG_INFO_BETA"("ID" ASC) ;CREATE TABLE "NACOS"."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 '',"TAG_ID" VARCHAR(128) NOT NULL,"APP_NAME" VARCHAR(128),"CONTENT" CLOB NOT NULL,"MD5" VARCHAR(32),"GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"SRC_USER" TEXT,"SRC_IP" VARCHAR(50),NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_CONFIGINFOTAG_DATAGROUPTENANTTAG" UNIQUE("DATA_ID", "GROUP_ID", "TENANT_ID", "TAG_ID")) ;COMMENT ON TABLE "NACOS"."CONFIG_INFO_TAG" IS 'config_info_tag';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."ID" IS 'id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."DATA_ID" IS 'data_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."GROUP_ID" IS 'group_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."TENANT_ID" IS 'tenant_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."TAG_ID" IS 'tag_id';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."APP_NAME" IS 'app_name';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."CONTENT" IS 'content';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."MD5" IS 'md5';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."GMT_MODIFIED" IS '修改时间';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."SRC_USER" IS 'source user';
COMMENT ON COLUMN "NACOS"."CONFIG_INFO_TAG"."SRC_IP" IS 'source ip';CREATE UNIQUE  INDEX "INDEX16096985471400" ON "NACOS"."CONFIG_INFO_TAG"("ID" ASC) ;CREATE TABLE "NACOS"."CONFIG_TAGS_RELATION"
("ID" BIGINT NOT NULL,"TAG_NAME" VARCHAR(128) NOT NULL,"TAG_TYPE" VARCHAR(64),"DATA_ID" VARCHAR(255) NOT NULL,"GROUP_ID" VARCHAR(128) NOT NULL,"TENANT_ID" VARCHAR(128) DEFAULT '',"NID" BIGINT IDENTITY(1, 1) NOT NULL,NOT CLUSTER PRIMARY KEY("NID"),CONSTRAINT "UK_CONFIGTAGRELATION_CONFIGIDTAG" UNIQUE("ID", "TAG_NAME", "TAG_TYPE")) ;COMMENT ON TABLE "NACOS"."CONFIG_TAGS_RELATION" IS 'config_tag_relation';
COMMENT ON COLUMN "NACOS"."CONFIG_TAGS_RELATION"."ID" IS 'id';
COMMENT ON COLUMN "NACOS"."CONFIG_TAGS_RELATION"."TAG_NAME" IS 'tag_name';
COMMENT ON COLUMN "NACOS"."CONFIG_TAGS_RELATION"."TAG_TYPE" IS 'tag_type';
COMMENT ON COLUMN "NACOS"."CONFIG_TAGS_RELATION"."DATA_ID" IS 'data_id';
COMMENT ON COLUMN "NACOS"."CONFIG_TAGS_RELATION"."GROUP_ID" IS 'group_id';
COMMENT ON COLUMN "NACOS"."CONFIG_TAGS_RELATION"."TENANT_ID" IS 'tenant_id';CREATE  INDEX "INDEX16096890650200" ON "NACOS"."CONFIG_TAGS_RELATION"("TENANT_ID" ASC) ;
CREATE UNIQUE  INDEX "INDEX16096909541100" ON "NACOS"."CONFIG_TAGS_RELATION"("NID" ASC) ;CREATE TABLE "NACOS"."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,NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_GROUP_ID" UNIQUE("GROUP_ID"),CHECK("QUOTA" >= 0),CHECK("USAGE" >= 0),CHECK("MAX_SIZE" >= 0),CHECK("MAX_AGGR_COUNT" >= 0),CHECK("MAX_AGGR_SIZE" >= 0),CHECK("MAX_HISTORY_COUNT" >= 0)) ;COMMENT ON TABLE "NACOS"."GROUP_CAPACITY" IS '集群、各Group容量信息表';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."ID" IS '主键ID';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."GROUP_ID" IS 'Group ID,空字符表示整个集群';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."QUOTA" IS '配额,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."USAGE" IS '使用量';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."MAX_SIZE" IS '单个配置大小上限,单位为字节,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."MAX_AGGR_COUNT" IS '聚合子配置最大个数,,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."MAX_AGGR_SIZE" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."MAX_HISTORY_COUNT" IS '最大变更历史数量';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "NACOS"."GROUP_CAPACITY"."GMT_MODIFIED" IS '修改时间';CREATE UNIQUE  INDEX "INDEX16096746763900" ON "NACOS"."GROUP_CAPACITY"("ID" ASC) ;CREATE TABLE "NACOS"."HIS_CONFIG_INFO"
("ID" BIGINT 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),"CONTENT" CLOB NOT NULL,"MD5" VARCHAR(32),"GMT_CREATE" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"GMT_MODIFIED" TIMESTAMP(0) DEFAULT CURRENT_TIMESTAMP() NOT NULL,"SRC_USER" TEXT,"SRC_IP" VARCHAR(50),"OP_TYPE" CHAR(10),"TENANT_ID" VARCHAR(128) DEFAULT '',"ENCRYPTED_DATA_KEY" TEXT NOT NULL,NOT CLUSTER PRIMARY KEY("NID")) ;COMMENT ON TABLE "NACOS"."HIS_CONFIG_INFO" IS '多租户改造';
COMMENT ON COLUMN "NACOS"."HIS_CONFIG_INFO"."APP_NAME" IS 'app_name';
COMMENT ON COLUMN "NACOS"."HIS_CONFIG_INFO"."TENANT_ID" IS '租户字段';CREATE  INDEX "IDX_GMT_CREATE" ON "NACOS"."HIS_CONFIG_INFO"("GMT_CREATE" ASC) ;
CREATE  INDEX "IDX_DID" ON "NACOS"."HIS_CONFIG_INFO"("DATA_ID" ASC) ;
CREATE  INDEX "IDX_GMT_MODIFIED" ON "NACOS"."HIS_CONFIG_INFO"("GMT_MODIFIED" ASC) ;
CREATE UNIQUE  INDEX "INDEX16096449256900" ON "NACOS"."HIS_CONFIG_INFO"("NID" ASC) ;CREATE TABLE "NACOS"."PERMISSIONS"
("ROLE" VARCHAR(50) NOT NULL,"RESOURCE" VARCHAR(255) NOT NULL,"ACTION" VARCHAR(8) NOT NULL,CONSTRAINT "UK_ROLE_PERMISSION" UNIQUE("ROLE", "RESOURCE", "ACTION")) ;CREATE TABLE "NACOS"."ROLES"
("USERNAME" VARCHAR(50) NOT NULL,"ROLE" VARCHAR(50) NOT NULL,CONSTRAINT "IDX_USER_ROLE" UNIQUE("USERNAME", "ROLE")) ;CREATE TABLE "NACOS"."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,NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_TENANT_ID" UNIQUE("TENANT_ID"),CHECK("QUOTA" >= 0),CHECK("USAGE" >= 0),CHECK("MAX_SIZE" >= 0),CHECK("MAX_AGGR_COUNT" >= 0),CHECK("MAX_AGGR_SIZE" >= 0),CHECK("MAX_HISTORY_COUNT" >= 0)) ;COMMENT ON TABLE "NACOS"."TENANT_CAPACITY" IS '租户容量信息表';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."ID" IS '主键ID';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."TENANT_ID" IS 'Tenant ID';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."QUOTA" IS '配额,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."USAGE" IS '使用量';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."MAX_SIZE" IS '单个配置大小上限,单位为字节,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."MAX_AGGR_COUNT" IS '聚合子配置最大个数';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."MAX_AGGR_SIZE" IS '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."MAX_HISTORY_COUNT" IS '最大变更历史数量';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "NACOS"."TENANT_CAPACITY"."GMT_MODIFIED" IS '修改时间';CREATE UNIQUE  INDEX "INDEX16096046055000" ON "NACOS"."TENANT_CAPACITY"("ID" ASC) ;CREATE TABLE "NACOS"."TENANT_INFO"
("ID" BIGINT IDENTITY(1, 1) NOT NULL,"KP" VARCHAR(128) NOT NULL,"TENANT_ID" VARCHAR(128) DEFAULT '',"TENANT_NAME" VARCHAR(128) DEFAULT '',"TENANT_DESC" VARCHAR(256),"CREATE_SOURCE" VARCHAR(32),"GMT_CREATE" BIGINT NOT NULL,"GMT_MODIFIED" BIGINT NOT NULL,NOT CLUSTER PRIMARY KEY("ID"),CONSTRAINT "UK_TENANT_INFO_KPTENANTID" UNIQUE("KP", "TENANT_ID")) ;COMMENT ON TABLE "NACOS"."TENANT_INFO" IS 'tenant_info';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."ID" IS 'id';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."KP" IS 'kp';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."TENANT_ID" IS 'tenant_id';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."TENANT_NAME" IS 'tenant_name';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."TENANT_DESC" IS 'tenant_desc';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."CREATE_SOURCE" IS 'create_source';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."GMT_CREATE" IS '创建时间';
COMMENT ON COLUMN "NACOS"."TENANT_INFO"."GMT_MODIFIED" IS '修改时间';CREATE  INDEX "IDX_TENANT_ID" ON "NACOS"."TENANT_INFO"("TENANT_ID" ASC) ;
CREATE UNIQUE  INDEX "INDEX16095846853300" ON "NACOS"."TENANT_INFO"("ID" ASC) ;CREATE TABLE "NACOS"."USERS"
("USERNAME" VARCHAR(50) NOT NULL,"PASSWORD" VARCHAR(500) NOT NULL,"ENABLED" TINYINT NOT NULL,NOT CLUSTER PRIMARY KEY("USERNAME")) ;
CREATE UNIQUE  INDEX "PRIMARY" ON "NACOS"."USERS"("USERNAME" ASC) ;
INSERT INTO nacos.users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
INSERT INTO nacos.roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');
commit;

        这些sql可以放到distribution\conf\dm-schema.sql中,后续打包能看到该sql,如图:

五、新增达梦数据库Mapper文件

        将nacos-datasource-plugin里的mysql的mapper文件复制到新的dm文件夹下改名,并修改将相应的常量和配置,具体如下:

六、启动Nacos

        找到 com.alibaba.nacos.Nacos类,启动即可,或者加入 -Dnacos.standalone=true 参数单机启动,集群启动需要在 用户文件夹下的 nacos/conf 下放置 cluster.conf 文件。

        另外注意nacos的url一定不能写错,否则报:Caused by: java.lang.IllegalStateException: No DataSource set

七、打包并运行Nacos

        配置环境变量,MAVEN_HOME和JAVA_HOME,以及在Path中添加bin路径。具体如下:

        接着到nacos项目路径下运行:

mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U

或者:mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U  -Dcheckstyle.skip

成功后,nacos包会在 Nacos-2.2.3\distribution\target 目录下:

        将新打包的nacos-server-2.2.3.zip复制解压,如下图:

        到nacos/conf目录下修改 application.properties,具体参考源码的配置文件。

        在nacos/bin目录下cmd运行:startup.cmd -m standalone。

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

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

相关文章

STM32--时钟树

一、什么是时钟&#xff1f; 时钟是单片机的脉搏&#xff0c;是系统工作的同步节拍。单片机上至CPU&#xff0c;下至总线外设&#xff0c;它们工作时序的配合&#xff0c;都需要一个同步的时钟信号来统一指挥。时钟信号是周期性的脉冲信号。 二、什么是时钟树&#xff1f; S…

【分享】Excel“只读方式”的两种模式

查阅Excel表格的时候&#xff0c;担心不小心修改了内容&#xff0c;可以给Excel设置以“只读方式”打开&#xff0c;这样就算修改了内容也不能直接保存表格。Excel表格可以设置两种“只读方式”&#xff0c;一起来看看吧&#xff01; “只读方式” 1&#xff1a; 打开Excel表…

图论15-有向图-环检测+度数+欧拉回路

文章目录 1. 有向图设计1.1 私有变量标记是否有向1.2 添加边的处理&#xff0c;双向变单向1.3 删除边的处理&#xff0c;双向变单向1.4 有向图的出度和入度 2 有向图的环检测2.1 普通的算法实现换检测2.2 拓扑排序中的环检测 3 欧拉回路 1. 有向图设计 1.1 私有变量标记是否有…

Direct3D拾取

假设在屏幕上单击,击中的位置为点s=(x,y)。由图可以看出,用户选中了茶壶。但是仅给出点s,应用程序还无法立即判断出茶壶是否被选中。所以针对这类问题,我们需要采用一项称为“拾 取(Picking)”的技术。 茶壶和屏幕点s之间的一种联系是茶壶被投影到了一个包含了s的区域中。…

【NLP】理解 Llama2:KV 缓存、分组查询注意力、旋转嵌入等

LLaMA 2.0是 Meta AI 的开创性作品&#xff0c;作为首批高性能开源预训练语言模型之一闯入了 AI 场景。值得注意的是&#xff0c;LLaMA-13B 的性能优于巨大的 GPT-3(175B)&#xff0c;尽管其尺寸只是其一小部分。您无疑听说过 LLaMA 令人印象深刻的性能&#xff0c;但您是否想知…

ChatGPT重磅升级 奢侈品VERTU推出双模型AI手机

2023年11月7日,OpenAI举办了首届开发者大会,CEO Sam Altman(山姆奥尔特曼)展示了号称“史上最强”AI的GPT-4 Turbo。它支持长达约10万汉字的输入,具备前所未有的长文本处理能力,使更复杂的互动成为可能。此外,GPT-4 Turbo还引入了跨模态API支持,可以同时处理图片、视频和声音,从…

uniapp h5发行

前端使用uniapp开发项目完成后&#xff0c;需要将页面打包&#xff0c;生成H5的静态文件&#xff0c;部署在服务器上。 这样通过服务器链接地址&#xff0c;直接可以在手机上点开来访问。 打包全步骤如下&#xff1a; 首先在manifest.json文件中进行基础配置&#xff0c;获取…

Python | 机器学习之数据清洗

​ &#x1f308;个人主页&#xff1a;Sarapines Programmer&#x1f525; 系列专栏&#xff1a;《人工智能奇遇记》&#x1f516;少年有梦不应止于心动&#xff0c;更要付诸行动。 目录结构 1. 机器学习之数据清洗概念 1.1 机器学习 1.2 数据清洗 2. 数据清洗 2.1 实验目的…

XSS 跨站点脚本漏洞详解

文章目录 漏洞概述XSS漏洞原理xss漏洞危害xss漏洞验证XSS漏洞分类反射型存储型DOM型 固定会话攻击原理简单xss注入复现 XSS 攻防xss构造方法利用标签符号<>事件响应javascript伪协议其他标签 XSS 变形方式xss防御黑白名单策略输入过滤 防御DOM 型XSS过滤代码测试代码 案例…

Network(一)计算机网络介绍

一 计算机网络 1 概述 什么是计算机网络&#xff1f; 硬件方面:通过线缆将网络设备和计算机连接起来 软件方面:操作系统&#xff0c;应用软件&#xff0c;应用程序通过通信线路互连 实现资源共享、信息传递、增加可靠性、提高系统处理能力 2 网络与云计算 3 计算机网…

APP备案获取安卓app证书公钥获取方法和签名MD5值

前言 在开发和发布安卓应用程序时&#xff0c;了解应用程序证书的公钥和签名MD5值是很重要的。这些信息对于应用程序的安全性和合规性至关重要。现在又因为今年开始APP必须接入备案才能在国内各大应用市场上架&#xff0c;所以获取这两个值成了所有开发者的必经之路。本文将介…

Xilinx Artix7-100T低端FPGA解码MIPI视频,基于MIPI CSI-2 RX Subsystem架构实现,提供工程源码和技术支持

目录 1、前言免责声明 2、我这里已有的 MIPI 编解码方案3、本 MIPI CSI2 模块性能及其优缺点4、详细设计方案设计原理框图OV5640及其配置权电阻硬件方案MIPI CSI-2 RX SubsystemSensor Demosaic图像格式转换Gammer LUT伽马校正VDMA图像缓存AXI4-Stream toVideo OutHDMI输出 5、…