微服务项目部署-POS收银系统
環境準備:
linux系統2臺,或者1臺足夠大的內存,因為安裝工具和啟動服務需要占用很大內存,大約8G
一、工具安裝
1.jdk安裝
安裝教程參考:Linux上安裝jdk并配置環境變量_QQ:3083155908的博客-CSDN博客
2.mysql安裝
安裝教程參考:Linux上安裝mysql_QQ:3083155908的博客-CSDN博客
3.redis安裝
安裝教程參考:Linux安裝redis_QQ:3083155908的博客-CSDN博客
4.nacos安裝
安裝教程參考:Linux上安裝Nacos_QQ:3083155908的博客-CSDN博客_linux nacos安裝包
5.RockerMQ安裝
安裝教程參考:Linux上安裝rocketmq_QQ:3083155908的博客-CSDN博客
6.Nginx安裝
安裝教程參考:Linux安裝nginx_QQ:3083155908的博客-CSDN博客
7.Minio安裝(根據實際情況安裝)
安裝教程參考:Linux上安裝minio_QQ:3083155908的博客-CSDN博客
8.Sentinel限流、降級組件安裝
安裝教程參考:Linux上安裝Sentinel限流、降級組件_QQ:3083155908的博客-CSDN博客
二、應用系統安裝與配置
1.網關微服務部署
打包使用IDEA->maven->Lifecycle->package
打包后的路徑是:根目錄的target目錄
1)將打包好的jar文件octv-pos-gateway-1.0.0.jar上傳到 /opt/octv/product/pos/octv-pos-gateway下
2)新建startup.sh
#!/bin/bash # # Copyright 2009-2022 OCT Vision Group Holding Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.BASE_DIR=`cd $(dirname $0); pwd -P` JAR_FILE=${BASE_DIR}/octv-pos-gateway-1.0.0.jarif [ -n "${JAVA_HOME}" ] && [ -x "${JAVA_HOME}/bin/java" ]; thenexport JAVA_CMD="${JAVA_HOME}/bin/java" fiif [ -z "${JAVA_CMD}" ]; thenexport JAVA_CMD="/usr/local/java/jdk1.8.0_291/bin/java" fiif [ -z "${JAVA_CMD}" -o ! -x "${JAVA_CMD}" ] ; thenecho "Could not find 'java' executable in JAVA_HOME or PATH."exit 1 fiJAVA_OPTS="-Xms512m -Xmx512m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m" JAVA_EXT_OPTS=""echo "The GatewayServerApplication is starting..." nohup ${JAVA_CMD} ${JAVA_OPTS} -jar ${JAR_FILE} ${JAVA_EXT_OPTS} >> ${BASE_DIR}/nohup.log 2>&1 & echo "GatewayServerApplication is started,you can check the log file: ${BASE_DIR}/nohup.log"3)新建shutdown.sh
#!/bin/bash # # Copyright 2009-2022 OCT Vision Group Holding Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.pid=`ps -ef | grep octv-pos-gateway | grep -v grep | awk '{print $2}'` if [ -z "$pid" ] ; thenecho "No GatewayServerApplication running."exit -1; fiecho "The GatewayServerApplication(${pid}) is running..." kill ${pid} echo "Send shutdown request to GatewayServerApplication(${pid}) OK"4)啟動
切換到部署目錄,運行命令: sh? ?startpup.sh
ps -ef|grep java
2.認證微服務部署
同上
3.系統微服務部署
4.產品微服務部署
5.訂單微服務部署
6.報表微服務部署
7.前端項目部署
前端打包:
npm run build:stage
# 構建生產環境
npm run build:prod
將打包后的dist里面的文件上傳到 nginx指定目錄下
總結
以上是生活随笔為你收集整理的微服务项目部署-POS收银系统的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 高并发分布式场景下的应用---分布式锁
- 下一篇: 怎样打印计算机桌面,敬业签电脑桌面便签软