LCN分布式事务集群

以前我在本身的博客里面介绍了lcn怎么集成在springCloud上,其实官网已经讲的很是详细。关于lcn集群。官网也有介绍,而且分为方式一和方式二,由于方式二比较简单,故在咱们公司,我采用的是方式二。只须要3步就行了:
1.从新部署一个项目,applicationName和以前的lcn事务同样,如,个人是localhost:7000和localhost:7001,application-name都是tx-manager spring

clipboard.png

2.在zuul层,配置路由:app

clipboard.png

http://zuul/tx/**所有转发到tx-manager上面。
3.咱们具体使用lcn的模块,都在yml文件里面配置过一个:url

tm:
  manager:
    #url: http://localhost:7000/tx/manager  
    url: http://localhost:8100/tx/tx/manager/

如上,使用application-name+zuul网关(localhost:8100即便个人网关地址)转发,将请求转发到集群上,便可spa

相关文章
相关标签/搜索