将 spring boot 安装为 systemd 服务
[root@ecs-11-132 system]# cat /etc/systemd/system/push-gateway-3.0.0.service
[Unit]
Description=app-portal.service
After=network.target
[Service]
User=root
Group=root
ExecStart=/etc/systemd/system/jenkins/push-gateway-3.0.0.sh
SuccessExitStatus=143
RestartSec=10
Restart=on-failure
[Install]
WantedBy=multi-user.target
[root@ecs-11-132 system]# cat /etc/systemd/system/jenkins/push-gateway-3.0.0.sh
#!/bin/bash
/usr/local/jdk/bin/java -server -Xmx512m -Xms512m -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -jar /data/micros/push-gateway-3.0.0/push-gateway-3.0.0.jar >> /data/logs/micros/push-gateway-3.0.0.log 2>&1
管理
systemctl daemon-reload
systemctl start push-gateway-3.0.0
查看状态
[root@ecs-11-132 system]# systemctl status push-gateway-3.0.0
● push-gateway-3.0.0.service - app-portal.service
Loaded: loaded (/etc/systemd/system/push-gateway-3.0.0.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2019-11-01 17:48:06 CST; 1 weeks 0 days ago
Main PID: 46557 (push-gateway-3.)
Tasks: 47
Memory: 868.7M
CGroup: /system.slice/push-gateway-3.0.0.service
├─46557 /bin/bash /etc/systemd/system/jenkins/push-gateway-3.0.0.sh
└─46558 /usr/local/jdk/bin/java -server -Xmx512m -Xms512m -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:...
Nov 01 17:48:06 ecs-11-132 systemd[1]: Started app-portal.service.
将 spring boot 安装为 systemd 服务的更多相关文章
- Springboot监控之二:Spring Boot Admin对Springboot服务进行监控
概述 Spring Boot 监控核心是 spring-boot-starter-actuator 依赖,增加依赖后, Spring Boot 会默认配置一些通用的监控,比如 jvm 监控.类加载.健 ...
- Spring Boot 集成 WebSocket 实现服务端推送消息到客户端
假设有这样一个场景:服务端的资源经常在更新,客户端需要尽量及时地了解到这些更新发生后展示给用户,如果是 HTTP 1.1,通常会开启 ajax 请求询问服务端是否有更新,通过定时器反复轮询服务端响应的 ...
- Spring Boot开发RESTful接⼝服务及单元测试
Spring Boot开发RESTful接⼝服务及单元测试 常用注解解释说明: @Controller :修饰class,⽤来创建处理http请求的对象 @RestController :Spring ...
- Spring Boot初探之restful服务发布
一.背景 Spring boot是集服务发布.数据库管理.日志管理等于一身的服务开发框架:是微服务开发的全能小帮手.这章讲述一下如何使用spring boot发布restful服务接口. 二.搭建基础 ...
- spring boot IDEA 开发微服务
本文是参考:https://blog.csdn.net/u011001084/article/details/79040701 的基础上自己实际操作编写. 在我们开始创建微服务之前,需要安装Cons ...
- SpringBootService,一个基于spring boot搭建的SOA服务框架
SpringBootService,这是一个spring boot微服务的框架,包括redis,mq,restful,定时器,mybatis.易扩容.易维护的架构. 项目说明 该项目使用maven进行 ...
- Spring Boot (十):邮件服务
Spring Boot 仍然在狂速发展,才几个多月没有关注,现在看官网已经到 2.1.0.RELEASE 版本了.准备慢慢在写写 Spring Boot 相关的文章,本篇文章使用 Spring Boo ...
- 2018-08-14 中文代码之Spring Boot实现简单REST服务
最终目标详见: 参考MSDN,试搞.NET类库标识符的翻译版 · Issue #54 · program-in-chinese/overview 此文仅为技术探索+原型搭建的第一小步. 源码库: 演示 ...
- (转)Spring Boot (十):邮件服务
http://www.ityouknow.com/springboot/2017/05/06/spring-boot-mail.html Spring Boot 仍然在狂速发展,才几个多月没有关注,现 ...
随机推荐
- C# CRC16 modbus
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- 根据文本内容确定UILabel的高度
NSString *str = @"严重依赖中国的美国公司包括苹果.百胜餐饮集团都感受到了近期人民币贬值带来的痛.这直接导致了苹果股价下跌了5.2%,拥有肯德基.必胜客的百胜也下跌了4.9% ...
- 【POJ - 1703】Find them, Catch them(种类并查集)
Find them, Catch them 直接翻译了 Descriptions 警方决定捣毁两大犯罪团伙:龙帮和蛇帮,显然一个帮派至少有一人.该城有N个罪犯,编号从1至N(N<=100000. ...
- LeetCode刷题3——位1的个数
一.题目要求 二.解法
- Linux文件属性之Linux文件删除重要原理详解
Linux下文件删除的原理 只要dongdaxiafile(源文件).服务进程.dongdaxiaflie_hard_link(硬链接文件)三个中的任意一个存在文件不会被删除.
- HDU 1688 Sightseeing 【输出最短路+次短路条数】
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1688 题目大意:给n个点,m条有向边.再给出起点s, 终点t.求出s到t的最短路条数+次短路条数. 思 ...
- Linux 打包QT程序到未安装QT的其他Linux主机下运行
昨天终于改好了一个开源但是用起来有问题的串口调试助手,想把它打包一下以后在其他电脑上也可以用. 找了网上的一个教程打包后,在本机上可以正常使用,但是移植到另一台上就出现缺少xcb的提示. 上网搜资料倒 ...
- [转帖]IP地址和CIDR
IP地址和CIDR https://www.cnblogs.com/cocowool/p/8303795.html 感谢原作者 自己竟然忘记了 classless inter-domain route ...
- mysql CPU太高排查办法
[1]问题描述 首先,查看top,下图来自网络 为什么会有%CPU 375??? 还可以超过100%的? 这是因为,有多核CPU.如图,top后,按数字1,即可出现下图. [2]排查办法(当前CPU爆 ...
- SQLite基础-8.子句(二)
目录 SQLite子句(二) 1. GROUP BY子句 2. HAVING子句 3. LIMIT 子句 4. IF EXISTS 和 IF NOT EXISTS 子句 SQLite子句(二) 1. ...