TX-LCN demo 之 Debbo 测试

本文详细介绍了如何下载和配置ZooKeeper、MySQL及Redis,包括创建数据库和数据表的过程,并提供了tx-lcndemo项目的下载链接及配置说明。此外,还涵盖了dubboAdmin的下载、配置和启动步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

zookeeper

下载 zookeeper:https://zookeeper.apache.org/releases.html#download

修改zoo.cfg中dataDir路径

启动zkServer

redis

启动redis ,6379端口 无密码启动

 

Mysql

  1. 创建MySQL数据库
create database if not exists `txlcn-demo` default charset utf8 collate utf8_general_ci;
  1. 创建数据表
create table `t_demo` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `kid` varchar(45) DEFAULT NULL,
  `group_id` varchar(64) DEFAULT NULL,
  `demo_field` varchar(255) DEFAULT NULL,
  `app_name` varchar(128) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

tx-lcn demo

下载tx-lcn demo: https://github.com/codingapi/txlcn-demo.git

修改 

txlcn-demo-tm 

txlcn-demo-dubbo-service-a 

txlcn-demo-dubbo-service-b

txlcn-demo-dubbo-service-c

中的 application.properties mysql地址,其他使用默认

依次启动4个服务

具体业务代码如下:

访问请求得到以下结果

 

传入ex参数后,数据回滚,不插入数据

dubbo Admin

下载地址: https://github.com/apache/dubbo-admin

  1. 克隆开发分支上的源代码 git clone https://github.com/apache/dubbo-admin.git

  2. 指定注册表地址 dubbo-admin-server/src/main/resources/application.properties

  3. 建立

    • mvn clean package
  4. 开始

    • mvn --projects dubbo-admin-server spring-boot:run
      OR
    • cd dubbo-admin-distribution/targetjava -jar dubbo-admin-0.1.jar
  5. 访问 http://localhost:8080

如果地址被占用:mvn --projects dubbo-admin-server spring-boot:run -Dspring-boot.run.arguments=--server.port=8999 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值