• 微服务项目部署-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

    1. #!/bin/bash
    2. #
    3. # Copyright 2009-2022 OCT Vision Group Holding Ltd.
    4. # Licensed under the Apache License, Version 2.0 (the "License");
    5. # you may not use this file except in compliance with the License.
    6. # You may obtain a copy of the License at
    7. #
    8. # http://www.apache.org/licenses/LICENSE-2.0
    9. #
    10. # Unless required by applicable law or agreed to in writing, software
    11. # distributed under the License is distributed on an "AS IS" BASIS,
    12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13. # See the License for the specific language governing permissions and
    14. # limitations under the License.
    15. BASE_DIR=`cd $(dirname $0); pwd -P`
    16. JAR_FILE=${BASE_DIR}/octv-pos-gateway-1.0.0.jar
    17. if [ -n "${JAVA_HOME}" ] && [ -x "${JAVA_HOME}/bin/java" ]; then
    18. export JAVA_CMD="${JAVA_HOME}/bin/java"
    19. fi
    20. if [ -z "${JAVA_CMD}" ]; then
    21. export JAVA_CMD="/usr/local/java/jdk1.8.0_291/bin/java"
    22. fi
    23. if [ -z "${JAVA_CMD}" -o ! -x "${JAVA_CMD}" ] ; then
    24. echo "Could not find 'java' executable in JAVA_HOME or PATH."
    25. exit 1
    26. fi
    27. JAVA_OPTS="-Xms512m -Xmx512m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m"
    28. JAVA_EXT_OPTS=""
    29. echo "The GatewayServerApplication is starting..."
    30. nohup ${JAVA_CMD} ${JAVA_OPTS} -jar ${JAR_FILE} ${JAVA_EXT_OPTS} >> ${BASE_DIR}/nohup.log 2>&1 &
    31. echo "GatewayServerApplication is started,you can check the log file: ${BASE_DIR}/nohup.log"

    3)新建shutdown.sh

    1. #!/bin/bash
    2. #
    3. # Copyright 2009-2022 OCT Vision Group Holding Ltd.
    4. # Licensed under the Apache License, Version 2.0 (the "License");
    5. # you may not use this file except in compliance with the License.
    6. # You may obtain a copy of the License at
    7. #
    8. # http://www.apache.org/licenses/LICENSE-2.0
    9. #
    10. # Unless required by applicable law or agreed to in writing, software
    11. # distributed under the License is distributed on an "AS IS" BASIS,
    12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13. # See the License for the specific language governing permissions and
    14. # limitations under the License.
    15. pid=`ps -ef | grep octv-pos-gateway | grep -v grep | awk '{print $2}'`
    16. if [ -z "$pid" ] ; then
    17. echo "No GatewayServerApplication running."
    18. exit -1;
    19. fi
    20. echo "The GatewayServerApplication(${pid}) is running..."
    21. kill ${pid}
    22. 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指定目录下

  • 相关阅读:
    第一章 Bash 入门
    nacos
    xlwings模块(数据保存为xlsx文件)
    vue3按钮隐藏显示元素
    Springmvc中对请求的处理
    Linux环境下conda虚拟环境的迁移
    Python学习小组课程P4-Python办公(1)Excel保存
    大三第十一周学习笔记
    VsCode中文输出为乱码的原因及解决方法
    tensorflow自定义激活函数(带有条件判断)
  • 原文地址:https://blog.csdn.net/xiao297328/article/details/125916326