You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mall-admin/mall_hou/document/reference/deploy-windows.md

106 lines
5.5 KiB

3 months ago
# 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程序打开
- 按照提示选择eclipse.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文件解压到指定目录
- 安装kibana用于在浏览器中访问es,请下载6.2.2版本具体参考https://www.elastic.co/downloads/kibana
- 下载.zip包后解压即可运行bin\kibana.bat访问http://localhost:5601 查看是否安装成功
- 中文分词插件地址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
- 不使用kibana的可以安装head插件具体参考https://github.com/mobz/elasticsearch-head
- 注意如果你修改了mall-search中的es的cluster-name: mall-es你需要在elasticsearch-6.2.2\config\elasticsearch.yml文件中修改cluster.name: mall-es
## 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://erlang.org/download/otp_win64_21.3.exe
- 下载rabbitmqhttps://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.14/rabbitmq-server-3.7.14.exe
- 按照提示进行安装安装完成后进入rabbitmq的安装目录:D:\RabbitMQ Server\rabbitmq_server-3.7.14\sbin
- 在地址栏输入cmd并回车启动命令行输入以下命令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)
- rabbitmq安装延迟消息插件可不装
- 下载延迟消息插件rabbitmq_delayed_message_exchangehttps://www.rabbitmq.com/community-plugins.html
- 复制插件到插件目录D:\RabbitMQ Server\rabbitmq_server-3.7.14\plugins
- 在sbin目录下运行如下命令启用插件rabbitmq-plugins enable rabbitmq_delayed_message_exchange
## 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