环境准备:
linux系统2台,或者1台足够大的内存,因为安装工具和启动服务需要占用很大内存,大约8G
一、工具安装
1.jdk安装
安装教程参考:Linux上安装jdk并配置环境变量
2.mysql安装
安装教程参考:Linux上安装mysql
3.redis安装
安装教程参考:Linux安装redis
4.nacos安装
安装教程参考:Linux上安装Nacos
5.RockerMQ安装
安装教程参考:Linux上安装rocketmq
6.Nginx安装
安装教程参考:Linux安装nginx
7.Minio安装(根据实际情况安装)
安装教程参考:Linux上安装minio
8.Sentinel限流、降级组件安装
安装教程参考:Linux上安装Sentinel限流、降级组件
二、应用系统安装与配置
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指定目录下
标签:教程,JAVA,License,服务项目,POS,收银,Linux,under,安装 From: https://blog.51cto.com/u_11710338/5732524