1. 程式人生 > >zookeeper和dubbo-admin使用!

zookeeper和dubbo-admin使用!

簡單明瞭的開始。前面一文中已經詳細的說了zookeeper單機和叢集的部署!

今天和大家說下,dubbo-admin控制檯和zookeeper配合使用!

 

環境介紹:Centos7   tomcat7

Jdk版本:1.7(為什麼用1.7呢,dubbo有時候用1.8的jidk會導致失敗)

下載dubbo-admin的安裝包。

地址:https://github.com/apache/incubator-dubbo

我的網盤:https://pan.baidu.com/s/1dj39wUwrWOvVwh1gCcnL0A 密碼:0n3o

jdk安裝不說了,前面已經說了。

#解壓tomcat 到local目錄

[[email protected] ~]# tar zxf tomcat-7.0.85.tar.gz -C /usr/local/

#把tomcat 的目錄修改了,為後面做服務做好準備

[[email protected] ~]# cd /usr/local/
[[email protected] local]# mv apache-tomcat-7.0.85 tomcat-dubbo

#把dubbo-admin的war包上傳到toncat-admin的webapps目錄

[[email protected] webapps]# pwd
/usr/local/tomcat-dubbo/webapps

[[email protected] webapps]# ls
docs  dubbo-admin-2.5.4.war  examples  host-manager  manager  ROOT

 

#刪除原來的ROOT目錄,並把dubbo-admin包的名稱改為ROOT.war    ------原因不解釋了。懂tomcat的都知道

[[email protected] webapps]# rm -rf ROOT/

[[email protected] webapps]# mv dubbo-admin-2.5.4.war ROOT.war
[

[email protected] webapps]# ls
docs  examples  host-manager  manager  ROOT.war
 

#啟動tomcat解壓war包。

[[email protected] webapps]# sh /usr/local/tomcat-dubbo/bin/startup.sh 
Using CATALINA_BASE:   /usr/local/tomcat-dubbo
Using CATALINA_HOME:   /usr/local/tomcat-dubbo
Using CATALINA_TMPDIR: /usr/local/tomcat-dubbo/temp
Using JRE_HOME:        /usr/local/jdk1.8.0_171
Using CLASSPATH:       /usr/local/tomcat-dubbo/bin/bootstrap.jar:/usr/local/tomcat-dubbo/bin/tomcat-juli.jar
Tomcat started.

[[email protected] webapps]# ls
docs  dubbo-governance.log  examples  host-manager  manager  ROOT  ROOT.war
 

#修改dubbo-admin的配置檔案。

[[email protected] WEB-INF]# ls
classes  common  dubbo.properties  forms  i18n  jointown-B2B.lnk  lib  log4j.xml  templates  webx-governance.xml  webx-home.xml  web.xml  webx-personal.xml  webx-sysinfo.xml  webx-sysmanage.xml  webx.xml
[[email protected] WEB-INF]# vi dubbo.properties

dubbo.registry.address=zookeeper://192.168.0.92:2181?backup=192.168.0.91:2181,192.168.0.93:2181          #zookeeper地址
dubbo.admin.root.password=admin123                       #web端的訪問密碼
dubbo.admin.guest.password=atme.2017

關閉tomcat然後啟動

[[email protected] local]# sh /usr/local/tomcat-dubbo/bin/shutdown.sh 
Using CATALINA_BASE:   /usr/local/tomcat-dubbo
Using CATALINA_HOME:   /usr/local/tomcat-dubbo
Using CATALINA_TMPDIR: /usr/local/tomcat-dubbo/temp
Using JRE_HOME:        /usr/local/jdk1.8.0_171
Using CLASSPATH:       /usr/local/tomcat-dubbo/bin/bootstrap.jar:/usr/local/tomcat-dubbo/bin/tomcat-juli.jar

[[email protected] webapps]# sh /usr/local/tomcat-dubbo/bin/startup.sh 
Using CATALINA_BASE:   /usr/local/tomcat-dubbo
Using CATALINA_HOME:   /usr/local/tomcat-dubbo
Using CATALINA_TMPDIR: /usr/local/tomcat-dubbo/temp
Using JRE_HOME:        /usr/local/jdk1.8.0_171
Using CLASSPATH:       /usr/local/tomcat-dubbo/bin/bootstrap.jar:/usr/local/tomcat-dubbo/bin/tomcat-juli.jar
Tomcat started.

 

搭建完畢

測試:

網頁訪問:192.168.0.91:8080           #我的tomcat部署到91的伺服器中

 

下篇文章和大家說明zookeeper和dubbo做服務!讓其開機啟動。