SSM系统架构
来源:互联网 发布:jvm怎么看java的机械码 编辑:程序博客网 时间:2024/03/28 19:50
系统架构图
2 工程部署
2.1 部署分析
理论上服务器数量分析:
应用服务器(安装war包的服务器)
E3-manager 2
E3-cms 2
E3-search 2
E3-sso 2
E3-order 2
E3-cart 2
E3-manager-web 2
E3-search-web 2
E3-item-web 2
E3-portal-web 2
E3-sso-web 2
E3-order-web 2
E3-cart-web 2
总计:26台
中间件服务器
SVN+bug服务器(bugfree\bugzilia)+maven私服 1
Zookeeper注册中心 3
http服务器 Nginx + FastDFS 的storage 4
FastDFS 的tracker 2
Redis 2或者6
Solr服务器 1或者7
Activemq 2
反向代理服务器Nginx 2
Mysql 2
总计:19或者29台
Failover:容错
服务器数量总计:45或者55台
2.2 部署规划
应用服务器
工程名称
ip地址
端口
域名
E3-manager
195
8080
20880
无
E3-cms
195
8081
20881
无
E3-search
195
8082
20882
无
E3-sso
196
8080
20883
无
E3-order
196
8081
20884
无
E3-cart
196
8082
20885
无
E3-manager-web
197
8080
manager.e3mall.cn
E3-portal-web
197
8081
www.e3mall.cn
E3-search-web
197
8082
search.e3mall.cn
E3-item-web
198
8080
item.e3mall.cn
E3-sso-web
198
8081
sso.e3mall.cn
E3-order-web
198
8082
order.e3mall.cn
E3-cart-web
198
8083
cart.e3mall.cn
中间件服务器
服务器名称
ip地址
端口
域名
zookeeper注册中心
139
dubbo监控中心
139
redis
139
solr
139
activemq
139
图片服务器
140
nginx反向代理
130
mysql
130
2.3 部署步骤
使用maven实现tomcat的热部署。
前提:jdk1.7和tomcat都需要预先安装好。
2.3.1 Tomcat热部署配置
第一步:启动linux中的tomcat,然后访问tomcat首页中的manager-webapp链接,发现访问不了,需要进行第二步的配置。
第二步:需要配置tomcat的角色和用户,在tomcat的conf/tomcat-users.xml 这个文件中进行配置。
<role rolename="manager-gui" />
<role rolename="manager-script" />
<user username="tomcat" password="tomcat" roles="manager-gui, manager-script"/>
第三步:重启tomcat,再访问就可以使用tomcat本身的热部署配置
2.3.2 Maven+tomcat热部署使用方法
使用maven+tomcat对e3-manager工程进行热部署。
前提:需要启动dubbo的监控中心,来监测服务层服务是否发布成功。
第一步:需要在maven工程的pom文件中添加tomcat7插件,然后配置以下属性:
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>8080</port>
<path>/</path>
<!-- 配置tomcat服务器的配置URL -->
<url>http://192.168.242.195:8080/manager/text</url>
<username>tomcat</username>
<password>tomcat</password>
</configuration>
</plugin>
</plugins>
</build>
第二步:执行maven命令,进行热部署。
第一次部署命令:tomcat7:deploy
第二次部署命令:tomcat7:redeploy。
跳过单元测试命令:tomcat7:redeploy -DskipTests
第三步:访问dubbo注册中心,查看是否将sso服务发布成功。
2.3.3 工程部署
先启动所有服务器中间件
第一步:sql数据库需要在linux系统进行安装,并且将淘淘商城的数据库脚本创建数据表
第二步:修改工程中的相应的POM文件,配置tomcat热部署,参考部署规划的Excel表格。
第三步:需要修改工程中的数据库连接配置
第四步:修改工程中所有localhost的代码,改成对应的域名。
8082
www.e3mall.cn
8085
search.e3mall.cn
8086
item.e3mall.cn
8088
sso.e3mall.cn
8090
cart.e3mall.cn
8092
order.e3mall.cn
第五步:启动linux系统中的所有tomcat,因为通过maven进行热部署,需要tomcat是启动状态的。
第六步:执行maven命令上传war包。
2.4 配置hosts域名映射
使用switchHost工具配置
2.5 Nginx反向代理
130服务器中/usr/local/nginx/conf/nginx.conf,对tomcat服务进行反向代理配置。
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream manager.e3mall.cn {
server 192.168.242.197:8080;
}
upstream www.e3mall.cn {
server 192.168.242.197:8081;
}
upstream search.e3mall.cn {
server 192.168.242.197:8082;
}
upstream item.e3mall.cn {
server 192.168.242.198:8080;
}
upstream sso.e3mall.cn {
server 192.168.242.198:8081;
}
upstream order.e3mall.cn {
server 192.168.242.198:8082;
}
server {
listen 80;
server_name manager.e3mall.cn;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://manager.e3mall.cn;
index index.html index.htm;
}
}
server {
listen 80;
server_name www.e3mall.cn;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://www.e3mall.cn;
index index.html index.htm;
}
}
server {
listen 80;
server_name search.e3mall.cn;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://search.e3mall.cn;
index index.html index.htm;
}
}
server {
listen 80;
server_name item.e3mall.cn;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://item.e3mall.cn;
index index.html index.htm;
}
}
server {
listen 80;
server_name sso.e3mall.cn;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://sso.e3mall.cn;
index index.html index.htm;
}
}
server {
listen 80;
server_name order.e3mall.cn;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://order.e3mall.cn;
index index.html index.htm;
}
}
}
- SSM系统架构
- 【ssm架构】系统架构-MVC
- 【ssm架构】系统架构-三层架构
- 【ssm架构】系统架构-SSM与三层架构的关系
- 蒙牛CRM系统_java ssm架构
- 分布式系统架构——dubbo与SSM整合问题
- 基于SSM架构的博客系统登录问题
- SSM系统整个过程----聊聊架构那些事儿(第二谈)
- SSM架构学习心得
- SSM实现三层架构
- Mybatis教程,SSM架构
- SSM架构配置
- SSM架构例子
- SSM架构整合
- SSM系统整合过程----聊聊架构那些事儿(第一谈)
- SSM秒杀系统
- ssm分页系统
- ssm框架与三层架构
- python 判断文件是否存在以及
- Servlet的调用和生命周期
- hdu 1016 Prime Ring Problem
- Python 读取csv的某行
- REST开发笔记
- SSM系统架构
- hexo入门学习(三):主题设置
- 数组集合添加算法
- UVA
- ubuntu系统安装及相关设置
- 第十三天
- 经典排序算法
- java基础
- POJ 3170 Knights of Ni 笔记