Nacos - nacos-mysql.sql源文件与application.properties配置文件

2023-10-30

前言

Nacos设置外部数据源,需要初始化nacos-mysql.sql源文件、修改application.properties配置文件。

内容

初始化 MySQL 数据库

nacos-mysql.sql

/*
 * Copyright 1999-2018 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info   */
/******************************************/
CREATE TABLE `config_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) NOT NULL COMMENT 'data_id',
  `group_id` varchar(255) DEFAULT NULL,
  `content` longtext NOT NULL COMMENT 'content',
  `md5` varchar(32) DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COMMENT 'source user',
  `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
  `app_name` varchar(128) DEFAULT NULL,
  `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
  `c_desc` varchar(256) DEFAULT NULL,
  `c_use` varchar(64) DEFAULT NULL,
  `effect` varchar(64) DEFAULT NULL,
  `type` varchar(64) DEFAULT NULL,
  `c_schema` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';

/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info_aggr   */
/******************************************/
CREATE TABLE `config_info_aggr` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) NOT NULL COMMENT 'data_id',
  `group_id` varchar(255) NOT NULL COMMENT 'group_id',
  `datum_id` varchar(255) NOT NULL COMMENT 'datum_id',
  `content` longtext NOT NULL COMMENT '内容',
  `gmt_modified` datetime NOT NULL COMMENT '修改时间',
  `app_name` varchar(128) DEFAULT NULL,
  `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='增加租户字段';


/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info_beta   */
/******************************************/
CREATE TABLE `config_info_beta` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) NOT NULL COMMENT 'group_id',
  `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
  `content` longtext NOT NULL COMMENT 'content',
  `beta_ips` varchar(1024) DEFAULT NULL COMMENT 'betaIps',
  `md5` varchar(32) DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COMMENT 'source user',
  `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
  `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_beta';

/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_info_tag   */
/******************************************/
CREATE TABLE `config_info_tag` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `data_id` varchar(255) NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
  `tag_id` varchar(128) NOT NULL COMMENT 'tag_id',
  `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
  `content` longtext NOT NULL COMMENT 'content',
  `md5` varchar(32) DEFAULT NULL COMMENT 'md5',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  `src_user` text COMMENT 'source user',
  `src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_tag';

/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = config_tags_relation   */
/******************************************/
CREATE TABLE `config_tags_relation` (
  `id` bigint(20) NOT NULL COMMENT 'id',
  `tag_name` varchar(128) NOT NULL COMMENT 'tag_name',
  `tag_type` varchar(64) DEFAULT NULL COMMENT 'tag_type',
  `data_id` varchar(255) NOT NULL COMMENT 'data_id',
  `group_id` varchar(128) NOT NULL COMMENT 'group_id',
  `tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
  `nid` bigint(20) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`nid`),
  UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
  KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation';

/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = group_capacity   */
/******************************************/
CREATE TABLE `group_capacity` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `group_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
  `quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
  `usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
  `max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
  `max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',
  `max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
  `max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';

/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = his_config_info   */
/******************************************/
CREATE TABLE `his_config_info` (
  `id` bigint(64) unsigned NOT NULL,
  `nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `data_id` varchar(255) NOT NULL,
  `group_id` varchar(128) NOT NULL,
  `app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
  `content` longtext NOT NULL,
  `md5` varchar(32) DEFAULT NULL,
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `src_user` text,
  `src_ip` varchar(50) DEFAULT NULL,
  `op_type` char(10) DEFAULT NULL,
  `tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
  PRIMARY KEY (`nid`),
  KEY `idx_gmt_create` (`gmt_create`),
  KEY `idx_gmt_modified` (`gmt_modified`),
  KEY `idx_did` (`data_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';


/******************************************/
/*   数据库全名 = nacos_config   */
/*   表名称 = tenant_capacity   */
/******************************************/
CREATE TABLE `tenant_capacity` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Tenant ID',
  `quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
  `usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
  `max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
  `max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
  `max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
  `max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
  `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';


CREATE TABLE `tenant_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `kp` varchar(128) NOT NULL COMMENT 'kp',
  `tenant_id` varchar(128) default '' COMMENT 'tenant_id',
  `tenant_name` varchar(128) default '' COMMENT 'tenant_name',
  `tenant_desc` varchar(256) DEFAULT NULL COMMENT 'tenant_desc',
  `create_source` varchar(32) DEFAULT NULL COMMENT 'create_source',
  `gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
  `gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
  KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';

CREATE TABLE `users` (
	`username` varchar(50) NOT NULL PRIMARY KEY,
	`password` varchar(500) NOT NULL,
	`enabled` boolean NOT NULL
);

CREATE TABLE `roles` (
	`username` varchar(50) NOT NULL,
	`role` varchar(50) NOT NULL,
	UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
);

CREATE TABLE `permissions` (
    `role` varchar(50) NOT NULL,
    `resource` varchar(255) NOT NULL,
    `action` varchar(8) NOT NULL,
    UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
);

INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);

INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');

application.properties 配置

#
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#*************** Spring Boot Related Configurations ***************#
### Default web context path:
server.servlet.contextPath=/nacos
### Default web server port:
server.port=8848

#*************** Network Related Configurations ***************#
### If prefer hostname over ip for Nacos server addresses in cluster.conf:
# nacos.inetutils.prefer-hostname-over-ip=false

### Specify local server's IP:
# nacos.inetutils.ip-address=


#*************** Config Module Related Configurations ***************#
### If use MySQL as datasource:
# spring.datasource.platform=mysql

### Count of DB:
# db.num=1

### Connect URL of DB:
# db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
# db.user.0=nacos
# db.password.0=nacos

### Connection pool configuration: hikariCP
db.pool.config.connectionTimeout=30000
db.pool.config.validationTimeout=10000
db.pool.config.maximumPoolSize=20
db.pool.config.minimumIdle=2

#*************** Naming Module Related Configurations ***************#
### Data dispatch task execution period in milliseconds: Will removed on v2.1.X, replace with nacos.core.protocol.distro.data.sync.delayMs
# nacos.naming.distro.taskDispatchPeriod=200

### Data count of batch sync task: Will removed on v2.1.X. Deprecated
# nacos.naming.distro.batchSyncKeyCount=1000

### Retry delay in milliseconds if sync task failed: Will removed on v2.1.X, replace with nacos.core.protocol.distro.data.sync.retryDelayMs
# nacos.naming.distro.syncRetryDelay=5000

### If enable data warmup. If set to false, the server would accept request without local data preparation:
# nacos.naming.data.warmup=true

### If enable the instance auto expiration, kind like of health check of instance:
# nacos.naming.expireInstance=true

### will be removed and replaced by `nacos.naming.clean` properties
nacos.naming.empty-service.auto-clean=true
nacos.naming.empty-service.clean.initial-delay-ms=50000
nacos.naming.empty-service.clean.period-time-ms=30000

### Add in 2.0.0
### The interval to clean empty service, unit: milliseconds.
# nacos.naming.clean.empty-service.interval=60000

### The expired time to clean empty service, unit: milliseconds.
# nacos.naming.clean.empty-service.expired-time=60000

### The interval to clean expired metadata, unit: milliseconds.
# nacos.naming.clean.expired-metadata.interval=5000

### The expired time to clean metadata, unit: milliseconds.
# nacos.naming.clean.expired-metadata.expired-time=60000

### The delay time before push task to execute from service changed, unit: milliseconds.
# nacos.naming.push.pushTaskDelay=500

### The timeout for push task execute, unit: milliseconds.
# nacos.naming.push.pushTaskTimeout=5000

### The delay time for retrying failed push task, unit: milliseconds.
# nacos.naming.push.pushTaskRetryDelay=1000

### Since 2.0.3
### The expired time for inactive client, unit: milliseconds.
# nacos.naming.client.expired.time=180000

#*************** CMDB Module Related Configurations ***************#
### The interval to dump external CMDB in seconds:
# nacos.cmdb.dumpTaskInterval=3600

### The interval of polling data change event in seconds:
# nacos.cmdb.eventTaskInterval=10

### The interval of loading labels in seconds:
# nacos.cmdb.labelTaskInterval=300

### If turn on data loading task:
# nacos.cmdb.loadDataAtStart=false


#*************** Metrics Related Configurations ***************#
### Metrics for prometheus
#management.endpoints.web.exposure.include=*

### Metrics for elastic search
management.metrics.export.elastic.enabled=false
#management.metrics.export.elastic.host=http://localhost:9200

### Metrics for influx
management.metrics.export.influx.enabled=false
#management.metrics.export.influx.db=springboot
#management.metrics.export.influx.uri=http://localhost:8086
#management.metrics.export.influx.auto-create-db=true
#management.metrics.export.influx.consistency=one
#management.metrics.export.influx.compressed=true

#*************** Access Log Related Configurations ***************#
### If turn on the access log:
server.tomcat.accesslog.enabled=true

### The access log pattern:
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i

### The directory of access log:
server.tomcat.basedir=

#*************** Access Control Related Configurations ***************#
### If enable spring security, this option is deprecated in 1.2.0:
#spring.security.enabled=false

### The ignore urls of auth, is deprecated in 1.2.0:
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**

### The auth system to use, currently only 'nacos' and 'ldap' is supported:
nacos.core.auth.system.type=nacos

### If turn on auth system:
nacos.core.auth.enabled=false

### worked when nacos.core.auth.system.type=ldap,{0} is Placeholder,replace login username
# nacos.core.auth.ldap.url=ldap://localhost:389
# nacos.core.auth.ldap.userdn=cn={0},ou=user,dc=company,dc=com

### The token expiration in seconds:
nacos.core.auth.default.token.expire.seconds=18000

### The default token:
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789

### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
nacos.core.auth.caching.enabled=true

### Since 1.4.1, Turn on/off white auth for user-agent: nacos-server, only for upgrade from old version.
nacos.core.auth.enable.userAgentAuthWhite=false

### Since 1.4.1, worked when nacos.core.auth.enabled=true and nacos.core.auth.enable.userAgentAuthWhite=false.
### The two properties is the white list for auth and used by identity the request from other server.
nacos.core.auth.server.identity.key=serverIdentity
nacos.core.auth.server.identity.value=security

#*************** Istio Related Configurations ***************#
### If turn on the MCP server:
nacos.istio.mcp.server.enabled=false

#*************** Core Related Configurations ***************#

### set the WorkerID manually
# nacos.core.snowflake.worker-id=

### Member-MetaData
# nacos.core.member.meta.site=
# nacos.core.member.meta.adweight=
# nacos.core.member.meta.weight=

### MemberLookup
### Addressing pattern category, If set, the priority is highest
# nacos.core.member.lookup.type=[file,address-server]
## Set the cluster list with a configuration file or command-line argument
# nacos.member.list=192.168.16.101:8847?raft_port=8807,192.168.16.101?raft_port=8808,192.168.16.101:8849?raft_port=8809
## for AddressServerMemberLookup
# Maximum number of retries to query the address server upon initialization
# nacos.core.address-server.retry=5
## Server domain name address of [address-server] mode
# address.server.domain=jmenv.tbsite.net
## Server port of [address-server] mode
# address.server.port=8080
## Request address of [address-server] mode
# address.server.url=/nacos/serverlist

#*************** JRaft Related Configurations ***************#

### Sets the Raft cluster election timeout, default value is 5 second
# nacos.core.protocol.raft.data.election_timeout_ms=5000
### Sets the amount of time the Raft snapshot will execute periodically, default is 30 minute
# nacos.core.protocol.raft.data.snapshot_interval_secs=30
### raft internal worker threads
# nacos.core.protocol.raft.data.core_thread_num=8
### Number of threads required for raft business request processing
# nacos.core.protocol.raft.data.cli_service_thread_num=4
### raft linear read strategy. Safe linear reads are used by default, that is, the Leader tenure is confirmed by heartbeat
# nacos.core.protocol.raft.data.read_index_type=ReadOnlySafe
### rpc request timeout, default 5 seconds
# nacos.core.protocol.raft.data.rpc_request_timeout_ms=5000

#*************** Distro Related Configurations ***************#

### Distro data sync delay time, when sync task delayed, task will be merged for same data key. Default 1 second.
# nacos.core.protocol.distro.data.sync.delayMs=1000

### Distro data sync timeout for one sync data, default 3 seconds.
# nacos.core.protocol.distro.data.sync.timeoutMs=3000

### Distro data sync retry delay time when sync data failed or timeout, same behavior with delayMs, default 3 seconds.
# nacos.core.protocol.distro.data.sync.retryDelayMs=3000

### Distro data verify interval time, verify synced data whether expired for a interval. Default 5 seconds.
# nacos.core.protocol.distro.data.verify.intervalMs=5000

### Distro data verify timeout for one verify, default 3 seconds.
# nacos.core.protocol.distro.data.verify.timeoutMs=3000

### Distro data load retry delay when load snapshot data failed, default 30 seconds.
# nacos.core.protocol.distro.data.load.retryDelayMs=30000
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Nacos - nacos-mysql.sql源文件与application.properties配置文件 的相关文章

  • Admin监控&Sleuth链路追踪 &skywalking链路追踪

    Admin监控 Sleuth链路追踪 skywalking Sleuth Zipkin 一 Sleuth Zipkin介绍 二 搭建环境 三 Sleuth入门操作 四 Zipkin搭建及操作 五 RabbitMQ方式发送信息 六 Elast
  • 高校评优评奖管理系统

    这是一个高校评优评奖管理系统 供大家参考学习 不懂的地方可以联系本人 1 管理员登陆 学生申请 管理员后台 评优记录 数据维护 信息统计 系统设置 学生申报 微信 17777665965 QQ 1161724197
  • 一直在说高并发,多少QPS才算高并发?

    高并发的四个角度 只说并发不提高可用就是耍流氓 可以从四个角度讨论这个问题 首先是无状态前端机器不足以承载请求流量 需要进行水平扩展 一般QPS是千级 然后是关系型数据库无法承载读取或写入峰值 需要数据库横向扩展或引入nosql 一般是千到
  • Dubbo和Spring Cloud微服务架构对比

    Dubbo和Spring Cloud微服务架构对比 微服务架构是互联网很热门的话题 是互联网技术发展的必然结果 它提倡将单一应用程序划分成一组小的服务 服务之间互相协调 互相配合 为用户提供最终价值 虽然微服务架构没有公认的技术标准和规范或
  • 微服务契约测试框架-Pact

    契约测试 契约测试的思想就是将原本的 Consumer 与 Provider 间同步的集成测试 通过契约进行解耦 变成 Consumer 与 Provider 端两个各自独立的 异步的单元测试 契约测试的优点 契约测试与单元测试以及其它测试
  • Redis主从集群

    Redis主从集群 1 集群结构 我们搭建的主从集群结构如图 共包含三个节点 一个主节点 两个从节点 这里我们会在同一台虚拟机中开启3个redis实例 模拟主从集群 信息如下 IP PORT 角色 192 168 150 101 7001
  • Nacos手动注册,Nacos内网IP的解决办法,自动获取外网注册服务

    Nacos内网IP的解决办法 自动获取外网注册服务 废话不说 直接上代码 pom文件
  • Go 语言进阶(一) -- Go hertz http框架、kitex RPC微服务框架、gorm 数据库框架三件套用法详解

    Go 框架三件套 1 概论 Gorm Gorm 是一个已经迭代了10年 的功能强大的 ORM框架 在字节内部被广泛使用并且拥有非常丰富的开源扩展 Kitex Kitex 是字节内部 Golang 微服务 RPC 框架 具有高性能 强可扩展的
  • 云原生微服务应用的平台工程实践

    作者 纳海 01 微服务应用云原生化 微服务是一个广泛使用的应用架构 而如何使得微服务应用云原生化却是近些年一直在演进的课题 国内外云厂商对云原生概念的诠释大同小异 基本都会遵循 CNCF 基金会的定义 云原生技术有利于各组织在公有云 私有
  • 为分布式做准备吧——远程调用服务(RPC)和基于消息的通信(Message Queue)对比

    文章目录 系统结构 功能特点 应用 系统结构 RPC Message Queue 调用方式 Consumer lt gt Provider Sender lt gt Queue lt gt Receiver 调用对象 Consumer调用的
  • 领域驱动设计:DDD分层架构

    文章目录 DDD 分层架构 DDD 分层架构最重要的原则 DDD 分层架构推动架构演进 三层架构如何演进到 DDD 分层架构 微服务架构模型有好多种 例如整洁架构 CQRS 和六边形架构等等 每种架构模式虽然提出的时代和背景不同 但其核心理
  • Thrift、Dubbo、Spring Cloud 和 gRPC

    何为RPC RPC Remote Procedure Call 远程过程调用 是一种进程间通信方式 是一种技术的思想 而不是规范 它允许程序调用另一个地址空间 通常是共享网络的另一台机器上 的过程或函数 而不用程序员显式编码这个远程调用的细
  • 为分布式做准备吧——分布式服务架构设计概述

    文章目录 分布式服务框架设计架构原理 通信框架 长连接还是短链接 BIO还是NIO 序列化与反序列化 协议栈 服务路由 基于服务注册中心的订阅发布 集群容错 服务降级 分布式消息跟踪 分布式服务框架设计架构原理 通常 分布式服务框架的架构可
  • SpringCloud-服务注册与发现

    服务注册与发现 前面我们没有服务注册中心 也可以服务间调用 为什么还要服务注册 当服务很多时 单靠代码手动管理是很麻烦的 需要一个公共组件 统一管理多服务 包括服务是否正常运行 等 Eureka用于 服务注册 目前官网已经停止更新 1 Eu
  • Eureka迁移到Nacos之服务名称大小问题解决

    我们应用往Eureka中注册使用的名称以及应用内部通过Feign调用 使用的服务名称都是小写 如user service 但是注册到Eureka中后 应用的名称全部都是以大写的形式存储及展现 由于Eureka客户端对大小写的支持都是一样的
  • 微服务项目之项目简介

    目录 项目模式 技术栈 项目架构图 模块 主模块 项目模式 电商模式 市面上有5种常见的电商模式 B2B B2C C2B C2C O2O 1 B2B模式 B2B Business to Business 是指 商家与商家建立的商业关系 如
  • 第五章 Gateway--服务网关

    接上一篇文章开始网关之旅 首先告诉大家网关是什么 Gateway简介 怎么配置 怎么入门 执行流程等等相关介绍 第一章 微服务的架构介绍发展第二章 微服务环境搭建第三章 Nacos Discovery 服务治理第四章 Sentinel 服务
  • 双非本科进不了大厂?阿里技术四面+交叉面+HR面,成功拿到offer

    前言 前两天 我收到了阿里巴巴的实习offer 从学长内推开始面试到拿到最后offer经历了4面技术 一面交叉面和一面HR面 经过了漫长的等待和几次几乎折磨的面试之后 终于拿到了实习offer 自我介绍 本人来自西南某双非本科学校 该校学的
  • 微服务常见的配置中心简介

    微服务架构中 常见的配置中心包括以下几种 Spring Cloud Config Spring Cloud Config是官方推荐的配置中心解决方案 它支持将配置文件存储在Git SVN等版本控制系统中 通过提供RESTful API 各个
  • 微服务常见的配置中心简介

    微服务架构中 常见的配置中心包括以下几种 Spring Cloud Config Spring Cloud Config是官方推荐的配置中心解决方案 它支持将配置文件存储在Git SVN等版本控制系统中 通过提供RESTful API 各个

随机推荐

  • 《信号与系统》解读 第1章 信号与系统概述-5:非常重要!!!深入、详细地解读什么基本的复指数信号、IQ信号、欧拉公式?

    前言 正弦信号与复指数信号 更准确称为虚指数信号 是现代移动通信系统中最基本的信号 其中正弦信号常是射频调制的载波信号 而虚指数信号 包含了两路同频的正交正弦与余弦信号 常用于现代通信基带数字调制 因此理解正弦信号和复指数信号 是深入理解现
  • 计算机基础:原码补码反码计算

    结论 1 正数的原码 反码 补码 2 负数的反码 在其原码的基础上 符号位不变 其余各个位取反 负数的补码 在反码的基础上 1 负数的补码 在原码的基础上 符号位不变 其余各位取反 最后末位 13 0 在计算机种分 0与 0 它们的原码 补
  • electron-updater更新遇到的问题 The URL protocol of the current origin (‘app://.‘) is not supported

    目前的Vue脚手架 我使用的是vue cli4 默认会携带一个 registerServiceWorker的东西 这个东西是做什么的呢 首先说明 registerServiceWorker可以运用于主流框架 它只是为了简化缓存机制产生的js
  • 大学生团体天梯赛(第十届)

    题目地址 天梯赛 include
  • pppd详解_pppd拨号脚本说明文档

    加入调试信息 nodetach ipcp accept local ipcp accept remote usepeerdns 使用服务器端协商的 DNS defaultroute 使用默认线路 user card 电信 card 移动 c
  • 【ShaderToy】基础篇之谈谈点、线的绘制

    写在前面 写前面一篇的时候 发现还是不够基础 因此打算增加几篇基础篇 从点线面开始 希望可以更好理解 其实用Pixel Shader的过程很像在纸上绘画的过程 屏幕上的每一个像素对应了纸上的一个方格 如果你愿意 你甚至可以一个个判断像素的位
  • JS实现数组随机读取思路,js数组随机思路分析

    需要了解的 Math 对象方法 方法 描述 ceil x 对数进行上舍入 即向上取整 floor x 对 x 进行下舍入 即向下取整 round x 四舍五入 random 返回 0 1 之间的随机数 包含 0 不包含 1 一些实例说明 M
  • matlab函数库-optimset,非线性优化-matlab函数库-optimset

    创建或编辑一个最优化参数选项 句法规则 options optimset param1 value1 param2 value2 设置所有参数及其值 未设置的为默认值 options optimset optimfun 设置与最优化函数有关
  • layui左侧三级菜单2.0

    之前在layui 1 0的时候写过一个三级菜单 那时候用三级菜单还要自己扩展 与后台交互也显得麻烦 现在新版本的layui自动就可以实现三级菜单了 很多朋友在问 我就帮大家整理了一下样式大家可以改改 直接上代码 ul class layui
  • Android Geocoder(位置解析)

    Android中提供GPS定位服务 同时开发者可以对获得的位置信息进行解析 可以获得位置的详细信息 1 gps定位 在Eclipse中建立android应用程序 android sdk中提供了locationmanager来获得系统提供的定
  • Python练习(三)

    目录 传感器日志光照统计 文本字符分布 白鹿原 词频统计 习题 传感器日志光照统计 本题目附件提供了一个传感器日志文件 为文本类型 共 1 千行 每行包含了日期 时间和 4 种传感器读数值 其中 4 种传感器读数值分别是 温度 湿度 光照和
  • Spring Boot 实现接口幂等性的 4 种方案

    一 什么是幂等性 幂等是一个数学与计算机学概念 在数学中某一元运算为幂等时 其作用在任一元素两次后会和其作用一次的结果相同 在计算机中编程中 一个幂等操作的特点是其任意多次执行所产生的影响均与一次执行的影响相同 幂等函数或幂等方法是指可以使
  • 广点通sdk接入 _橱窗广告

    广点通sdk接入 橱窗广告 1 导入相关架包 写入相关权限和配置 android query full 0 26 7 jar GDTUnionSDK 4 8 513 jar
  • 【Elasticsearch学习笔记-基础篇3】Elasticsearch 聚集(aggregation)与过滤器(filter)

    前言 这篇主要总结一下 es 的聚集 aggregation 与过滤器 filter 不会涉及到具体的 API 操作与示例 主要总结概念性与本人理解的内容 以下是主要内容地图 在写聚集之前 我们先来看一下过滤器 过滤器 Filter 首先
  • linux安装odoo10,Centos7部署Odoo10生产环境

    该篇文章是我参考网上教程 整理出适合自己使用的方法 是通过odoo10的rpm包进行安装 一 安装odoo10 1 安装相关依赖 yum update yum install wget yum install y epel release
  • Spring Data JPA教程:审计(二)

    公众号 欢迎关注 书接上文 本文解决前面两个问题中的第二个问题 我们将为实体加上创建者和修改者的信息 首先创建一个返回授权用户信息的组件 获取授权用户信息 Spring Data JPA使用AuditorAware
  • c++基础——区分引用和指针

    目录 前言 1 引用 1 2引用的概念 1 2引用的定义 1 3引用与const 1 4引用的使用场景 2 指针 2 1概念 2 2获取对象的地址 2 3利用指针访问对象 2 3空指针 2 4野指针 2 4 1概念 2 4 2野指针的产生
  • Vs2019+Qt

    一 下载vs2019和qt 关于vs2019的配置方法不在赘述 上一篇已经讲解了 点击传送门 1 下载vs2019 直接在官网点击下载即可 是免费的 2 下载qt 在官网站下载即可 关于vs和qt安装 vs2019安装到自定义的目录就行 根
  • javascript 中函数调用方法:apply() 和 call()

    每个函数都包含两根非继承而来的方法 apply 和call 这两个方法的用途都是在特定的作用域中调用函数 实际上等于设置函数体内this对象的值 首先 apply 方法接收两个参数 一个是在其中运行函数的作用域 另一个是参数数组 其中第二个
  • Nacos - nacos-mysql.sql源文件与application.properties配置文件

    目录标题 前言 内容 初始化 MySQL 数据库 application properties 配置 前言 Nacos设置外部数据源 需要初始化nacos mysql sql源文件 修改application properties配置文件