【框架----Dubbo】基于开源Dubbo分布式RPC服务框架的部署整合

一、前言

Dubbo 作为SOA服务化治理方案的核心框架,用于提高业务逻辑的复用、整合、集中管理,具有极高的可靠性(HA)和伸缩性,被应用于阿里巴巴各成员站点,同时在包括JD、当当在内的众多互联网项目中有着广泛应用。dubbo 通过高性能 RPC 实现服务的输出和输入功能,框架基于 Spring Framework 进行无缝集成,使用过程中基本看不到 Dubbo API的直接调用,Dubbo服务支持RMI、Hessian、Dubbo、WebService等众多通信协议,同时提供了对服务的监控和管理平台,属于一套完整的SOA解决方案。

详细介绍请参照官方地址: http://alibaba.github.io/dubbo-doc-static/Home-zh.htm ,不再重复描述,本文主要记录了详细的开发整合步骤。 引用一张官方提供的dubbo架构图:

  • Provider    暴露服务方称之为“服务提供者”。

  • Consumer 调用远程服务方称之为“服务消费者”。

  • Registry    服务注册与发现的中心目录服务称之为“服务注册中心”。

  • Monitor     统计服务的调用次调和调用时间的日志服务称之为“服务监控中心”。

  • Container  服务运行“容器”。

二、源码构建

1、dubbo基于maven构建,需要先配置maven环境,当然如果你不想构建源码,也可以直接下载对应版本的发行包。

2、dubbo构建需要依赖opensesame组件,先通过 git 获取并安装opensesame,源码地址:

https://github.com/alibaba/opensesame//github.com/alibaba/opensesame

执行maven安装:mvn install

3、通过下面 git 地址获取对应版本的 dubbo 源码,官方推荐使用 dubbo 2.4.9,本文基于trunk版本构建。

https://github.com/alibaba/dubbo//github.com/alibaba/dubbo

maven构建:mvn clean install -Dmaven.test.skip,在漫长的等待后(过程需要通过网络下载依赖资源)会有如下提示,生成的 jar 包位于各自目录的target文件夹。

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] dubbo-parent ....................................... SUCCESS [  1.272 s]
[INFO] dubbo-common ....................................... SUCCESS [  4.572 s]
[INFO] dubbo-container .................................... SUCCESS [  0.024 s]
[INFO] dubbo-container-api ................................ SUCCESS [  1.148 s]
[INFO] dubbo-container-spring ............................. SUCCESS [  0.524 s]
[INFO] dubbo-container-jetty .............................. SUCCESS [  0.420 s]
[INFO] dubbo-container-log4j .............................. SUCCESS [  0.448 s]
[INFO] dubbo-container-logback ............................ SUCCESS [  0.468 s]
[INFO] dubbo-remoting ..................................... SUCCESS [  0.016 s]
[INFO] dubbo-remoting-api ................................. SUCCESS [  1.864 s]
[INFO] dubbo-remoting-netty ............................... SUCCESS [  1.125 s]
[INFO] dubbo-remoting-mina ................................ SUCCESS [  0.696 s]
[INFO] dubbo-remoting-grizzly ............................. SUCCESS [  0.680 s]
[INFO] dubbo-remoting-p2p ................................. SUCCESS [  1.048 s]
[INFO] dubbo-remoting-http ................................ SUCCESS [  0.616 s]
[INFO] dubbo-remoting-zookeeper ........................... SUCCESS [  0.716 s]
[INFO] dubbo-rpc .......................................... SUCCESS [  0.016 s]
[INFO] dubbo-rpc-api ...................................... SUCCESS [  1.608 s]
[INFO] dubbo-rpc-default .................................. SUCCESS [  1.396 s]
[INFO] dubbo-rpc-injvm .................................... SUCCESS [  0.760 s]
[INFO] dubbo-rpc-rmi ...................................... SUCCESS [  0.416 s]
[INFO] dubbo-rpc-hessian .................................. SUCCESS [  0.584 s]
[INFO] dubbo-rpc-http ..................................... SUCCESS [  0.580 s]
[INFO] dubbo-rpc-webservice ............................... SUCCESS [  0.536 s]
[INFO] dubbo-cluster ...................................... SUCCESS [  2.208 s]
[INFO] dubbo-registry ..................................... SUCCESS [  0.020 s]
[INFO] dubbo-registry-api ................................. SUCCESS [  1.241 s]
[INFO] dubbo-monitor ...................................... SUCCESS [  0.016 s]
[INFO] dubbo-monitor-api .................................. SUCCESS [  0.464 s]
[INFO] dubbo-filter ....................................... SUCCESS [  0.016 s]
[INFO] dubbo-filter-validation ............................ SUCCESS [  0.608 s]
[INFO] dubbo-filter-cache ................................. SUCCESS [  0.604 s]
[INFO] dubbo-registry-default ............................. SUCCESS [  0.540 s]
[INFO] dubbo-monitor-default .............................. SUCCESS [  0.588 s]
[INFO] dubbo-registry-multicast ........................... SUCCESS [  0.632 s]
[INFO] dubbo-config ....................................... SUCCESS [  0.016 s]
[INFO] dubbo-config-api ................................... SUCCESS [  1.500 s]
[INFO] dubbo-config-spring ................................ SUCCESS [  1.520 s]
[INFO] dubbo------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] dubbo-parent ....................................... SUCCESS [  1.272 s]
[INFO] dubbo-common ....................................... SUCCESS [  4.572 s]
[INFO] dubbo-container .................................... SUCCESS [  0.024 s]
[INFO] dubbo-container-api ................................ SUCCESS [  1.148 s]
[INFO] dubbo-container-spring ............................. SUCCESS [  0.524 s]
[INFO] dubbo-container-jetty .............................. SUCCESS [  0.420 s]
[INFO] dubbo-container-log4j .............................. SUCCESS [  0.448 s]
[INFO] dubbo-container-logback ............................ SUCCESS [  0.468 s]
[INFO] dubbo-remoting ..................................... SUCCESS [  0.016 s]
[INFO] dubbo-remoting-api ................................. SUCCESS [  1.864 s]
[INFO] dubbo-remoting-netty ............................... SUCCESS [  1.125 s]
[INFO] dubbo-remoting-mina ................................ SUCCESS [  0.696 s]
[INFO] dubbo-remoting-grizzly ............................. SUCCESS [  0.680 s]
[INFO] dubbo-remoting-p2p ................................. SUCCESS [  1.048 s]
[INFO] dubbo-remoting-http ................................ SUCCESS [  0.616 s]
[INFO] dubbo-remoting-zookeeper ........................... SUCCESS [  0.716 s]
[INFO] dubbo-rpc .......................................... SUCCESS [  0.016 s]
[INFO] dubbo-rpc-api ...................................... SUCCESS [  1.608 s]
[INFO] dubbo-rpc-default .................................. SUCCESS [  1.396 s]
[INFO] dubbo-rpc-injvm .................................... SUCCESS [  0.760 s]
[INFO] dubbo-rpc-rmi ...................................... SUCCESS [  0.416 s]
[INFO] dubbo-rpc-hessian .................................. SUCCESS [  0.584 s]
[INFO] dubbo-rpc-http ..................................... SUCCESS [  0.580 s]
[INFO] dubbo-rpc-webservice ............................... SUCCESS [  0.536 s]
[INFO] dubbo-cluster ...................................... SUCCESS [  2.208 s]
[INFO] dubbo-registry ..................................... SUCCESS [  0.020 s]
[INFO] dubbo-registry-api ................................. SUCCESS [  1.241 s]
[INFO] dubbo-monitor ...................................... SUCCESS [  0.016 s]
[INFO] dubbo-monitor-api .................................. SUCCESS [  0.464 s]
[INFO] dubbo-filter ....................................... SUCCESS [  0.016 s]
[INFO] dubbo-filter-validation ............................ SUCCESS [  0.608 s]
[INFO] dubbo-filter-cache ................................. SUCCESS [  0.604 s]
[INFO] dubbo-registry-default ............................. SUCCESS [  0.540 s]
[INFO] dubbo-monitor-default .............................. SUCCESS [  0.588 s]
[INFO] dubbo-registry-multicast ........................... SUCCESS [  0.632 s]
[INFO] dubbo-config ....................................... SUCCESS [  0.016 s]
[INFO] dubbo-config-api ................................... SUCCESS [  1.500 s]
[INFO] dubbo-config-spring ................................ SUCCESS [  1.520 s]
[INFO] dubbo
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值