Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
33f319c9
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33f319c9
编写于
6月 28, 2017
作者:
S
shenhongxi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shutdown
上级
3cc27641
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
33 deletion
+24
-33
whatsmars-spring-boot/README.md
whatsmars-spring-boot/README.md
+4
-32
whatsmars-spring-boot/pom.xml
whatsmars-spring-boot/pom.xml
+4
-0
whatsmars-spring-boot/src/main/resources/application-test.properties
...pring-boot/src/main/resources/application-test.properties
+16
-1
未找到文件。
whatsmars-spring-boot/README.md
浏览文件 @
33f319c9
...
...
@@ -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
whatsmars-spring-boot/pom.xml
浏览文件 @
33f319c9
...
...
@@ -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>
...
...
whatsmars-spring-boot/src/main/resources/application-test.properties
浏览文件 @
33f319c9
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录