Dubbo+zookeeper+dubbo Management Console Practice Demo

Source: Internet
Author: User

  • 1, install and start the Zookeeper registration service, which uses the 3.4.6 version.

    After the download decompression, under zookeeper-3.4.6/conf/, the default is no zoo.cfg, only one zoo_sample.cfg.

    CMD command line into the zookeeper-3.4.6/bin/directory, run directly zkserver.cmd error, the Zoo.cfg file is not found.
    It is therefore necessary to copy a zoo.cfg under the zookeeper-3.4.6/conf/ zoo_sample.cfg and configure the data storage path Datadir=e://tmp/zookeeper

    Run Zkserver.cmd again to start the success.

    2, download the Dubbo Manager War package, which is used in version 2.5.4.

    :Http://pan.baidu.com/s/1o8iYIfC

    after downloading the extract, run directly under the tomcat/webapp/directory.
    Here tomcat is Port 9090, Access http://127.0.0.1:9090/dubbo-admin-2.5.4/, the Authentication login window will appear. Under the Web-inf directory, view the Dubbo.properties file to see the user name password configuration and zookeeper registered address information

    dubbo.registry.address=zookeeper://127.0.0.1:2181

    Dubbo.admin.root.password=root

    Dubbo.admin.guest.password=guest

    Log in using Root/root.


    View "service Governance"-"services", currently no service information available


    3, develop a Dubbo server and register to zookeeper.

    Maven dependencies:

    <<dependencies>>

    <<dependency>>

    <<groupId>>junit<</groupId>>

    <<artifactId>>junit<</artifactId>>

    <<version>>4.11<</version>>

    <<scope>>test<</scope>>

    <</dependency>>

    <<dependency>>

    <<groupId>>org.springframework<</groupId>>

    <<artifactId>>spring-core<</artifactId>>

    <<version>>3.1.1.RELEASE<</version>>

    <</dependency>>

    <<dependency>>

    <<groupId>>org.springframework<</groupId>>

    <<artifactId>>spring-web<</artifactId>>

    <<version>>3.1.1.RELEASE<</version>>

    <</dependency>>

    <<dependency>>

    <<groupId>>org.springframework<</groupId>>

    <<artifactId>>spring-webmvc<</artifactId>>

    <<version>>3.1.1.RELEASE<</version>>

    <</dependency>>

    <<dependency>>

    <<groupId>>com.alibaba<</groupId>>

    <<artifactId>>dubbo<</artifactId>>

    <<version>>2.5.2<</version>>

    <</dependency>>

    <<dependency>>

    <<groupId>>org.javassist<</groupId>>

    <<artifactId>>javassist<</artifactId>>

    <<version>>3.18.1-GA<</version>>

    <</dependency>>

    <<dependency>>

    <<groupId>>org.jboss.netty<</groupId>>

    <<artifactId>>netty<</artifactId>>

    <<version>>3.2.5.Final<</version>>

    <</dependency>>

    <<dependency>>

    <<groupId>>com.101tec<</groupId>>

    <<artifactId>>zkclient<</artifactId>>

    <<version>>0.4<</version>>

    <</dependency>>

    <</dependencies>>

    Project structure

    Interface declaration:

    650) this.width=650; "src=" Http://img.bimg.126.net/photo/VC7nzrv_9a1TISzEvfH9eA==/4001166793959179847.jpg "width= "385" height= "214" alt= "Dubbo+zookeeper+dubbo Management Console Practice Demo" style= "border:0px;height:auto;margin:0px;padding:0px; List-style:none; "/>
    Spring Description declaration file:

    Start the service, either using the Web. XML load to start or the Main method to start:


    Once started, review the Service governance-services again to see that the service has been successfully registered:



    4, develop a Dubbo consumer.

    Maven relies on ibid.

    Project structure:


    Spring Description declaration file:


    View Dubbo Management Console, consumer information:

    Use the main method to test the remote call to the Dubbo service:


    Console output Results:



    Summary: At this point, a relatively complete Dubbo framework invocation instance has been completed, of course, for such a widely used and mature distributed application framework, there are a lot of things that can be further researched. Core Technologies: Maven,springmvc MyBatis Shiro, Druid, Restful, Dubbo, Zookeeper,redis,fastdfs, Activemq,nginx
    1. Project Core Code structure

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/Goz2TSj6v24kaqQDAIWgLw==/ 6598225353437986053.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    Project module Dependencies

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/TC5PboH2UrIg4awkAMOyrw==/ 4851221223708896623.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    Special Reminder: Developers can service or Dubbo their business rest when developing

    2. Project Dependency Introduction

    2.1 Backend Management system, rest service system, Scheculer timing dispatch system depend on such as:

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/j2cCMu9-DPoHFYVkXI7EkA==/ 1632273390045933411.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    2.2 Dubbo Independent service projects depend on such as:

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/mzBW9KCk1Ji2GPUJaGu6Qg==/ 6598060426694000458.png "style=" line-height:28px;border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    3. Project function section:

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/R2RTUQTg1qRIYtR4JE545A==/ 4940167316349343345.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/Kh41psRstvnkqv_VpeFUAw==/ 6631327250448980134.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/M9iZx7_jKbRN6QfH2TflPA==/ 4910612443794473834.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/WnBR5XwOIAFFQTbo3P2I5w==/ 6631353638728044520.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/CbSXpaSEViBxBVvYH_UzSw==/ 4937634041558914975.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/JHKoVqcKwJoTf_UkHO0xpg==/ 6631285469007125325.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/AGCXOstkj3CjJX8FL12t3w==/ 6631369031890838044.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    Zookeeper, Dubbo service startup

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/aeb_ZacYQ2x3RkZmZRvXfg==/ 6631277772425730935.jpg "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/8uGn2q8DYGHEfap7l5i7eg==/ 6598168178833342534.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    Dubbo Control Console

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/OjhpzGvQ1A3wYhNG-3yiiQ==/ 4910612443794473838.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>


    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/xDDLDlx-0BYku3c-PT1hSA==/ 6631377827983857282.jpg "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/Pe2usGq905zYbeABB19BFA==/ 6598242945624026279.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/Pe2usGq905zYbeABB19BFA==/ 6598242945624026279.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/NZyKHiQnl9HMUG4vgAJCmA==/ 6598242945624026280.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img1.ph.126.net/zdqiMlYZE8enU9OOJI5hkg==/ 6598124198368231315.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/iC0Apk3e_SfWpH5Sxzdoeg==/ 6631397619193157043.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    Rest Service Platform

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/i_7g-c5Bu6iUwnen5c-oTA==/ 6631272274867597160.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/RJW86mKqfpAQosKdxNDvrw==/ 6631262379262944404.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img2.ph.126.net/iKI6fMvQvEcLni70qSOhrg==/ 4834614200082603008.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>

    650) this.width=650; "alt=" Distributed framework Introduction-KAFKAEE-KAFKAEE's Blog "src=" http://img0.ph.126.net/6IEo5vS4yRcjVZxYgVlpig==/ 6631351439704794060.png "style=" border:0px;height:auto;margin:0px 10px 0px 0px; "/>



Dubbo+zookeeper+dubbo Management Console Practice demo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.