文档新增安装步骤

This commit is contained in:
xiongxiaoyang 2020-05-29 19:28:58 +08:00
parent d255363563
commit 622f7b6d80
21 changed files with 112 additions and 1 deletions

View File

@ -42,7 +42,6 @@ novel-cloud
#### 技术选型 #### 技术选型
| 技术 | 说明 | 技术 | 说明
| --------------------| --------------------------- | --------------------| ---------------------------
| SpringBoot | Spring应用快速开发脚手架 | SpringBoot | Spring应用快速开发脚手架
@ -69,7 +68,9 @@ novel-cloud
| ELK | 分布式日志分析 | ELK | 分布式日志分析
| Vue | 前端开发框架 | Vue | 前端开发框架
#### 数据模型
![QQ20200520-215756](./assert/QQ20200529-170006.png)
#### 截图 #### 截图
@ -107,6 +108,92 @@ novel-cloud
#### 安装步骤
1. 下载源码如果是ZIP包下载后需要解压。
![image-20200529173322783](./assert/image-20200529173322783.png)
2. 开发环境配置,请确保开发机器上已安装如下软件环境。
- [ ] Java开发工具包jdk1.8+
- [ ] IDEEclipse或IntelliJ IDEA
- [ ]
- [ ] 项目管理工具maven
- [ ] 微服务注册中心/配置中心nacos
- [ ] 分布式缓存服务Redis
- [ ] 搜索引擎服务ElasticSearch
- [ ] ElasticSearch可视化客户端Kibana
- [ ] 消息中间件RabbitMq
- [ ] 数据库服务Mysql
3. 登陆nacos配置中心导入下载源码中的配置文件。
![image-20200529173322783](./assert/QQ20200529-180807.png)![image-20200529173322783](./assert/QQ20200529-181203.png)
![image-20200529173322783](./assert/QQ20200529-181406.png)
![image-20200529173322783](./assert/QQ20200529-181531.png)
4. 使用IDE导入下载的源码这里以IntelliJ IDEA为例
![image-20200529173322783](./assert/QQ20200529-175108.png)
5. 修改通用配置中的配置中心地址和命名空间ID。
![image-20200529182810929](./assert/QQ20200529-182931.png)
![image-20200529173322783](./assert/QQ20200529-182657.png)
6. 启动微服务网关。
- 修改网关服务的配置中心地址和命名空间ID
![image-20200529173322783](./assert/QQ20200529-184805.png)
- 修改网关配置文件注册中心地址和命名空间ID
![image-20200529173322783](./assert/QQ20200529-0.png)
![image-20200529173322783](./assert/QQ20200529-182356.png)
- 启动网关服务novel-gateway
![image-20200529173322783](./assert/QQ20200529-1.png)
![image-20200529173322783](./assert/QQ20200529-183445.png)
7. 启动监控服务。
- 修改监控服务的配置中心地址和命名空间ID![image-20200529173322783](./assert/QQ20200529-185750.png)
- 修改监控微服务的注册中心地址和命名空间ID以及登陆的用户名和密码![image-20200529173322783](./assert/QQ20200529-185912.png)
- 启动监控服务novel-monitor启动方法和网关服务相同
- 访问监控服务因为网关中配置了监控服务的路由所以可直接或通过网关来访问监控服务http://<网关ip>:<网关端口号>/monitor
![image-20200529173322783](./assert/QQ20200529-190730.png)
8. 启动业务微服务,这里以小说微服务为例。
- 修改网关配置文件book-service.yml中的注册中心地址和命名空间ID以及其他配置数据库/redis/elasticsearch/mq等方法同上
- 启动novel-service服务方法同上
- 访问接口文档:http://<服务IP>:<服务端口号>/swagger-ui.html
例如http://127.0.0.1:620/swagger-ui.html
9. 通过网关统一接口访问路径。
http://<网关IP>:<网关端口号>/api/<接口路径>
以小说小说分类列表查询接口为例http://127.0.0.1:527/api/book/listBookCategory
#### 代码仓库 #### 代码仓库
Gitee仓库地址 https://gitee.com/xiongxyang/novel-cloud Gitee仓库地址 https://gitee.com/xiongxyang/novel-cloud

BIN
assert/QQ20200529-0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

BIN
assert/QQ20200529-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Binary file not shown.

View File

@ -17,12 +17,36 @@ spring:
namespace: 3960c71a-62ac-4b8f-8c30-bba8e8143a0c namespace: 3960c71a-62ac-4b8f-8c30-bba8e8143a0c
gateway: gateway:
routes: routes:
- id: home-route
uri: lb://novel-home
predicates:
- Path=/api/home/**
filters:
- RewritePath=/api/(?<segment>.*), /$\{segment}
- id: news-route
uri: lb://news-service
predicates:
- Path=/api/news/**
filters:
- RewritePath=/api/(?<segment>.*), /$\{segment}
- id: user-route - id: user-route
uri: lb://user-service uri: lb://user-service
predicates: predicates:
- Path=/api/user/** - Path=/api/user/**
filters: filters:
- RewritePath=/api/(?<segment>.*), /$\{segment} - RewritePath=/api/(?<segment>.*), /$\{segment}
- id: book-route
uri: lb://book-service
predicates:
- Path=/api/book/**
filters:
- RewritePath=/api/(?<segment>.*), /$\{segment}
- id: search-route
uri: lb://novel-search
predicates:
- Path=/api/search/**
filters:
- RewritePath=/api/(?<segment>.*), /$\{segment}
- id: monitor-route - id: monitor-route
uri: lb://novel-monitor uri: lb://novel-monitor
predicates: predicates: