mirror of https://gitee.com/y_project/RuoYi.git
feat(all): kill oracle sql ,修改druid 配置
parent
e7576af430
commit
b4f20d3373
2
pom.xml
2
pom.xml
|
@ -20,7 +20,7 @@
|
||||||
<spring-boot.version>2.5.15</spring-boot.version>
|
<spring-boot.version>2.5.15</spring-boot.version>
|
||||||
<shiro.version>1.13.0</shiro.version>
|
<shiro.version>1.13.0</shiro.version>
|
||||||
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
<thymeleaf.extras.shiro.version>2.1.0</thymeleaf.extras.shiro.version>
|
||||||
<druid.version>1.2.23</druid.version>
|
<druid.version>1.2.24</druid.version>
|
||||||
<bitwalker.version>1.21</bitwalker.version>
|
<bitwalker.version>1.21</bitwalker.version>
|
||||||
<kaptcha.version>2.3.3</kaptcha.version>
|
<kaptcha.version>2.3.3</kaptcha.version>
|
||||||
<swagger.version>3.0.0</swagger.version>
|
<swagger.version>3.0.0</swagger.version>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<artifactId>ruoyi-admin-neuhisutools</artifactId>
|
<artifactId>ruoyi-admin-neuhisutools</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
web服务入口
|
web服务入口
|
||||||
|
@ -173,7 +174,7 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin> -->
|
</plugin> -->
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>${project.artifactId}</finalName>
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -50,9 +50,10 @@ public class DeadLockRac {
|
||||||
public DeadLockRac() {
|
public DeadLockRac() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeadLockRac(Integer 本进程号SID, String 阻塞SID) {
|
public DeadLockRac(Integer 本进程号SID, String 阻塞SID, String sessionStr) {
|
||||||
this.本进程号SID = 本进程号SID;
|
this.本进程号SID = 本进程号SID;
|
||||||
this.阻塞SID = 阻塞SID;
|
this.阻塞SID = 阻塞SID;
|
||||||
|
this.sessionStr = sessionStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ public interface IOracleSysService {
|
||||||
* slow版本
|
* slow版本
|
||||||
*/
|
*/
|
||||||
List<DeadLock> getDeadLockSessionV3Slow();
|
List<DeadLock> getDeadLockSessionV3Slow();
|
||||||
|
/**
|
||||||
|
* 杀进程
|
||||||
|
*/
|
||||||
void killSession(String sessionStr);
|
void killSession(String sessionStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ import com.neuhis.his.service.IOracleSysService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.compress.utils.Lists;
|
import org.apache.commons.compress.utils.Lists;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -21,9 +23,10 @@ import java.util.Map;
|
||||||
@Service
|
@Service
|
||||||
@DataSource(value = DataSourceType.SLAVE)
|
@DataSource(value = DataSourceType.SLAVE)
|
||||||
public class OracleSysServiceImpl implements IOracleSysService {
|
public class OracleSysServiceImpl implements IOracleSysService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OracleSysMapper oracleSysMapper;
|
private OracleSysMapper oracleSysMapper;
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeadLock> getDeadLockSessionV1() {
|
public List<DeadLock> getDeadLockSessionV1() {
|
||||||
|
@ -33,6 +36,10 @@ public class OracleSysServiceImpl implements IOracleSysService {
|
||||||
@Override
|
@Override
|
||||||
public List<DeadLockRac> getDeadLockSessionV2Rac() {
|
public List<DeadLockRac> getDeadLockSessionV2Rac() {
|
||||||
List<DeadLockRac> deadLockRacs = oracleSysMapper.getDeadLockSessionV2Rac();
|
List<DeadLockRac> deadLockRacs = oracleSysMapper.getDeadLockSessionV2Rac();
|
||||||
|
deadLockRacs.add(new DeadLockRac(1, "根锁为此会话杀我KILL ME or igore", "001"));
|
||||||
|
deadLockRacs.add(new DeadLockRac(5728, "<根锁会话>4903 【SID=4903】的SQL阻塞了本语句[5728]杀掉他", "5728"));
|
||||||
|
deadLockRacs.add(new DeadLockRac(2222, "<根锁会话>1111 【SID=1111】的SQL阻塞了本语句[2222]杀掉他", "5728"));
|
||||||
|
deadLockRacs.add(new DeadLockRac(3333, "<根锁会话>1 【SID=1】的SQL阻塞了本语句[3333]杀掉他", "5728"));
|
||||||
return this.findV2DeadLockRacSessionId(deadLockRacs);
|
return this.findV2DeadLockRacSessionId(deadLockRacs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,13 +56,10 @@ public class OracleSysServiceImpl implements IOracleSysService {
|
||||||
oracleSysMapper.killSession(sessionStr);
|
oracleSysMapper.killSession(sessionStr);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
System.out.println("数据库啥死锁异常:"+e.getMessage());
|
System.out.println("数据库杀死锁异常:"+e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 从进程列表找到,死锁的进程
|
|
||||||
*/
|
|
||||||
private List<DeadLockRac> findV2DeadLockRacSessionId(List<DeadLockRac> deadLockRacs) {
|
private List<DeadLockRac> findV2DeadLockRacSessionId(List<DeadLockRac> deadLockRacs) {
|
||||||
//找到有问题的进程
|
//找到有问题的进程
|
||||||
DeadLockRac problematicSession = DeadlockResolver.findProblematicSession(deadLockRacs);
|
DeadLockRac problematicSession = DeadlockResolver.findProblematicSession(deadLockRacs);
|
||||||
|
|
|
@ -29,6 +29,8 @@ public class HisTask {
|
||||||
OracleSlaveDataAutoPushService oracleSlaveDataAutoPushService;
|
OracleSlaveDataAutoPushService oracleSlaveDataAutoPushService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOracleSysService oracleSysService;
|
private IOracleSysService oracleSysService;
|
||||||
|
@Autowired
|
||||||
|
private RuoYiConfig ruoYiConfig;
|
||||||
|
|
||||||
public void pushData()
|
public void pushData()
|
||||||
{
|
{
|
||||||
|
@ -38,7 +40,7 @@ public class HisTask {
|
||||||
|
|
||||||
public void pushData(String apicode)
|
public void pushData(String apicode)
|
||||||
{
|
{
|
||||||
if (RuoYiConfig.isQuzrtzTask() && jobService.isEnable(JobSwitchConstant.comPatientinfo)) {
|
if (ruoYiConfig.isQuzrtzTask() && jobService.isEnable(JobSwitchConstant.comPatientinfo)) {
|
||||||
log.info("数据推送开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("数据推送开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
oracleSlaveDataAutoPushService.pushData(apicode);
|
oracleSlaveDataAutoPushService.pushData(apicode);
|
||||||
log.info("数据推送结束" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("数据推送结束" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
@ -47,7 +49,7 @@ public class HisTask {
|
||||||
|
|
||||||
public void pushDataByCompareId(String apicode)
|
public void pushDataByCompareId(String apicode)
|
||||||
{
|
{
|
||||||
if (RuoYiConfig.isQuzrtzTask() && jobService.isEnable(JobSwitchConstant.comPatientinfo)) {
|
if (ruoYiConfig.isQuzrtzTask() && jobService.isEnable(JobSwitchConstant.comPatientinfo)) {
|
||||||
log.info("数据推送开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("数据推送开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
oracleSlaveDataAutoPushService.pushDataByCompareId(apicode);
|
oracleSlaveDataAutoPushService.pushDataByCompareId(apicode);
|
||||||
log.info("数据推送结束" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("数据推送结束" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
@ -58,10 +60,10 @@ public class HisTask {
|
||||||
* 杀oracle死锁
|
* 杀oracle死锁
|
||||||
*/
|
*/
|
||||||
public void killDeadLockSession() {
|
public void killDeadLockSession() {
|
||||||
if (RuoYiConfig.isQuzrtzTask()) {
|
if (ruoYiConfig.isQuzrtzTask()) {
|
||||||
log.info("杀oracle死锁开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("杀oracle死锁开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
///List<DeadLock> deadLocks = oracleSysService.getDeadLockSessionV1();
|
///List<DeadLock> deadLocks = oracleSysService.getDeadLockSessionV1();
|
||||||
///deadLocks.forEach(deadLock -> HisTask.this.oracleSysService.killSession(deadLock.getSessionStr()));
|
///deadLocks.forEach(deadLock -> HisTask.this.oracleSysService.killSessionJdbc(deadLock.getSessionStr()));
|
||||||
|
|
||||||
List<DeadLockRac> sessionV2Rac = oracleSysService.getDeadLockSessionV2Rac();
|
List<DeadLockRac> sessionV2Rac = oracleSysService.getDeadLockSessionV2Rac();
|
||||||
sessionV2Rac.forEach(deadLock -> HisTask.this.oracleSysService.killSession(deadLock.getSessionStr()));
|
sessionV2Rac.forEach(deadLock -> HisTask.this.oracleSysService.killSession(deadLock.getSessionStr()));
|
||||||
|
@ -74,7 +76,7 @@ public class HisTask {
|
||||||
* */
|
* */
|
||||||
public void deleteLogData(String tableName,String colName,String days)
|
public void deleteLogData(String tableName,String colName,String days)
|
||||||
{
|
{
|
||||||
if (RuoYiConfig.isQuzrtzTask()) {
|
if (ruoYiConfig.isQuzrtzTask()) {
|
||||||
log.info("日志数据删除开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("日志数据删除开始" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
int num = oracleSlaveDataAutoPushService.LogsTimerDel(tableName,colName,days);
|
int num = oracleSlaveDataAutoPushService.LogsTimerDel(tableName,colName,days);
|
||||||
log.info("日志数据删除结束,共删除 "+num+" 条日志。" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
log.info("日志数据删除结束,共删除 "+num+" 条日志。" + DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
|
|
@ -42,6 +42,8 @@ public class SysIndexController extends BaseController
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysPasswordService passwordService;
|
private SysPasswordService passwordService;
|
||||||
|
@Autowired
|
||||||
|
private RuoYiConfig ruoYiConfig;
|
||||||
|
|
||||||
// 系统首页
|
// 系统首页
|
||||||
@GetMapping("/index")
|
@GetMapping("/index")
|
||||||
|
@ -60,8 +62,8 @@ public class SysIndexController extends BaseController
|
||||||
mmap.put("footer", footer);
|
mmap.put("footer", footer);
|
||||||
mmap.put("tagsView", tagsView);
|
mmap.put("tagsView", tagsView);
|
||||||
mmap.put("mainClass", contentMainClass(footer, tagsView));
|
mmap.put("mainClass", contentMainClass(footer, tagsView));
|
||||||
mmap.put("copyrightYear", RuoYiConfig.getCopyrightYear());
|
mmap.put("copyrightYear", ruoYiConfig.getCopyrightYear());
|
||||||
mmap.put("demoEnabled", RuoYiConfig.isDemoEnabled());
|
mmap.put("demoEnabled", ruoYiConfig.isDemoEnabled());
|
||||||
mmap.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
mmap.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||||
mmap.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
mmap.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||||
mmap.put("isMobile", ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")));
|
mmap.put("isMobile", ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")));
|
||||||
|
@ -130,7 +132,7 @@ public class SysIndexController extends BaseController
|
||||||
@GetMapping("/system/main")
|
@GetMapping("/system/main")
|
||||||
public String main(ModelMap mmap)
|
public String main(ModelMap mmap)
|
||||||
{
|
{
|
||||||
mmap.put("version", RuoYiConfig.getVersion());
|
mmap.put("version", ruoYiConfig.getVersion());
|
||||||
return "main";
|
return "main";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.web.core.config;
|
package com.ruoyi.web.core.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@ -21,6 +22,8 @@ import springfox.documentation.spring.web.plugins.Docket;
|
||||||
@Configuration
|
@Configuration
|
||||||
public class SwaggerConfig
|
public class SwaggerConfig
|
||||||
{
|
{
|
||||||
|
@Autowired
|
||||||
|
private RuoYiConfig ruoYiConfig;
|
||||||
/** 是否开启swagger */
|
/** 是否开启swagger */
|
||||||
@Value("${swagger.enabled}")
|
@Value("${swagger.enabled}")
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
@ -59,9 +62,9 @@ public class SwaggerConfig
|
||||||
// 描述
|
// 描述
|
||||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
// 作者信息
|
// 作者信息
|
||||||
.contact(new Contact(RuoYiConfig.getName(), null, null))
|
.contact(new Contact(ruoYiConfig.getName(), null, null))
|
||||||
// 版本
|
// 版本
|
||||||
.version("版本号:" + RuoYiConfig.getVersion())
|
.version("版本号:" + ruoYiConfig.getVersion())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ spring:
|
||||||
# 慢SQL记录
|
# 慢SQL记录
|
||||||
log-slow-sql: true
|
log-slow-sql: true
|
||||||
slow-sql-millis: 1000
|
slow-sql-millis: 1000
|
||||||
merge-sql: true
|
merge-sql: false #关闭:SQL merge,否则:kill语句报错
|
||||||
wall:
|
wall:
|
||||||
config:
|
config:
|
||||||
multi-statement-allow: true
|
multi-statement-allow: true
|
||||||
|
@ -139,8 +139,6 @@ spring:
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
date-format: yyyy-MM-dd HH:mm:ss
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
# profiles:
|
|
||||||
# active: dev
|
|
||||||
# 文件上传
|
# 文件上传
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
|
|
|
@ -13,13 +13,13 @@ import org.springframework.stereotype.Component;
|
||||||
public class RuoYiConfig
|
public class RuoYiConfig
|
||||||
{
|
{
|
||||||
/** 项目名称 */
|
/** 项目名称 */
|
||||||
private static String name;
|
private String name;
|
||||||
|
|
||||||
/** 版本 */
|
/** 版本 */
|
||||||
private static String version;
|
private String version;
|
||||||
|
|
||||||
/** 版权年份 */
|
/** 版权年份 */
|
||||||
private static String copyrightYear;
|
private String copyrightYear;
|
||||||
|
|
||||||
/** 实例演示开关 */
|
/** 实例演示开关 */
|
||||||
private static boolean demoEnabled;
|
private static boolean demoEnabled;
|
||||||
|
@ -29,36 +29,36 @@ public class RuoYiConfig
|
||||||
|
|
||||||
/** 获取地址开关 */
|
/** 获取地址开关 */
|
||||||
private static boolean addressEnabled;
|
private static boolean addressEnabled;
|
||||||
private static boolean quzrtzTask;
|
private boolean quzrtzTask;
|
||||||
|
|
||||||
public static String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name)
|
public void setName(String name)
|
||||||
{
|
{
|
||||||
RuoYiConfig.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getVersion()
|
public String getVersion()
|
||||||
{
|
{
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVersion(String version)
|
public void setVersion(String version)
|
||||||
{
|
{
|
||||||
RuoYiConfig.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCopyrightYear()
|
public String getCopyrightYear()
|
||||||
{
|
{
|
||||||
return copyrightYear;
|
return copyrightYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCopyrightYear(String copyrightYear)
|
public void setCopyrightYear(String copyrightYear)
|
||||||
{
|
{
|
||||||
RuoYiConfig.copyrightYear = copyrightYear;
|
this.copyrightYear = copyrightYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isDemoEnabled()
|
public static boolean isDemoEnabled()
|
||||||
|
@ -86,7 +86,7 @@ public class RuoYiConfig
|
||||||
return addressEnabled;
|
return addressEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddressEnabled(boolean addressEnabled)
|
public static void setAddressEnabled(boolean addressEnabled)
|
||||||
{
|
{
|
||||||
RuoYiConfig.addressEnabled = addressEnabled;
|
RuoYiConfig.addressEnabled = addressEnabled;
|
||||||
}
|
}
|
||||||
|
@ -123,11 +123,11 @@ public class RuoYiConfig
|
||||||
return getProfile() + "/upload";
|
return getProfile() + "/upload";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isQuzrtzTask() {
|
public boolean isQuzrtzTask() {
|
||||||
return quzrtzTask;
|
return quzrtzTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setQuzrtzTask(boolean quzrtzTask) {
|
public void setQuzrtzTask(boolean quzrtzTask) {
|
||||||
RuoYiConfig.quzrtzTask = quzrtzTask;
|
this.quzrtzTask = quzrtzTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
APP_NAME=ruoyi-admin-neuhisutools.jar
|
|
||||||
PID=$(ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}')
|
|
||||||
JVM="-server -Xms1g -Xmx4g -Xmn1g -verbose:gc-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=5 -XX:+ExplicitGCInvokesConcurrent -XX:GCTimeRatio=19 -XX:CMSInitiatingOccupancyFraction=70 -XX:CMSFullGCsBeforeCompaction=0 -Xnoclassgc -XX:SoftRefLRUPolicyMSPerMB=0"
|
|
||||||
|
|
||||||
if [ "$PID" != "" ]; then
|
|
||||||
echo '================>停止服务..........'
|
|
||||||
kill -9 $PID
|
|
||||||
sleep 3s
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo '================>nohup.out日志清空成功.........'
|
|
||||||
echo '' > nohup.out
|
|
||||||
echo '================>开始重启服务.........'
|
|
||||||
|
|
||||||
nohup java $JVM -jar $APP_NAME 2>&1 &
|
|
||||||
tail -f nohup.out
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/bash
|
||||||
|
APP_NAME=ruoyi-admin-neuhisutools-1.0.0.jar
|
||||||
|
PID=$(ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}')
|
||||||
|
|
||||||
|
|
||||||
|
#JVM="-server -Xms2g -Xmx8g -Xmn4g -verbose:gc-XX:+UseConcMarkSweepGC -XX:MaxTenuringThreshold=5 -XX:+ExplicitGCInvokesConcurrent -XX:GCTimeRatio=19 -XX:CMSInitiatingOccupancyFraction=70 -XX:CMSFullGCsBeforeCompaction=0 -Xnoclassgc -XX:SoftRefLRUPolicyMSPerMB=0"
|
||||||
|
JVM="-server -Xms2g -Xmx8g -Xmn4g -XX:MetaspaceSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+ParallelRefProcEnabled -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=java_heapdump.hprof -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc_trace.log -verbose:gc -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$PID" != "" ]; then
|
||||||
|
echo '================>停止服务..........'
|
||||||
|
kill -9 $PID
|
||||||
|
sleep 3s
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo '================>nohup.out日志清空成功.........'
|
||||||
|
echo '' > nohup.out
|
||||||
|
echo '================>开始重启服务.........'
|
||||||
|
|
||||||
|
nohup java $JVM -jar $APP_NAME --spring.config.location=file:/data/neuhisutools/application.yml 2>&1 &
|
||||||
|
tail -f nohup.out
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo '================>停止服务开始..........'
|
echo '================>停止服务开始..........'
|
||||||
APP_NAME=ruoyi-admin-neuhisutools.jar
|
APP_NAME=ruoyi-admin-neuhisutools-1.0.0.jar
|
||||||
PID=$(ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}')
|
PID=$(ps -ef|grep $APP_NAME|grep -v grep|awk '{print $2}')
|
||||||
if [ "$PID" != "" ]; then
|
if [ "$PID" != "" ]; then
|
||||||
echo '================>停止服务结束..........'
|
echo '================>停止服务结束..........'
|
Loading…
Reference in New Issue