spring boot admin系统监控处理

1.系统监控使用springboot admin

2.springboot admin server

2.1 修改pom.xml增加dependency

		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-server</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-server-ui</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

2.2 启动类SpringbootApplication增加admin注解支持

@SpringBootApplication
@EnableAutoConfiguration
@EnableAdminServer
public class SpringbootApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringbootApplication.class, args);
	}

}

2.3 修改属性文件application.properties

server.display-name=springbootserver
server.context-path=/
server.servlet-path=/
server.port=8090
# admin
spring.boot.admin.url=http://localhost:${server.port}

3.springboot admin client

3.1 修改pom.xml增加dependency

		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-client</artifactId>
			<version>1.3.4</version>
		</dependency>
		<dependency>
			<groupId>org.jolokia</groupId>
			<artifactId>jolokia-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

3.2 修改属性文件application.properties

server.display-name=springbootserver
server.context-path=/
server.servlet-path=/
server.port=8090
# admin
spring.boot.admin.url=http://localhost:8090

3.3 logback.xml增加配置

<configuration>
	<include resource="org/springframework/boot/logging/logback/base.xml"/>
	<jmxConfigurator/>
</configuration>

启动server和client即可查看应用的状态

http://localhost:8090

转载于:https://my.oschina.net/u/184866/blog/1510302

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值