码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 获取dubbo源码编译并导入idea以及启动入门项目dubbo-demo


    一直想研究下dubbo,然后就动手开始干啦。。
    首先说一下dubbo说明文档的一些坑,按照文档部署不一定能部署起来,不过它是一个基本的参考,建议部署dubbo是参考dubbox的部署说明。很神奇。
    1、下载zookeeper并部署
    下载地址
    http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.10/
    下载后解压并编辑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=D:\zookeeper\data
    dataLogDir=D:\zookeeper\log
    # 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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    然后启动bin/zkServer.cmd启动zookeeper服务。
    这里写图片描述
    2、获取dubbo源码
    话说阿里又开始更新dbuuo(官网地址http://dubbo.apache.org)了,
    GitHub源码地址:
    控制中心:[ https://github.com/apache/incubator-dubbo-ops ]
    dubbo项目地址:[ https://github.com/apache/incubator-dubbo ]
    在你的workspace中打开git客户端,然后开始下载项目
    输入命令

    git clone https://github.com/apache/incubator-dubbo.git
    
    • 1

    等待下载完,然后输入

    cd incubator-dubbo
    
    • 1

    然后输入

    mvn install -Dmaven.test.skip=true
    
    • 1

    然后再输入

    mvn idea:idea  或 mvn eclipse:eclipse  (根据自己使用的开发工具而言进行选择)
    
    • 1

    然后再进行控制中心项目进行编译,也是输入命令

    git clone https://github.com/apache/incubator-dubbo-ops.git
    
    • 1

    等待下载完,然后输入

    cd incubator-dubbo
    
    • 1

    然后输入

    mvn install -Dmaven.test.skip=true
    
    • 1

    然后再输入

    mvn idea:idea  或 mvn eclipse:eclipse  (根据自己使用的开发工具而言进行选择)
    
    • 1

    至此,项目已经编译好了,然后可以打开idea并导入相关项目如下图:
    这里写图片描述
    dubbo-demo项目分为三个主要模块,分别是dubbo-demo-api、dubbo-demo-consumer、dubbo-demo-provider。这里需要修改连个地方
    dubbo-demo-consumer下的dubbo-demo-consumer.xml就是把订阅中心改为zookeeper,端口自定义
    这里写图片描述

     
    
    • 1

    然后启动Consumer类 (直接右键运行main方法即可)
    dubbo-demo-provider下的dubbo-demo-provider.xml中的配置修改为zookeeper发布
    这里写图片描述

    
    
    • 1

    主要作用可以参考http://dubbo.apache.org 有详细描述。
    这里写图片描述
    然后启动Provider类 (直接右键运行main方法即可)
    这里写图片描述
    这里写图片描述
    控制中心项目最主要的就是dubbo-admin了,它是一个web你可以在idea里发布它到Tomcat或者用target下编译好的jar直接部署到Tomcat。
    然后访问http://localhost:8080 输入用户名:root 密码:root 或 用户名:guest 密码:guest即可
    这里写图片描述

    参考:
    https://xuliugen.gitbooks.io/javaweb-1/31-dubbo%E7%AE%80%E4%BB%8B.html
    http://dubbo.apache.org/books/dubbo-user-book/preface/usage.html
    http://dubbo.apache.org/books/dubbo-admin-book/install/admin-console.html

  • 相关阅读:
    【Leetcode】旋转系列(数组、矩阵、链表、函数、字符串)
    jdk1.8新特性简介
    Jmeter初始学习
    Spring Security 6.x 系列【67】认证篇之安装 ApacheDS
    elasticsearch创建索引和mapping
    c++仿函数
    Git应用详解第七讲:Git refspec与远程分支的重要操作
    vue3 自定义指令
    Spring MVC中如何限制Controller为POST或GET方式接收参数呢?
    BUG:阿里巴巴图标库引入链接后,icon有时候会不显示的话svg下载到本地使用
  • 原文地址:https://blog.csdn.net/m0_67401417/article/details/126605303
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号