dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡
项目描述
本案例用dubbo+zookeeper+springboot+mybatis搭建分布式架构,一个服务消费,两个服务提供,并支持轮询、随机的负载均衡策略。 案例很简单,结构很清晰,适合小白学习。案例没有炫彩的页面,只是单单的访问连接,我们玩的是架构,不是炫彩的前端技术。
运行环境
jdk7+tomcat7+mysql+IntelliJ IDEA+maven
项目技术(必填)
dubbo+zookeeper+springboot+mybatis
1)dubbo - 高性能的Java RPC 框架
2) zookeeper - Dubbo推荐使用的分布式服务注册、服务发现。
3) springboot - “约定大于配置" , 相对spring框架, boot 减少了相当多的配置,只需一个注解,搞定
4)mybtis - 持久层orm框架
5)mavan - 项目托管
数据库文件
链接1:https://pan.baidu.com/s/1UwKXrZ0o1VSYOUlPhX5Auw
链接:https://pan.baidu.com/s/1vPQxu6NHlrWQk9FJMe_LHg 密码:hrws
jar包文件
maven构建,不需要另外提供jar包
是否原创(转载必填原文地址)
原创
项目截图(必填)
2. 一些配置文件
3. 其中一个服务提供者的业务
运行截图(必填)
启动三个服务
访问获取到数据
http://localhost:8080/users.json
注意事项
项目启动前,必须先启动zookeeper,不然怎么注册服务?对吧
请自行安装zookeeper, 文件太大了,上传麻烦
下载地址:http://mirrors.hust.edu.cn/apache/zookeeper/
D:\zookeeper-3.4.13\conf\下配置zoo.cfg
# The number of milliseconds of each tick tickTime=2000 # The number of ticks that the initial # synchronization phase can take initLimit=10 # The number of ticks that can pass between # sending a request and getting an acknowledgement syncLimit=5 # the directory where the snapshot is stored. # do not use /tmp for storage, /tmp here is just # example sakes. dataDir=/tmp/zookeeper # the port at which the clients will connect clientPort=2181 # the maximum number of client connections. # increase this if you need to handle more clients #maxClientCnxns=60 # # Be sure to read the maintenance section of the # administrator guide before turning on autopurge. # # http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance # # The number of snapshots to retain in dataDir #autopurge.snapRetainCount=3 # Purge task interval in hours # Set to "0" to disable auto purge feature #autopurge.purgeInterval=1
猜你喜欢
- dubbo项目搭建实例(自己学习做的,新生借鉴就可以)
- dubbo+spring boot+mybatis+redis分布式框架项目实例demo
- Spring+Dubbo+zk,maven项目搭建实例
- 三分钟搭建一个springboot2.0+dubbo多实例分布式项目
- spring、springmvc、mybatis、dubbo、zookeeper简单架构分布式系统
- 阿里巴巴SOA服务化治理方案的核心框架dubbo入门demo演示实例
- Spring+Mybatis+SpringMVC+Maven+MySql项目搭建实例
- 快速开发框架之jfinal入门项目搭建实例
- cxf+spring mvc+web service+maven服务端项目搭建实例
- Spring整合Quartz实现分布式集群实例
- spring boot+mybatis+mysql项目搭建入门实例
- springcloud微服务架构项目搭建实例,基于maven多模块搭建
- /
- /dubbo
- /dubbo/.idea
- /dubbo/.idea/compiler.xml
- /dubbo/.idea/misc.xml
- /dubbo/.idea/uiDesigner.xml
- /dubbo/.idea/workspace.xml
- /dubbo/dubbo-api
- /dubbo/dubbo-api/pom.xml
- /dubbo/dubbo-api/src
- /dubbo/dubbo-api/src/main
- /dubbo/dubbo-api/src/main/java
- /dubbo/dubbo-api/src/main/java/cn
- /dubbo/dubbo-api/src/main/java/cn/jsxwsl
- /dubbo/dubbo-api/src/main/java/cn/jsxwsl/dubbo
- /dubbo/dubbo-api/src/main/java/cn/jsxwsl/dubbo/bean
- /dubbo/dubbo-api/src/main/java/cn/jsxwsl/dubbo/service
- /dubbo/dubbo-api/src/main/java/cn/jsxwsl/dubbo
- /dubbo/dubbo-api/src/main/java/cn/jsxwsl
- /dubbo/dubbo-api/src/main/java/cn
- /dubbo/dubbo-api/src/main/java
- /dubbo/dubbo-api/src/main
- /dubbo/dubbo-consumer
- /dubbo/dubbo-consumer/src
- /dubbo/dubbo-consumer/src/main
- /dubbo/dubbo-consumer/src/main/java
- /dubbo/dubbo-consumer/src/main/java/cn
- /dubbo/dubbo-consumer/src/main/java/cn/jsxwsl
- /dubbo/dubbo-consumer/src/main/java/cn/jsxwsl/dubbo
/dubbo/dubbo-consumer/src/main/java/cn/jsxwsl/dubbo/DubboConsumerApp.java
- /dubbo/dubbo-consumer/src/main/java/cn/jsxwsl/dubbo/controller
- /dubbo/dubbo-consumer/src/main/java/cn/jsxwsl/dubbo
- /dubbo/dubbo-consumer/src/main/java/cn/jsxwsl
- /dubbo/dubbo-consumer/src/main/java/cn
- /dubbo/dubbo-consumer/src/main/java
- /dubbo/dubbo-consumer/src/main
- /dubbo/dubbo-consumer/src
- /dubbo/dubbo-user-service-provider-10001
- /dubbo/dubbo-user-service-provider-10001/src
- /dubbo/dubbo-user-service-provider-10001/src/main
- /dubbo/dubbo-user-service-provider-10001/src/main/java
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn/jsxwsl
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn/jsxwsl/dubbo
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn/jsxwsl/dubbo/dao
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn/jsxwsl/dubbo
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn/jsxwsl
- /dubbo/dubbo-user-service-provider-10001/src/main/java/cn
- /dubbo/dubbo-user-service-provider-10001/src/main/java
- /dubbo/dubbo-user-service-provider-10001/src/main
- /dubbo/dubbo-user-service-provider-10001/src
- /dubbo/.idea
- /dubbo
- 原 阿里巴巴SOA服务化治理方案的核心框架dubbo入门demo演示实例
- 原 dubbo项目搭建实例(自己学习做的,新生借鉴就可以)
- 原 spring、springmvc、mybatis、dubbo、zookeeper简单架构分布式系统
- 原 Spring+Dubbo+zk,maven项目搭建实例
- 原 dubbo+spring boot+mybatis+redis分布式框架项目实例demo
- 原 三分钟搭建一个springboot2.0+dubbo多实例分布式项目
- 原精 dubbo+zookeeper+spring mvc+mybatis+mysql实现rpc面向服务编程搭建教程
- 原精 spring+spring mvc+mybatis+mysql+dubbo整合开发任务流程后台管理系统
- 原 基于spring boot整合dubbo实现简单的增删改查案例
- 原 spring mvc+spring+mybatis+shiro+easyui整合开发后台用户权限管理系统改造为基于dubbo的分布式服务项目