检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
通过mall前端页面进行注册,注册用户名为“SDK-test”。 查看注册后数据库ds1管理员表的用户数据。 结论:数据库ds1新增“SDK-test”用户名,SDK提供的服务正常运行。 SDK切换数据源测试 验证SDK提供的切换数据源功能,可在yaml直接配置当前活跃的数据源,使用之前已注册的“SDK-test”用户名进行登录验证。
monitor-id: xxxx #MAS监控id databaseName: xxxx #MAS监控的Mongo数据库 cloud: xxxx region: xxxxx azs: az1 etcd: address: 127.0.0.1:2379 #
xxxx #应用id,从MAS服务实例页面查询获取 monitor-id: xxxx #监控器id,从MAS服务实例页面查询获取MAS监控id databaseName: xxxx #MAS监控的Mongo数据库 cloud: xxxx region:
配置文件示例config_Redis.yaml props: version: v1 appId: xxx monitorId: xxxx cloud: xxxx region: xxxxx azs: az1 etcd: address: xxx.xxx.xxx.xxx:xxxx
cd配置、sources数据源配置、router路由配置。 如果使用MAS服务,props配置、etcd配置则必须要配置,sources数据源配置需要与MAS服务中连接池中的命名一致。如果不对接MAS服务,props配置、etcd配置无需配置,sources数据源配置本地所用数据库即可。
// 和MAS服务监控页中的名称保持一致:dc1和dc2 hosts: xxx.xxx.xxx.xxx:xxxx password: xxxxxx type: normal cloud: xxxx
可落地的多活容灾标准规范。 咨询+专业实施服务。 MAS架构如图1所示。 图1 MAS服务架构示图 区域(Region):从地理位置和网络时延维度划分,同一个Region内共享弹性计算、块存储、对象存储、VPC网络、弹性公网IP、镜像等公共服务。Region分为通用Region和专属
MAS-SDK版本变更与下载 MAS-SDK版本变更记录及下载地址如下: 表1 MAS-DB-SDK版本变更 开发语言 版本及下载地址 变更描述 Java v 1.2.0-RELEASE 初次发布。 Java v 1.2.1-RELEASE 支持本地读单边写特性。 Java v 1
cd配置、sources数据源配置、router路由配置。 如果使用MAS服务,props配置、etcd配置则必须要配置,sources数据源配置需要与MAS服务中连接池中的命名一致。如果不对接MAS服务,props配置、etcd配置无需配置,sources数据源配置本地所用数据库即可。
com.google.errorprone:error_prone_annotations 2.5.1 compile spring-cloud-starter-huawei-devspore-datasource com.huaweicloud.devspore:devspore-datasource
SpringBoot项目接入MAS-ElasticSearch-SDK MAS-ElasticSearch-SDK使用Maven获取版本,根据实际情况设置Maven远程仓库地址等相关配置。 在pom.xml文件中引入依赖。 <properties> <!--以最新的版本号为准-->
配置文件示例config_Redis_chaos.yaml props: version: v1 appId: xxx monitorId: xxxx cloud: xxxx region: xxxxx azs: az1 etcd: address: xxx.xxx.xxx.xxx:xxxx
RedisServer密码。 type 是 string cluster, master-slave, normal。 RedisServer类型。 cloud 是 string - RedisServer所属云。 region 是 string - RedisServer所属Region。 azs
MAS-GO-SDK使用手册 Mysql Redis 故障注入
compile com.huaweicloud.sdk:huaweicloud-sdk-aom 3.0.91 compile spring-cloud-starter-huawei-devspore-dcs com.huaweicloud.devspore:devspore-dcs latest
<groupId>com.huaweicloud.devspore</groupId> <artifactId>spring-cloud-starter-huawei-devspore-datasource</artifactId> <version>${lastest}</version>
文档中关于SDK对应yaml配置文件的获取方式 进入MAS实例控制台“监控列表”页面。 单击“更多 > SDK接入配置”。 复制配置参数。 MAS端配置与本地配置不一致时,哪一个生效? 答:MAS端配置与本地配置,MAS端配置覆盖本地配置,MAS端配置生效。 父主题: 常见问题
接入指南 SpringBoot项目接入MAS-DB-SDK Spring项目接入MAS-DB-SDK 父主题: MAS-DB-SDK使用手册
serverSelectionTimeoutMS 否 Integer 服务器选择超时(以毫秒为单位)。 localThresholdMS 否 Integer 当与副本集中的多个MongoDB实例进行通信时,驱动程序只会将请求发送到响应时间小于或等于响应时间最快的服务器加上本地阈值的服务器,以毫秒为单位。 heartbeatFrequencyMS
使用场景 单边读写 本地读单边写 强制路由 使用ShardingSphereDataSource场景 使用多数据源 父主题: MAS-DB-SDK使用手册