【ReactJs+springBoot项目——租房】第14章:项目部署架构+部署计划 +实施部署 +打包项目+ 功能测试

部署架构
部署计划
实施部署
打包项目
功能测试

1、部署架构
在这里插入图片描述

说明:
在架构中集群的节点数根据实际情况设置项目的中的实际系统并没有完全展示出来
2、部署计划

在实际项目中,在部署上线之前需要对所有的服务进行盘点, 然后根据用户数以及并发数,对需要的服务器进行统计,然后进行采购服务器,最后实施部署。

由于我们处于学习阶段,服务器资源有限,所以需要在现有的服务器资源上进行分配。 服务器资源目前拥有3台服务器,分别是192.168.1.7、192.168.1.18、192.168.1.19。
2.1、MySQL服务
2.1.1、架构
在这里插入图片描述
2.1.2、规划

服务				端口			服务器			容器名
MySQL-node01	13306	192.168.1.18	pxc_node1
MySQL-node02	13307	192.168.1.18	pxc_node2
MySQL-node03	13308	192.168.1.18	pxc_node3
MySQL-node04	13309	192.168.1.18	pxc_node4
MySQL-node05	13310	192.168.1.19	ms_node1
MySQL-node06	13311	192.168.1.19	ms_node2
MyCat-node01	119861806819068	192.168.1.19	mycat_node01
MyCat-node02	119871806919069	192.168.1.19	mycat_node02
HAProxy			40014002			192.168.1.19	haproxy

2.1.3、实施
2.1.3.1、部署pxc集群

在这里插入图片描述

在这里插入图片描述

2.1.3.2、部署MS架构

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

2.1.3.3、部署mycat
在数据库中,tb_house_resources(房源表)进行pxc集群管理,其它表通过读写分离管理。

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

2.1.3.4、创建表以及测试

1CREATE TABLE `tb_ad` (
2`id` bigint(20) NOT NULL AUTO_INCREMENT,
3`type` int(10) DEFAULT NULL COMMENT '广告类型',
4`title` varchar(100) DEFAULT NULL COMMENT '描述',
5`url` varchar(200) DEFAULT NULL COMMENT '图片URL地址',
6`created` datetime DEFAULT NULL,
7`updated` datetime DEFAULT NULL,
8PRIMARY KEY (`id`)
9) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='广告表'; 10
11CREATE TABLE `tb_estate` (
12`id` bigint(20) NOT NULL AUTO_INCREMENT,
13`name` varchar(100) DEFAULT NULL COMMENT '楼盘名称',
14`province` varchar(10) DEFAULT NULL COMMENT '所在省',
15`city` varchar(10) DEFAULT NULL COMMENT '所在市',
16`area` varchar(10) DEFAULT NULL COMMENT '所在区',
17`address` varchar(100) DEFAULT NULL COMMENT '具体地址',
18`year` varchar(10) DEFAULT NULL COMMENT '建筑年代',
19`type` varchar(10) DEFAULT NULL COMMENT '建筑类型',
20`property_cost` varchar(10) DEFAULT NULL COMMENT '物业费',
21`property_company` varchar(20) DEFAULT NULL COMMENT '物业公司',
22`developers` varchar(20) DEFAULT NULL COMMENT '开发商',
23`created` datetime DEFAULT NULL COMMENT '创建时间',
24`updated` datetime DEFAULT NULL COMMENT '更新时间',
25PRIMARY KEY (`id`)
26) ENGINE=InnoDB AUTO_INCREMENT=1006 DEFAULT CHARSET=utf8 COMMENT='楼盘表'; 27
28CREATE TABLE `tb_house_resources` (
29`id` bigint(20) NOT NULL AUTO_INCREMENT,
30`title` varchar(100) DEFAULT NULL COMMENT '房源标题',
31`estate_id` bigint(20) DEFAULT NULL COMMENT '楼盘id',
32`building_num` varchar(5) DEFAULT NULL COMMENT '楼号(栋)',
33`building_unit` varchar(5) DEFAULT NULL COMMENT '单元号',
34`building_floor_num` varchar(5) DEFAULT NULL COMMENT '门牌号',
35`rent` int(10) DEFAULT NULL COMMENT '租金',
36`rent_method` tinyint(1) DEFAULT NULL COMMENT '租赁方式,1-整租,2-合租',
37	`payment_method` tinyint(1) DEFAULT NULL COMMENT '支付方式,1-付一押一,2-付三押一,3-付六押一,4-年付押一,5-其它',
38`house_type` varchar(255) DEFAULT NULL COMMENT '户型,如:2室1厅1卫',
39`covered_area` varchar(10) DEFAULT NULL COMMENT '建筑面积',
40`use_area` varchar(10) DEFAULT NULL COMMENT '使用面积',
41`floor` varchar(10) DEFAULT NULL COMMENT '楼层,如:8/26',
42`orientation` varchar(2) DEFAULT NULL COMMENT '朝向:东、南、西、北',

43`decoration` tinyint(1) DEFAULT NULL COMMENT '装修,1-精装,2-简装,3-毛坯',
44`facilities` varchar(50) DEFAULT NULL COMMENT '配套设施, 如:1,2,3',
45`pic` varchar(1000) DEFAULT NULL COMMENT '图片,最多5张',
46`house_desc` varchar(200) DEFAULT NULL COMMENT '描述',
47`contact` varchar(10) DEFAULT NULL COMMENT '联系人',
48`mobile` varchar(11) DEFAULT NULL COMMENT '手机号',
49`time` tinyint(1) DEFAULT NULL COMMENT '看房时间,1-上午,2-中午,3-下午,4-晚上,5-全天',
50`property_cost` varchar(10) DEFAULT NULL COMMENT '物业费',
51`created` datetime DEFAULT NULL,
52`updated` datetime DEFAULT NULL,
53PRIMARY KEY (`id`)
54) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='房源表'; 55
56
57INSERT INTO `tb_ad` (`id`, `type`, `title`, `url`, `created`, `updated`) VALUES ('1', '1', 'UniCity 万 科 天 空 之 城 ', 'http://itcast-haoke.oss-cn- qingdao.aliyuncs.com/images/2018/11/26/15432029097062227.jpg', '2018-11-26 11:28:49', '2018-11-26 11:28:51');
58INSERT INTO `tb_ad` (`id`, `type`, `title`, `url`, `created`, `updated`) VALUES ('2', '1', ' 天 和 尚 海 庭 前 ', 'http://itcast-haoke.oss-cn- qingdao.aliyuncs.com/images/2018/11/26/1543202958579877.jpg', '2018-11-26 11:29:27', '2018-11-26 11:29:29');
59INSERT INTO `tb_ad` (`id`, `type`, `title`, `url`, `created`, `updated`) VALUES ('3', '1', '[ 奉 贤 南 桥 ] 光 语 著 ', 'http://itcast-haoke.oss-cn- qingdao.aliyuncs.com/images/2018/11/26/15432029946721854.jpg', '2018-11-26 11:30:04', '2018-11-26 11:30:06');
60INSERT INTO `tb_ad` (`id`, `type`, `title`, `url`, `created`, `updated`) VALUES ('4', '1', '[ 上 海 周 边 嘉 兴 ] 融 创 海 逸 长 洲 ', 'http://itcast-haoke.oss-cn- qingdao.aliyuncs.com/images/2018/11/26/15432030275359146.jpg', '2018-11-26 11:30:49', '2018-11-26 11:30:53');
61
62
63INSERT INTO `tb_estate` (`id`, `name`, `province`, `city`, `area`, `address`, `year`,
`type`, `property_cost`, `property_company`, `developers`, `created`, `updated`) VALUES ('1001', '中远两湾城', '上海市', '上海市', '普陀区', '远景路97弄', '2001', '塔楼/板楼', '1.5', '上海中远物业管理发展有限公司', '上海万业企业股份有限公司', '2018-11-06 23:00:20',
'2018-11-06 23:00:23');
64INSERT INTO `tb_estate` (`id`, `name`, `province`, `city`, `area`, `address`, `year`,
`type`, `property_cost`, `property_company`, `developers`, `created`, `updated`) VALUES ('1002', '上海康城', '上海市', '上海市', '闵行区', '莘松路958弄', '2001', '塔楼/板楼',
'1.5', '盛孚物业', '闵行房地产', '2018-11-06 23:02:30', '2018-11-27 23:02:33');
65INSERT INTO `tb_estate` (`id`, `name`, `province`, `city`, `area`, `address`, `year`,
`type`, `property_cost`, `property_company`, `developers`, `created`, `updated`) VALUES ('1003', '保利西子湾', '上海市', '上海市', '松江区', '广富林路1188弄', '2008', '塔楼/板
楼', '1.75', '上海保利物业管理', '上海城乾房地产开发有限公司', '2018-11-06 23:04:22', '2018-
11-06 23:04:25');
66INSERT INTO `tb_estate` (`id`, `name`, `province`, `city`, `area`, `address`, `year`,
`type`, `property_cost`, `property_company`, `developers`, `created`, `updated`) VALUES ('1004', '万科城市花园', '上海市', '上海市', '松江区', '广富林路1188弄', '2002', '塔楼/
板楼', '1.5', '上海保利物业管理', '上海城乾房地产开发有限公司', '2018-11-13 16:43:40', '2018-
11-13 16:43:42');



67	INSERT INTO `tb_estate` (`id`, `name`, `province`, `city`, `area`, `address`, `year`,
	`type`, `property_cost`, `property_company`, `developers`, `created`, `updated`)
	VALUES ('1005', '上海阳城', '上海市', '上海市', '闵行区', '罗锦路888弄', '2002', '塔楼/板楼',
	'1.5', '上海莲阳物业管理有限公司', '上海莲城房地产开发有限公司', '2018-11-06 23:23:52', '2018-
	11-06 23:23:55');
68	
69	
70	INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
	`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
	`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
	`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
	`created`, `updated`) VALUES ('1', '东方曼哈顿 3室2厅 16000元', '1005', '2', '1', '1',
	'1111', '1', '1', '1室1厅1卫1厨1阳台', '2', '2', '1/2', '南', '1', '1,2,3,8,9', NULL, '这
	个经纪人很懒,没写核心卖点', '张三', '11111111111', '1', '11', '2018-11-16 01:16:00',
	'2018-11-16 01:16:00');
71	INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
	`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
	`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
	`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
	`created`, `updated`) VALUES ('2', '康城 3室2厅1卫', '1002', '1', '2', '3', '2000', '1',
	'2', '3室2厅1卫1厨2阳台', '100', '80', '2/20', '南', '1', '1,2,3,7,6', NULL, '拎包入住',
	'张三', '18888888888', '5', '1.5', '2018-11-16 01:34:02', '2018-11-16 01:34:02');
72	INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
	`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
	`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
	`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
	`created`, `updated`) VALUES ('3', '2', '1002', '2', '2', '2', '2', '1', '1', '11111阳台', '22', '11', '1/5', '', '1', '1,2,3', NULL, '11', '22', '33', '1', '3',
	'2018-11-16 21:15:29', '2018-11-16 21:15:29');
73	INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
	`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
	`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
	`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
	`created`, `updated`) VALUES ('4', '11', '1002', '1', '1', '1', '1', '1', '1', '11111阳台', '11', '1', '1/1', '', '1', '1,2,3', NULL, '11', '1', '1', '1', '1',
	'2018-11-16 21:16:50', '2018-11-16 21:16:50');
74	INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
	`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
	`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
	`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
	`created`, `updated`) VALUES ('5', '最新修改房源5', '1002', '1', '1', '1', '3000', '1',
	'1', '1室1厅1卫1厨1阳台', '80', '1', '1/1', '南', '1', '1,2,3', 'http://itcast-haoke.oss-
	cn-qingdao.aliyuncs.com/images/2018/12/04/15439353467987363.jpg,http://itcast-
	haoke.oss-cn-qingdao.aliyuncs.com/images/2018/12/04/15439354795233043.jpg', '11', '1',
	'1', '1', '1', '2018-11-16 21:17:02', '2018-12-04 23:05:19');


75INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
`created`, `updated`) VALUES ('6', '房源标题', '1002', '1', '1', '11', '1', '1', '1', '11111阳台', '11', '1', '1/1', '', '1', '1,2,3', 'http://itcast-haoke.oss-cn-
qingdao.aliyuncs.com/images/2018/11/16/15423743004743329.jpg,http://itcast-haoke.oss- cn-qingdao.aliyuncs.com/images/2018/11/16/15423743049233737.jpg', '11', '2', '2', '1',
'1', '2018-11-16 21:18:41', '2018-11-16 21:18:41');
76INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
`created`, `updated`) VALUES ('7', '房源标题', '1002', '1', '1', '11', '1', '1', '1', '11111阳台', '11', '1', '1/1', '', '1', '1,2,3', 'http://itcast-haoke.oss-cn-
qingdao.aliyuncs.com/images/2018/11/16/15423743004743329.jpg,http://itcast-haoke.oss- cn-qingdao.aliyuncs.com/images/2018/11/16/15423743049233737.jpg', '11', '2', '2', '1',
'1', '2018-11-16 21:18:41', '2018-11-16 21:18:41');
77INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
`created`, `updated`) VALUES ('8', '3333', '1002', '1', '1', '1', '1', '1', '1', '11111阳台', '1', '1', '1/1', '', '1', '1,2,3', 'http://itcast-haoke.oss-cn-
qingdao.aliyuncs.com/images/2018/11/17/15423896060254118.jpg,http://itcast-haoke.oss- cn-qingdao.aliyuncs.com/images/2018/11/17/15423896084306516.jpg', '1', '1', '1', '1',
'1', '2018-11-17 01:33:35', '2018-12-06 10:22:20');
78INSERT INTO `tb_house_resources` (`id`, `title`, `estate_id`, `building_num`,
`building_unit`, `building_floor_num`, `rent`, `rent_method`, `payment_method`,
`house_type`, `covered_area`, `use_area`, `floor`, `orientation`, `decoration`,
`facilities`, `pic`, `house_desc`, `contact`, `mobile`, `time`, `property_cost`,
`created`, `updated`) VALUES ('9', '康城 精品房源2', '1002', '1', '2', '3', '1000', '1',
'1', '1室1厅1卫1厨1阳台', '50', '40', '3/20', '南', '1', '1,2,3', 'http://itcast-
haoke.oss-cn-
qingdao.aliyuncs.com/images/2018/11/30/15435106627858721.jpg,http://itcast-haoke.oss- cn-qingdao.aliyuncs.com/images/2018/11/30/15435107119124432.jpg', '精品房源', '李四', '18888888888', '1', '1', '2018-11-21 18:31:35', '2018-11-30 00:58:46');

2.1.3.5、部署HAProxy

在这里插入图片描述
编写配置文件:
在这里插入图片描述

启动容器:

在这里插入图片描述
2.2、部署Redis集群
Redis集群采用3主3从的架构。

2.2.1、规划

服务	端口	服务器	容器名
Redis-node01	6379	192.168.1.18	redis-node01
Redis-node02	6380	192.168.1.18	redis-node02
Redis-node03	6381	192.168.1.18	redis-node03
Redis-node04	16379	192.168.1.19	redis-node04
Redis-node05	16380	192.168.1.19	redis-node05
Redis-node06	16381	192.168.1.19	redis-node06

2.2.3、实施
在这里插入图片描述
在这里插入图片描述
2.3、部署Elasticsearch集群
Elasticsearch集群部署3个节点的集群。

2.3.1、规划

服务	端口	服务器	容器名
es-node01	92009300	192.168.1.7	es-node01
es-node02	92009300	192.168.1.18	es-node02
es-node03	92009300	192.168.1.19	es-node03

2.3.2、实施
在这里插入图片描述
在这里插入图片描述

2.3.3、文档mapping

在这里插入图片描述
在这里插入图片描述
2.3.4、导入数据
在这里插入图片描述
在这里插入图片描述

2.4、部署RocketMQ集群
搭建2master+2slave的集群。
2.4.1、规划

服务		端口		服务器		容器名
rmqserver01	9876	192.168.1.7	rmqserver01
rmqserver02	9877	192.168.1.7	rmqserver02
rmqbroker01	10911	192.168.1.19	rmqbroker01
rmqbroker02	10811	192.168.1.19	rmqbroker02
rmqbroker01-slave	10711	192.168.1.18	rmqbroker01-slave
rmqbroker02-slave	10611	192.168.1.18	rmqbroker02-slave
rocketmq-console	8082	192.168.1.7	rocketmq-console

2.4.2、实施

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

2.5、搭建ZK集群
搭建3个节点的zk集群。
2.5.1、规划

服务	端口	服务器	容器名
zk01	218128883888	192.168.1.7	zk01
zk02	218128883888	192.168.1.18	zk02
zk03	218128883888	192.168.1.19	zk03

2.5.2、实施
在这里插入图片描述
3、项目打包

项目的域名规划(虚拟域名):

项目	域名	机器
itcast-haoke-manage-api-server	api.manage.haoke.com	192.168.1.7
itcast-haoke-manage-web	manage.haoke.com	192.168.1.7
itcast-haoke-web	www.haoke.com	192.168.1.18
itcast-haoke-im	im.haoke.com	192.168.1.19

3.1、打包springboot项目
第一步:添加springboot的打包插件
在这里插入图片描述

第二步:执行打包命令
在这里插入图片描述

3.2、构建Ant Design Pro

在这里插入图片描述
在这里插入图片描述

生成的静态页面需要通过nginx进行访问,并且请求数据的代理也需要通过nginx进行代理。
在这里插入图片描述

3.3、itcast-haoke-manage-web系统的nginx配置

在这里插入图片描述

在这里插入图片描述

3.4、配置虚拟域名
在这里插入图片描述

3.5、nginx反向代理websocket

在这里插入图片描述

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值