springboot-admin

https://github.com/codecentric/spring-boot-admin
https://codecentric.github.io/spring-boot-admin/1.3.2/
https://codecentric.github.io/spring-boot-admin/1.5.7/

1.server
1.1pom.xml

<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.3.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	
	<dependencyManagement>
		<dependencies>
			<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>Finchley.RELEASE</version>
				<type>pom</type>
			</dependency>
		</dependencies>
  </dependencyManagement>
  
  <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
            <version>2.0.1</version>
        </dependency>
        
        <dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-security</artifactId>
		</dependency>

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

1.2.app加注解

@EnableAdminServer
@EnableWebSecurity

1.3application.properties

server.port=8888
spring.mail.host=smtp.163.com
spring.mail.port=465
spring.mail.username=xxx@163.com
spring.mail.password=xxx
spring.mail.properties.smtp.auth=true
spring.mail.properties.smtp.starttls.enable=true
spring.mail.properties.smtp.starttls.required=true
spring.mail.properties.mail.smtp.ssl.enable=true
spring.boot.admin.notify.mail.from=xxx@163.com
spring.boot.admin.notify.mail.to=xxx@qq.com
spring.security.user.name=xxx
spring.security.user.password=xxx

2client
2.1pom.xml

<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.3.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	
<dependencyManagement>
		<dependencies>
			<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies -->
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>Finchley.RELEASE</version>
				<type>pom</type>
			</dependency>
		</dependencies>
  </dependencyManagement>
	
<dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>2.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

2.2application.yml

spring:
  boot:
    admin:
      client: 
        url: http://localhost:8888
        instance:
          metadata:
            user.name: admin
            user.password: admin
        username: admin
        password: admin

management:
  endpoints:
    web:
      exposure:
        include: "*"

3.springboot1.5的应用
3.1application.yml

spring.boot.admin.url: http://localhost:8888   
spring.boot.admin.username: xxx
spring.boot.admin.password: xxx
spring.boot.admin.api-path: instances
management.security.enabled: false

3.2pom.xml

<dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>1.5.6</version>
        </dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值