dubbo-admin 和 dubbo-monitor 的安装包需要提前准备,编译方法见附录
Zookeeper 集群搭建
下载 ZooKeeper
wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.8/zookeeper-3.4.8.tar.gz
解压安装包
tar -zxf zookeeper-3.4.8.tar.gz
将软件分发到 3 个节点
scp -r /usr/local/zookeeper-3.4.8 192.30.30.4:/usr/local/zookeeper
scp -r /usr/local/zookeeper-3.4.8 192.30.30.5:/usr/local/zookeeper
scp -r /usr/local/zookeeper-3.4.8 192.30.30.6:/usr/local/zookeeper
修改配置文件,编辑 /usr/local/zookeeper/conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/lib/zookeeper
clientPort=2181
server.0=192.30.30.4:8880:7770
server.1=192.30.30.5:8880:7770
server.2=192.30.30.6:8880:7770
将 IP 对应的数字分别写入 /var/lib/zookeeper/myid,例如:192.30.30.4 的 ID 为『0』
echo 0 > /var/lib/zookeeper/myid
部署 dubbo-admin
解压安装包到 tomcat 的 webapps/ROOT 目录下
unzip dubbo-admin-2.8.4.war -d /usr/local/tomcat7_8084/webapps/ROOT/
修改配置webapps/ROOT/WEB-INF/dubbo.properties
dubbo.registry.address=zookeeper://192.30.30.4:2181
dubbo.admin.root.password=root
dubbo.admin.guest.password=guest
启动 tomcat
cd /usr/local/tomcat7_8084/
bin/startup.sh
部署 dubbo-monitor
解压软件包
tar -zxf dubbo-monitor-simple-2.8.4-assembly.tar.gz
部署
mv dubbo-monitor-simple-2.8.4 /usr/local/dubbo-monitor
修改配置 conf/dubbo.properties
......
#dubbo.registry.address=multicast://224.5.6.7:1234
dubbo.registry.address=zookeeper://192.30.30.4:2181
#dubbo.registry.address=redis://127.0.0.1:6379
#dubbo.registry.address=dubbo://127.0.0.1:9090
......
启动
/usr/local/dubbo-monitor/
bin/start.sh
附录一: dubbo 编译
下载源码:
git clone https://github.com/dangdangdotcom/dubbox.git
编译:
cd dubbox
mvn clean install -Dmaven.test.skip
编译完成后,dubbo-admin 安装包位于 dubbo-admin/target/dubbo-admin-2.8.4.war,dubbo-monitor 安装包位于dubbo-simple/dubbo-monitor-simple/target/dubbo-monitor-simple-2.8.4-assembly.tar.gz