Dubbo基础篇_06_构建Dubbo服务消费者Web应用的war包并在Tomcat中部署

IP: 192.168.1.131

部署容器:apache-tomcat-7.0.57

端口:8080

应用:edu-web-boss.war

一、安装jdk,tomcat

参照本博

Dubbo基础篇_01_CentOS安装jdk,Tomact环境

http://blog.csdn.net/hardworking0323/article/details/50963000

二、上传war包并解压

Connecting to 192.168.1.131:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.


Last login: Fri Mar 25 15:11:24 2016 from 192.168.1.5


[root@bogon ~]# ls
anaconda-ks.cfg  dubbo-admin            install.log         Public
Desktop          dubbo-admin-2.5.3.war  install.log.syslog  Templates
Documents        dubbo-governance.log   Music               Videos
Downloads        edu-web-boss.war       Pictures            zookeeper-3.4.6.tar.gz
[root@bogon ~]# unzip edu-web-boss.war -d /root/edu-web-boss

三、删除tomcat7 webapps目录下的应用复制edu-web-boss到webapps下

[root@bogon ~]# cp -r edu-web-boss /usr/local/tomcat7/webapps/

四、打开CI服务器(要用到数据库),打开edu-provider-01服务器(用于注册中心),service-user提供启动

Dubbo基础篇_06_构建Dubbo服务消费者Web应用的war包并在Tomcat中部署_第1张图片

Connecting to 192.168.1.121:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.


Last login: Fri Mar 25 15:11:24 2016 from 192.168.1.5
[root@edu-provider-01 ~]# cd /home/yxq/edu/serivce/user/
[root@edu-provider-01 user]# ls
edu-service-user.jar  edu-service-user.pid  lib  logs  service-user.sh
[root@edu-provider-01 user]# ./service-user.sh start
=== start edu-service-user
[root@edu-provider-01 user]# 
[root@bogon ~]# /usr/local/tomcat7/bin/startup.sh start
Using CATALINA_BASE:   /usr/local/tomcat7
Using CATALINA_HOME:   /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME:        /usr/jdk
Using CLASSPATH:       /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[root@bogon ~]# 

Dubbo基础篇_06_构建Dubbo服务消费者Web应用的war包并在Tomcat中部署_第2张图片

访问消费端

Dubbo基础篇_06_构建Dubbo服务消费者Web应用的war包并在Tomcat中部署_第3张图片

这里登录会报错,经查日志,是由没有提供者导致的


但提供者明明注册上去了,这里我要查看提供者服务的端口有没有打开


[root@edu-provider-01 bin]# cat /etc/sysconfig/iptables | grep 20880

打开端口
[root@edu-provider-01 bin]# vi /etc/sysconfig/iptables
[root@edu-provider-01 bin]# cat /etc/sysconfig/iptables | grep 20880
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20880 -j ACCEPT

重启防火墙
[root@edu-provider-01 bin]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[root@edu-provider-01 bin]# 

Dubbo基础篇_06_构建Dubbo服务消费者Web应用的war包并在Tomcat中部署_第4张图片

你可能感兴趣的:(消费端consume)