Eureka 注册中心

Survive by day and develop by night.
talk for import biz , show your perfect code,full busy,skip hardness,make a better result,wait for change,challenge Survive.
happy for hardess to solve denpendies.

目录

在这里插入图片描述

概述

Eureka是 Seata 组件中重要的注册中心实现.

需求:

设计思路

实现思路分析

1.快速上手

当您将Eureka整合到您的 Seata工程之前,请确保后台已经启动 Eureka Server服务。如果您尚且不熟悉 Eureka的基本使用的话,可先行参考 Eureka快速入门。建议使用 Eureka 2.X 及以上的版本。

2.增加 Maven 依赖

首先,您需要将 spring-cloud-starter-netflix-eureka-client 的 Maven 依赖添加到您的项目 pom.xml 文件中,建议使用 Seata 1.4.0+,spring-cloud-starter-alibaba-seata的版本与对应微服务版本对应关系请参考版本说明。

io.seata seata-spring-boot-starter 最新版 com.alibaba.cloud spring-cloud-starter-alibaba-seata 2.1.2.RELEASE及以上版本 io.seata seata-spring-boot-starter org.springframework.cloud spring-cloud-starter-netflix-eureka-client 2.0.0.RELEASE及以上版本

3.Client端配置注册中心

在 application.yml 中加入对应的配置中心,其余配置参考:
seata:
tx-service-group: my_test_tx_group
service:
vgroup-mapping:
my_test_tx_group: seata-server # 此处配置对应Server端配置registry.eureka.application的值
registry:
type: eureka
eureka:
service-url: http://localhost:8761/eureka
weight: 1

Server端配置注册中心

registry {
type = “eureka”

eureka {
serviceUrl = “http://localhost:8761/eureka”
application = “seata-server”
weight = “1”
}
}

参考资料和推荐阅读

  1. https://seata.io/zh-cn/docs/user/registry/eureka.html

欢迎阅读,各位老铁,如果对你有帮助,点个赞加个关注呗!~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

执于代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值