jconsole和springboot actuator监控中心

一,jconsole的监控本地tomcat

1,打开tomcat下的bin路径,编辑catalina.bat

2,在第一行加入,保存,然后启动tomcat,cmd窗口执行startup.bat

set  "JAVA_OPTS=-server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+DisableExplicitGC -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8080 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

3,打开jconsole.exe,在jdk的bin目录,选择本地进程,点击连接

二,springboot的actuator监控中心,(缺点没有界面UI)

添加依赖

<dependency>
	groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
server:
  port: 8081
management:
  security:
    enabled: false #关掉安全认证
  port: 8088 #管理端口调整成8088
  context-path: /monitor #actuator的访问路径http://localhost:8088/monitor/beans
                        #springboot2.0之后需要加actuator去访问
endpoints:
  shutdown:
    enabled: true
#自定义用户信息
info:
   app:
      name: spring-boot-actuator
      version: 1.0.0

下面是各个路径的作用

路径

作用

/actuator/beans

显示应用程序中所有Spring bean的完整列表。

/actuator/configprops

显示所有配置信息。

/actuator/env

陈列所有的环境变量。

/actuator/mappings

显示所有@RequestMapping的url整理列表。

/actuator/health

显示应用程序运行状况信息 up表示成功 down失败

/actuator/info

查看自定义应用信息

 

案例一:”查看接口是否正常:返回up表示正常,down不正常

http://localhost:8088/monitor/health

案例二:查看自定义应用信息

 

三,Admin-UI分布式微服务监控中心(相比于actuator监控有了界面ui)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值