mall/document/reference/deploy-windows.md

102 lines
5.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# windows下环境搭建
## IDEA
- 关于IDEA的安装与使用具体参考[https://github.com/judasn/IntelliJ-IDEA-Tutorial](https://github.com/judasn/IntelliJ-IDEA-Tutorial)
- 搜索插件仓库安装插件lombok
## Eclipse
- 导入项目以maven项目形式导入
![eclipse_import_1.png](https://github.com/macrozheng/mall/blob/master/document/resource/eclipse_import_1.png)
![eclipse_import_2.png](https://github.com/macrozheng/mall/blob/master/document/resource/eclipse_import_2.png)
- 安装lombok插件下载地址https://projectlombok.org/downloads/lombok.jar
- 下载完后双击使用java程序打开
- 按照提示选择eclipe.exe的安装路径安装插件完成后重启Eclipse
- 启动项目右击com.macro.mall.MallAdminApplication的main方法选择run as Java Application
## mysql
- 下载地址https://dev.mysql.com/downloads/mysql/5.7.html#downloads
- 下载后按提示进行安装
- 导入document/sql下的mall.sql文件
## redis
- 下载地址https://github.com/MicrosoftArchive/redis/releases
- 下载后按提示进行安装
- 启动redis:redis-server.exe redis.windows.conf
## elasticsearch
- 下载地址https://www.elastic.co/downloads/past-releases/elasticsearch-6-2-2
- 下载.zip文件解压到指定目录
- 安装head插件具体参考https://github.com/mobz/elasticsearch-head
- 中文分词插件地址https://github.com/medcl/elasticsearch-analysis-ik
- 安装中文分词插件在elasticsearch-6.2.2\bin目录下执行以下命令
elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.2.2/elasticsearch-analysis-ik-6.2.2.zip
- 启动elasticsearch:运行elasticsearch-6.2.2\bin\elasticsearch.bat
- 打开该地址测试是否安装成功http://localhost:9200/_plugin/head/
- 不使用head插件的可以使用kibana请下载6.2.2版本具体参考https://www.elastic.co/downloads/kibana
## mongodb
- 下载地址https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.2.21-signed.msi
- 选择路径c:\mongodb\进行安装在安装路径下创建data\db和data\log两个文件夹
- 服务端运行程序mongodb\bin\mongod.exe
- 客户端运行程序mongodb\bin\mongo.exe
- 创建配置文件mongodb\mongod.cfg
``` lua
systemLog:
destination: file
path: c:\mongodb\data\log\mongod.log
storage:
dbPath: c:\mongodb\data\db
```
- 安装为服务运行命令需要用管理员权限C:\mongodb\bin\mongod.exe --config "C:\mongodb\mongod.cfg" --install
- 启动服务net start MongoDB
- 关闭服务net stop MongoDB
- 移除服务C:\mongodb\bin\mongod.exe --remove
- 下载客户端程序https://download.robomongo.org/1.2.1/windows/robo3t-1.2.1-windows-x86_64-3e50a65.zip
- 解压到指定目录打开robo3t.exe并连接到localhost:27017
## rabbitmq
- 安装Erlanghttp://www.erlang.org/download/otp_win64_17.3.exe
- 下载rabbitmq:http://www.rabbitmq.com/releases/rabbitmq-server/v3.4.1/rabbitmq-server-3.4.1.exe
- 按照提示进行安装安装完成后左下角搜索rabbitmq点击如下命令进行安装
![rabbitmq_install_1.png](https://github.com/macrozheng/mall/blob/master/document/resource/rabbitmq_install_1.png)
- 输入命令启用管理工具rabbitmq-plugins enable rabbitmq_management
- 访问地址查看是否安装成功http://127.0.0.1:15672/
- 输入账号密码登录guest guest
- 创建用户并设置其角色为管理员mall mall
![rabbitmq_install_2.png](https://github.com/macrozheng/mall/blob/master/document/resource/rabbitmq_install_2.png)
- 创建virtual host:/mall
![rabbitmq_install_3.png](https://github.com/macrozheng/mall/blob/master/document/resource/rabbitmq_install_3.png)
- 给mall用户配置范围该virtual host的权限
![rabbitmq_install_4.png](https://github.com/macrozheng/mall/blob/master/document/resource/rabbitmq_install_4.png)
## OSS
- 该项目文件上传采用OSS需要自行注册OSS账号并配置
- 首先将mall-admin\src\main\resources\application.properties文件中以aliyun.oss.开头的配置改为你自己的配置
- OSS上传文件需要配置跨域资源共享(CORS)规则参考文档https://help.aliyun.com/document_detail/31928.html
- 上传方式采用服务端签名后直传的形式参考文档https://help.aliyun.com/document_detail/31926.html
## mall-admin
- 启动项目直接运行com.macro.mall.MallAdminApplication的main方法即可
- 接口文档地址http://localhost:8080/swagger-ui.html
## mall-search
- 启动项目直接运行com.macro.mall.search.MallSearchApplication的main方法即可
- 接口文档地址http://localhost:8081/swagger-ui.html
- 使用前需要先调用接口导入数据http://localhost:8081/esProduct/importAll
- 如出现无法启动的问题可以先删除elasticsearch里面的数据再启动
## mall-portal
- 启动mall-portal项目直接运行com.macro.mall.portal.MallPortalApplication的main方法即可
- 接口文档地址http://localhost:8085/swagger-ui.html