zookeeper
下载 zookeeper:https://zookeeper.apache.org/releases.html#download
修改zoo.cfg中dataDir路径
启动zkServer
redis
启动redis ,6379端口 无密码启动
Mysql
- 创建MySQL数据库
create database if not exists `txlcn-demo` default charset utf8 collate utf8_general_ci;
- 创建数据表
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
-
克隆开发分支上的源代码
git clone https://github.com/apache/dubbo-admin.git
-
指定注册表地址
dubbo-admin-server/src/main/resources/application.properties
-
建立
mvn clean package
-
开始
mvn --projects dubbo-admin-server spring-boot:run
ORcd dubbo-admin-distribution/target
;java -jar dubbo-admin-0.1.jar
-
访问
http://localhost:8080
如果地址被占用:mvn --projects dubbo-admin-server spring-boot:run -Dspring-boot.run.arguments=--server.port=8999