码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 微服务项目部署-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指定目录下

  • 相关阅读:
    操作系统学习案例20240222-liunx自定义systemctl系统服务
    【Clickhouse】ReplaceingMergeTree引擎final实现合并去重探索
    devops-6-pipline
    【Vue3】图片未加载成功前占位
    SoC设计更重要的是IP管理
    为了7K ,离开字节,值得吗....
    代码随想录算法训练营第五十五天|392. 判断子序列、115. 不同的子序列
    Linux 内核(Kernel)组成分析
    软件测试——功能性测试(1)
    web前端期末大作业——贵州山地旅游介绍网页1页 HTML旅游网站设计与实现
  • 原文地址:https://blog.csdn.net/xiao297328/article/details/125916326
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号