Spring Cloud Alibaba 版本对照表,集成nacos,sentinel,seata

 一、Spring Cloud Alibaba 版本对照网址

https://github.com/alibaba/spring-cloud-alibaba/wiki/%E7%89%88%E6%9C%AC%E8%AF%B4%E6%98%8E

 

二、集成nacos

nacos源码编译打包_qq_41369135的博客-CSDN博客

连接mysql

nacos\conf下的application.properties

spring.datasource.platform=mysql

db.num=1
db.url.0=jdbc:mysql://localhost:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.user=root
db.password=123456

然后导入sql文件(conf/nacos-mysql.sql)

修改为单机启动(bin/startup.cmd)

修改启动内存大小

 修改密码(直接数据库修改)

数据采用的是BCrypt加密 我们可以找一个网站输入自定义密码 然后加密 把加密后的密码存到数据库中user表中

Bcrypt密码在线生成计算器 http://www.ab126.com/goju/10822.html

自定义用户名和密码输入保存,然后重启nacos 。

启动(双击startup.cmd)

输入localhost:8848/nacos

三、集成sentinel 

重学SpringCloud系列八之分布式系统流量卫兵sentinel - 腾讯云开发者社区-腾讯云

介绍 · alibaba/Sentinel Wiki · GitHub

window启动脚本

@echo off
d:
cd D:\alibaba\sentinel
java -Xms64m -Xmx256m -Dserver.port=8849 -Dcsp.sentinel.dashboard.server=127.0.1.1:8850 -Dcsp.sentinel.heartbeat.client.ip=127.0.1.1 -Dproject.name=sentinel-dashboard -Dsentinel.dashboard.auth.username=sentinel -Dsentinel.dashboard.auth.password=sdoqwer1poiu -Dserver.servlet.session.timeout=60m -jar sentinel-dashboard-1.8.5.jar

sentinel启动参数

-Dserver.port=8080:用于指定 Sentinel 控制台端口为 8080,如若8080端口冲突,可使用 -Dserver.port=新端口 进行设置。。
-Dcsp.sentinel.dashboard.server=localhost:8080:指定控制台地址和端口,会自动向该地址发送心跳包。地址格式为:hostIp:port,l配置成ocalhost:8080即监控自己
-Dproject.name=sentinel-dashboard:指定Sentinel控制台程序显示的名称
-Dcsp.sentinel.log.dir:指定Sentinel 日志文件目录,默认是:${user.home}/logs/csp/
-Dcsp.sentinel.api.port=xxxx:本地的 Sentinel 客户端端口(可选,默认是 8719,有冲突会尝试向后探测)。若启动多个应用,则需要通过 -Dcsp.sentinel.api.port=xxxx 指定客户端监控 API 的端口(默认是 8719)。
-Dcsp.sentinel.app.type=1:从 1.6.3 版本开始,控制台支持网关流控规则管理。启动参数以将您的服务标记为 API Gateway,在接入控制台时您的服务会自动注册为网关类型,然后您即可在控制台配置网关规则和 API 分组。

用户可以通过如下参数进行鉴权配置:
-Dsentinel.dashboard.auth.username=sentinel 用于指定控制台的登录用户名为 sentinel;
-Dsentinel.dashboard.auth.password=123456 用于指定控制台的登录密码为 123456;如果省略这两个参数,默认用户和密码均为 sentinel;
-Dserver.servlet.session.timeout=7200 用于指定 Spring Boot 服务端 session 的过期时间,如 7200 表示 7200 秒;60m 表示 60 分钟,默认为 30 分钟;

sentinel规则持久化(基于nacos实现sentinel数据持久化)

Sentinel-深度使用_kaico2018的博客-CSDN博客_sentinel 内存

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,关于这个问题,我可以提供一些参考资料。首先,Spring Cloud是一个基于Spring框架的微服务架构开发工具包,提供丰富的开箱即用的组件和框架,可以较为方便地实现微服务的开发、部署和管理。而Nacos是阿里巴巴开源的一个面向服务中心的动态服务发现、配置管理和服务治理平台,可以提供服务注册与发现、配置管理、流量管理、域名解析等功能。Seata是阿里巴巴开源的一个分布式事务解决方案,可以提供数据源代理、事务协调、幂等性设计等功能,用于解决微服务架构下的分布式事务问题。 在Spring Cloud集成NacosSeata,需要进行如下步骤: 1. 引入相应的依赖,例如在pom.xml文件中添加如下依赖: ```xml <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <version>2.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <version>2.2.3.RELEASE</version> </dependency> <dependency> <groupId>io.seata</groupId> <artifactId>seata-spring-boot-starter</artifactId> <version>1.4.2</version> </dependency> ``` 其中,spring-cloud-starter-alibaba-nacos-config和spring-cloud-starter-alibaba-nacos-discovery是Nacos的客户端依赖,seata-spring-boot-starter是Seata的客户端依赖。 2. 配置Nacos的地址和Seata的事务配置,例如在application.yml文件中添加如下配置: ```yaml spring: cloud: nacos: discovery: server-addr: localhost:8848 config: server-addr: localhost:8848 file-extension: yml seata: tx-service-group: my_test_tx_group application-id: ${spring.application.name} enabled: true mybatis: configuration: # ... seata: enabled: true application-id: ${spring.application.name} tx-service-group: my_test_tx_group config: transport: enabled: true type: TCP server: localhost:8091 heartbeat: true heartbeat.interval.ms: 5000 disableHeartbeatChecking: true client-selector: rnd client-list: 127.0.0.1:8091 shutdown.timeout.ms: 5000 registry: type: Nacos nacos: application: ${spring.application.name} serverAddr: localhost:8848 namespace: public ``` 其中,Nacos的地址和Seata的事务配置可以根据具体情况自行修改。 3. 配置完毕后,就可以使用Nacos作为Spring Cloud的注册中心和配置中心,使用Seata来解决分布式事务问题了。 以上是关于如何在Spring Cloud集成NacosSeata的简要介绍,希望能够帮助到你。如果你还有其他问题,可以继续向我提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值