提交 33f319c9 编写于 作者: S shenhongxi

shutdown

上级 3cc27641
......@@ -10,35 +10,7 @@ Spring-Boot-Lib: BOOT-INF/lib/ <br />
可以外部配置文件启动 <br />
java -jar whatsmars-spring-boot.jar --spring.config.location=/opt/config/application.properties <br />
shell: <br />
start.sh <br />
#!/bin/sh <br />
rm -f tpid <br />
nohup java -jar /data/app/whatsmars-spring-boot.jar --spring.profiles.active=stg > /dev/null 2>&1 & <br />
echo $! > tpid <br />
stop.sh <br />
tpid=`cat tpid | awk '{print $1}'` <br />
tpid=`ps -aef | grep $tpid | awk '{print $2}' |grep $tpid` <br />
if [ ${tpid} ]; then <br />
kill -9 $tpid <br />
fi <br />
check.sh <br />
#!/bin/sh <br />
tpid=`cat tpid | awk '{print $1}'` <br />
tpid=`ps -aef | grep $tpid | awk '{print $2}' |grep $tpid` <br />
if [ ${tpid} ]; then <br />
echo App is running. <br />
else <br />
echo App is NOT running. <br />
fi <br />
kill.sh <br />
#!/bin/sh <br />
kill -9 `ps -ef|grep whatsmars-spring-boot|awk '{print $2}'` <br />
\ No newline at end of file
正确、安全地停止应用
endpoints.shutdown.enabled=true
management.context-path=/manage
curl -X POST host:port/shutdown
\ No newline at end of file
......@@ -66,6 +66,10 @@
</exclusion>
</exclusions>
</dependency>
<!--<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
......
......@@ -7,9 +7,24 @@ server.session.timeout=14400
#server.session.cookie.http-only=true
#server.session.cookie.path=/
#
#启用shutdown
endpoints.shutdown.enabled=true
#指定shutdown endpoint的路径
#endpoints.shutdown.path=/danger
#也可以统一指定所有endpoints的路径
management.context-path=/manage
#management.port: 9900
#management.address: 127.0.0.1
#开启shutdown的安全验证
#endpoints.shutdown.sensitive=true
#验证用户名
security.user.name=admin
#验证密码
security.user.password=secret
#角色
management.security.role=SUPERUSER
#server.contextPath=/user
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册