注册中心的选择

dubbo支持多种类型的注册中心:
- Multicast注册中心
- Zookeeper注册中心
- Redis注册中心
- Simple注册中心
本次选择zookeeper。
zookeeper安装
- zookeeper下载地址:http://www.apache.org/dyn/closer.cgi/zookeeper/,下载完成解压即可运行;
- 配置。zookeeper目录下的conf文件夹中的zoo_sample.cfg文件,重命名为zoo.cfg,即使用默认配置;

- 启动。点击zookeeper目录下的conf文件夹中的zkServer.cmd;

- 部分参数说明
# The number of milliseconds of each tick 心跳间隔 毫秒每次
tickTime=2000
# the directory where the snapshot is stored. 镜像数据位置
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect 客户端连接的端口
clientPort=2181
Dubbo Admin 安装
- 下载Dubbo的源码,地址http://dubbo.io/;

- dubbo-admin模块编译。因为这里只需要编译dubbo-admin,所以打开Cmd,然后进入解压路径 dubbo-master\dubbo-admin。命令行
mvn package -Dmaven.skip.test=true
,其中-Dmaven.skip.test
表示不打包测试包,结果如下:

- tomcat运行。把dubbo-admin-2.5.6.war拷贝到tomcat的webapps目录下,运行tomcat,访问地址为http://localhost:8080/dubbo-admin-2.5.6/ ,账户密码均为root;

网友评论