当前位置:网站首页>微服务重启脚本
微服务重启脚本
2022-08-07 20:42:00 【一年经验的小王】
微服务重启脚本:
#! /bin/bash
#微服务名称
service=portalmgr
jarName=${service}.jar
#微服务进程id
pid=0
function calcPid()
{
pid=`ps -ef | grep ${
jarName}|grep -v grep | awk '{print $2}'`
return 0
}
function startProgress
{
b=''
for ((i=0;$i<=100;i+=2))
do
printf "服务启动中,请稍后:[%-50s]%d%%\r" $b $i
sleep 0.02
b=#$b
done
echo
}
calcPid
echo "before restart,pid is:" ${pid}
echo 0>nohup.out
kill -9 ${pid}
nohup java -Xmx512M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heapdump.hprof -jar /home/lzy/data/${service}/${jarName} &
startProgress
calcPid
echo "after start,pid is:" ${pid}
exit 1
边栏推荐
- Centos 7.7 mysql8.0.29 binary installation
- 单独使用return关键字
- OpenCV 画点 画线 画框 写字操作
- Laravel 5.1 框架默认不支持 MySQL 8.0 数据库,如果需要支持,请参考以下方法
- MONAI_Label installation trial
- Webstrom plug-in development (a)
- Which platform is the best and safest to buy intra-market funds?
- 测试工程师如何做到初级测试管理(个人思考)?
- playbook中template、tags、roles操作示例
- 修复opencv包冲突
猜你喜欢

【LeetCode】1552. Magnetic force between two balls
数学 多项式 除法 综合除法

渥太华大学:Hao Zhou | 用于6G中基于深度强化学习的波束管理的联合传感和通信

Unity's latest UnityWebRequest download, while displaying the download progress, and displaying the network speed, posted it today to share with you

云原生核心技术(一文搞懂云原生)

多模态预训练技术的探索和实践
[C# language] DataGridView gets the current cell information

线性预测和自回归建模

【三年面试五年模拟】算法工程师的独孤九剑秘籍(第七式)

QT线程池的使用
随机推荐
PHP将word文件转为图片之二
【LeetCode】1552. 两球之间的磁力
UEditorPlus v2.3.0发布 图片抓取重构,多处样式优化
Json format data and QT operation Json data
数据仓库之日期维度表构建
Vim基础用法,最常用、最实用的命令介绍(保姆级教程)
The use of QT thread pool
谷粒商城项目搭建
JMeter笔记7 | JMeter脚本回放
webstrom 插件开发(二)
使用NTS理解细粒度图像分类
Mysql 45讲学习笔记(二十七)主库出问题了
基于FTP协议的文件上传与下载
MONAI_Label installation trial
数据库连接池
PHP convert word file to image part 2
数据集中存在错误标注怎么办? 置信学习帮你解决
双指针的快慢指针和对撞指针
Apache Hudi vs Delta Lake:透明TPC-DS Lakehouse性能基准
【LeetCode】875.爱吃香蕉的珂珂