dubbo簡單示例

dubbo簡單示例html

2019-09-06java

 

1 Zookeeper註冊中心的搭建(windows單機)git

  1. 下載zookeeper壓縮包並解壓到 D:\zookeeper\apache-zookeeper-3.5.5-bin,官網地址:http://www.apache.org/dyn/closer.cgi/zookeeper/
  2. 進入conf目錄將 zoo_sample.cfg 更名爲 zoo.cfg。
    默認配置以下:
    # The number of milliseconds of each tick
    tickTime=2000
    # The number of ticks that the initial 
    # synchronization phase can take
    initLimit=5
    # The number of ticks that can pass between 
    # sending a request and getting an acknowledgement
    syncLimit=2
    # 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
    View Code
  3. 進入bin目錄雙擊 zkServer.cmd,若啓動成功,則windows單機版zookeeper搭建成功

2 dubbo-admin安裝與使用github

dubbo-admin git: https://github.com/apache/incubator-dubbo-ops下載。面試

注意:最新的dubbo-admin集成了springboot,能夠打包爲jar運行。spring

也能夠從 https://gitee.com/jingyang3877/all-examples 直接下載jar包apache

執行如下命令打jar包:windows

mvn package -DskipTests=true

在jar包目錄下,執行如下命令啓動springboot

java -jar dubbo-admin-xxx.jar

注意:dubbo-admin的端口默認是7001,dubbo註冊中心的地址是本機的2181端口ide

 

圖1 dubbo管理

 

Socket通訊原理

如何實現一個簡單的RPC

最全最簡單的dubbo教程-開篇《一》

服務之間的調用之RPC、Restful深刻理解

面試問題:REST與RPC區別?

Zookeeper註冊中心的搭建-windows單機

dubbo-admin安裝與使用

相關文章
相關標籤/搜索