1.registry 使用zookeeper
zookeeper下载地址:http://apache.org/dist/zookeeper/
2.解压zookeeper-3.4.9.tar.gz
soondeMacBook-Pro:mydubbo soon$ pwd
/Users/soon/Documents/work/program/mydubbo
soondeMacBook-Pro:mydubbo soon$ tar zxvf zookeeper-3.4.9.tar.gz
soondeMacBook-Pro:mydubbo soon$ ll
total 169888
-rw-r--r-- 1 soon staff 57K 4 6 14:19 zookeeper.out
-rw-r--r--@ 1 soon staff 22M 9 3 2016 zookeeper-3.4.9.tar.gz
drwxr-xr-x 22 soon staff 748B 8 23 2016 zookeeper-3.4.9
3.更新文件zoo.cfg,修改属性dataDir,其中/Users/soon/Documents/work/program/mydubbo/data为任意新建目录
soondeMacBook-Pro:mydubbo soon$ vi zookeeper-3.4.9/conf/zoo.cfg
4.启动zookeeper
soondeMacBook-Pro:mydubbo soon$ ./zookeeper-3.4.9/bin/zkServer.sh start
相关命令如下:
|start
|start-foreground
|stop
|restart
|status
|upgrade
|print-cmd
5.eclipse中启动,使用dubbo-monitor-simple,dubbo-demo-provider,dubbo-demo-consumer
A.修改配置文件dubbo.properties
B.启动运行
C.日志
dubbo-monitor-simple日志如下:
dubbo-demo-provider日志如下:
dubbo-demo-consumer日志如下:
D.页面:
6.命令行启动demo
dubbo-monitor-simple-2.5.4-SNAPSHOT-assembly.tar.gz
dubbo-demo-provider-2.5.4-SNAPSHOT-assembly.tar.gz
dubbo-demo-consumer-2.5.4-SNAPSHOT-assembly.tar.gz
A.使用tar zxvf *.tar.gz命令解压后,修改配置文件
dubbo.properties中属性:dubbo.registry.address=zookeeper://127.0.0.1:2181
soondeMacBook-Pro:mydubbo soon$ vi dubbo-monitor-simple-2.5.4-SNAPSHOT/conf/dubbo.properties
soondeMacBook-Pro:mydubbo soon$ vi dubbo-demo-provider-2.5.4-SNAPSHOT/conf/dubbo.properties
soondeMacBook-Pro:mydubbo soon$ vi dubbo-demo-consumer-2.5.4-SNAPSHOT/conf/dubbo.properties
B.启动
soondeMacBook-Pro:mydubbo soon$ ./dubbo-monitor-simple-2.5.4-SNAPSHOT/bin/start.sh
Starting the simple-monitor .....OK!
PID: 7444
STDOUT: logs/stdout.log
soondeMacBook-Pro:mydubbo soon$ ./dubbo-demo-provider-2.5.4-SNAPSHOT/bin/start.sh
Starting the demo-provider .....OK!
PID: 7495
STDOUT: logs/stdout.log
soondeMacBook-Pro:mydubbo soon$ ./dubbo-demo-consumer-2.5.4-SNAPSHOT/bin/start.sh
Starting the demo-consumer ....OK!
PID: 7541
STDOUT: logs/stdout.log
soondeMacBook-Pro:mydubbo soon$
C.日志