微服务项目部署-POS收银系统

44 篇文章 0 订阅
20 篇文章 0 订阅

环境准备:

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.jar

if [ -n "${JAVA_HOME}" ] && [ -x "${JAVA_HOME}/bin/java" ]; then
	export JAVA_CMD="${JAVA_HOME}/bin/java"
fi

if [ -z "${JAVA_CMD}" ]; then
	export JAVA_CMD="/usr/local/java/jdk1.8.0_291/bin/java"
fi

if [ -z "${JAVA_CMD}" -o ! -x "${JAVA_CMD}" ] ; then
  echo "Could not find 'java' executable in JAVA_HOME or PATH."
  exit 1
fi

JAVA_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" ] ; then
        echo "No GatewayServerApplication running."
        exit -1;
fi

echo "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指定目录下

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值