dubbo环境搭建

原创
2016/03/29 20:57
阅读数 386

部署环境规划
192.168.6.21   consumer
               zoopekeper注册中心
               provider
               mysql数据库
1.修改host
192.168.88.145 zookeeper
2.下载zookeeper
wget http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz
3.解压zoopekeer
[root@localhost  soft]# tar -zxf zookeeper-3.4.6.tar.gz
4.创建data,log目录
[root@localhost  zookeeper-3.4.6]# mkdir {data,log} -p
5.将zookeeper/conf目录下的zoo_sample.cfg拷贝为zoo.cfg
[root@localhost  zookeeper-3.4.6]# cp conf/zoo_sample.cfg conf/zoo.cfg
6.修改zoo.cfg文件
[root@localhost  zookeeper-3.4.6]# vi conf/zoo.cfg
dataDir=/root/soft/zookeeper-3.4.6/data
dataLogDir=/root/soft/zookeeper-3.4.6/log
server.1=zookeeper:2888:3888前一个端口是服务之间通信,后一个是与其他应用程序通信
7.修改myid
[root@localhost  zookeeper-3.4.6]# vi data/myid
1
8.关闭防火墙
[root@localhost zookeeper-3.4.6]# service iptables stop
9启动
[root@localhost bin]# ./zkServer.sh start
[root@localhost zookeeper-3.4.6]# bin/zkServer.sh status
JMX enabled by default
Using config: /root/soft/zookeeper-3.4.6/bin/../conf/zoo.cfg
Mode: standalone
[root@localhost zookeeper-3.4.6]# jps
4724 Jps
4712 QuorumPeerMain

项目地址
https://github.com/paohaijiao/dubbo

2.安装dubbo监控工具
https://github.com/alibaba/dubbo/tree/master/dubbo-admin
[root@localhost soft]# wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.68/bin/apache-tomcat-7.0.68.tar.gz
[root@localhost soft]# tar -zxf apache-tomcat-7.0.68.tar.gz
[root@localhost apache-tomcat-7.0.68]# cd webapps
[root@localhost webapps]# rm -rf *
[root@localhost soft]# mv dubbo-admin-2.5.4.war apache-tomcat-7.0.68/webapps/
[root@localhost soft]#  cd apache-tomcat-7.0.68/webapps/
[root@localhost webapps]# unzip dubbo-admin-2.5.4.war -d ROOT
[root@localhost webapps]# rm dubbo-admin-2.5.4.war
[root@localhost webapps]# cd ROOT
root@localhost ROOT]# cd WEB-INF/
dubbo.registry.address=zookeeper://127.0.0.1:2181
dubbo.admin.root.password=root#######################密码配置
dubbo.admin.guest.password=admin
启动tomcat
[root@localhost bin]# cd /root/soft/apache-tomcat-7.0.68/bin
[root@localhost bin]# ./startup.sh
oot@localhost logs]# cd /root/soft/apache-tomcat-7.0.68/logs
[root@localhost logs]# less catalina.out
run生产者
再run消费者
dubbo运行方式
1.使用tomcat
2.使用main方法
3.使用com.alibaba.dubbo.container.Main





展开阅读全文
打赏
1
9 收藏
分享
加载中
更多评论
打赏
0 评论
9 收藏
1
分享
返回顶部
顶部