若依微服务windows和linux部署

1,windows部署

run-gateway.bat



set JAVA_OPTS=-Dserver.port=1100 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m

java -Dspring.cloud.nacos.discovery.namespace=wotugou  -Dspring.cloud.nacos.config.namespace=wotugou   -Dfile.encoding=utf-8 -jar  %JAVA_OPTS% ruoyi-gateway.jar

run-auth.bat


set JAVA_OPTS=-Dserver.port=1101 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m


java -Dspring.cloud.nacos.discovery.namespace=wotugou  -Dspring.cloud.nacos.config.namespace=wotugou   -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-auth.jar

run-modules-system.bat



set JAVA_OPTS=-Dserver.port=9203 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m

java -Dspring.cloud.nacos.discovery.namespace=wotugou  -Dspring.cloud.nacos.config.namespace=wotugou  -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-system.jar

run-modules-file.bat

set JAVA_OPTS=-Dserver.port=1103 -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m

java -Dspring.cloud.nacos.discovery.namespace=wotugou  -Dspring.cloud.nacos.config.namespace=wotugou   -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-file.jar

run-modules-gen.bat



set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m

java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-gen.jar

run-modules-job.bat



set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m

java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-modules-job.jar

run-monitor.bat



set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m

java -Dfile.encoding=utf-8 -jar %JAVA_OPTS% ruoyi-visual-monitor.jar
windows根据端口查询PID
netstat -ano |findstr 9201

windows停掉某个PID
taskkill -f -pid xx

2,inux部署

#!/bin/bash
nohup java -jar /usr/local/cloud/run-modules-auth.jar &


#!/bin/bash
nohup java -jar /home/projectone/etl/run-modules-gateway.jar &



#!/bin/bash
nohup java -jar /home/projectone/etl/run-modules-system.jar &


#!/bin/bash
nohup java -jar /home/projectone/etl/run-modules-file.jar &

====================gatway===========================
nohup  java -Dserver.port=8090   -Dspring.cloud.nacos.discovery.namespace=public   -Dspring.cloud.nacos.config.namespace=public   -Dspring.cloud.nacos.discovery.server-addr=192.168.22.111:8848  -Dspring.cloud.nacos.config.server-addr=192.168.22.111:8848  -Dspring.cloud.sentinel.datasource.ds1.nacos.server-addr=192.168.22.111:8848      -jar ruoyi-gateway.jar  >/dev/null 2>&1 &

停掉进程:  ps -ef |grep 8090 | grep -v grep |awk '{print $2}'
kill -9 xxx




====================auth===========================
nohup  java -Dserver.port=9201   -Dspring.cloud.nacos.discovery.namespace=public   -Dspring.cloud.nacos.config.namespace=public  -Dspring.cloud.nacos.discovery.server-addr=192.168.22.111:8848  -Dspring.cloud.nacos.config.server-addr=192.168.22.111:8848    -jar  ruoyi-auth.jar  >/dev/null 2>&1 &


停掉进程:  ps -ef |grep 9201 | grep -v grep |awk '{print $2}'
kill -9




====================system===========================
nohup  java -Dserver.port=9203   -Dspring.cloud.nacos.discovery.namespace=public  -Dspring.cloud.nacos.config.namespace=public  -Dspring.cloud.nacos.discovery.server-addr=192.168.22.111:8848  -Dspring.cloud.nacos.config.server-addr=192.168.22.111:8848    -jar  ruoyi-modules-system.jar  >/dev/null 2>&1 &


停掉进程:  ps -ef |grep 9203 | grep -v grep |awk '{print $2}'
kill -9




====================file===========================

nohup  java -Dserver.port=9300   -Dspring.cloud.nacos.discovery.namespace=public  -Dspring.cloud.nacos.config.namespace=public   -Dspring.cloud.nacos.discovery.server-addr=192.168.22.111:8848  -Dspring.cloud.nacos.config.server-addr=192.168.22.111:8848    -jar  ruoyi-modules-file.jar >/dev/null 2>&1 &


停掉进程:  ps -ef |grep 9300 | grep -v grep |awk '{print $2}'
kill -9

你可能感兴趣的:(微服务,架构,云原生)