当前位置: 首页 > news >正文

茶叶网站建设策划方案 u001f烟台网站建设

茶叶网站建设策划方案 u001f,烟台网站建设,一级a做爰片视频网站,东莞阳光网官网投诉中心目录一、简介二、搭建 springboot-admin 管理服务1.Maven 依赖2.application.yml3.添加 EnableAdminServer4.启动服务,查看页面三、搭建 springboot-admin-client 客户端服务1.Maven 依赖2.application.yml3.启动服务,查看页面四、搭配 Eureka 使用1.搭建…

目录

    • 一、简介
    • 二、搭建 springboot-admin 管理服务
      • 1.Maven 依赖
      • 2.application.yml
      • 3.添加 @EnableAdminServer
      • 4.启动服务,查看页面
    • 三、搭建 springboot-admin-client 客户端服务
      • 1.Maven 依赖
      • 2.application.yml
      • 3.启动服务,查看页面
    • 四、搭配 Eureka 使用
      • 1.搭建 springboot-eureka 服务
        • 1.1)Maven 依赖:
        • 1.2)application.yml:
        • 1.3)添加 @EnableEurekaServer 注解
        • 1.4)启动服务
      • 2.调整 `springboot-admin` 管理服务
        • 1.1)Maven依赖:
        • 1.2)application.yml
        • 1.3)启动服务
      • 3.调整 `springboot-admin-client` 客户端服务
        • 1.1)Maven依赖:
        • 1.2)application.yml
        • 1.3)启动服务

上一章 SpringBoot实战(十二)我们集成了 Spring Actuator,我们拿到了应用服务的健康状态指标以及其他参数。这一章,我们就来看一下基于 Spring Actuator 数据进行图形化界面展示的 Spring Boot Admin 框架。

一、简介

Spring Boot Admin: Spring Boot Admin 是一个开源项目,提供了一个基于 web 的界面来管理和监控 Spring Boot 的应用程序。它可以实时监控您的 Spring Boot 应用程序,包括健康状况、指标和其他有用信息。

GitHub: https://github.com/codecentric/spring-boot-admin

官方文档: https://codecentric.github.io/spring-boot-admin/2.5.1/#getting-started

通过 Spring Boot Admin,我们可以轻松地从一个仪表板管理多个 Spring Boot 应用程序。我们可以查看每个应用程序的详细信息,包括内存使用情况、CPU 使用情况、线程等等。您还可以查看每个应用程序的配置属性,并在运行时进行编辑。

Spring Boot Admin 还提供了一个集中查看 Spring Boot 应用程序日志的地方。您可以按日期、日志级别和文本搜索过滤日志。这可以帮助我们快速排查应用程序中的问题。

此外,Spring Boot Admin 还具有发送通知的内置支持,当发生某些事件时,例如应用程序关闭或堆使用超过某个阈值时,您可以接收到通知。

总体而言,Spring Boot Admin 是一个有用的工具,用于管理和监控您的 Spring Boot 应用程序。它可以帮助您快速识别和排查问题,同时为您的应用程序的健康和性能提供有价值的参考。

这里,我们会一起创建一个 Spring Boot Admin 的管理服务客户端服务

二、搭建 springboot-admin 管理服务

1.Maven 依赖

<properties><java.version>1.8</java.version><spring.boot.version>2.4.5</spring.boot.version><spring.cloud.version>2020.0.3</spring.cloud.version><admin.starter.server.version>2.3.1</admin.starter.server.version>
</properties>
<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Lombok --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency><!-- spring-boot-admin --><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-server</artifactId><version>${admin.starter.server.version}</version></dependency><!-- Eureka --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring.boot.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring.cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies>
</dependencyManagement>

2.application.yml

server:port: 8000spring:application:name: springboot-adminmanagement:endpoint:health:show-details: always

3.添加 @EnableAdminServer

在启动类添加 @EnableAdminServer 注解:

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@EnableAdminServer
@SpringBootApplication
public class SpringbootDemoApplication {public static void main(String[] args) {SpringApplication.run(SpringbootDemoApplication.class, args);}
}

4.启动服务,查看页面

启动 springboot-admin 服务,访问地址:http://localhost:8000

在这里插入图片描述

三、搭建 springboot-admin-client 客户端服务

1.Maven 依赖

<properties><java.version>1.8</java.version><spring.boot.version>2.4.5</spring.boot.version><spring.cloud.version>2020.0.3</spring.cloud.version><admin.starter.client.version>2.3.1</admin.starter.client.version>
</properties>
<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Lombok --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency><!-- spring-boot-actuator --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!-- spring-boot-admin-client --><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-client</artifactId><version>${admin.starter.client.version}</version></dependency>
</dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring.boot.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring.cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies>
</dependencyManagement>

2.application.yml

server:port: 8001spring:application:name: springboot-admin-clientboot:admin:client:api-path: /instancesurl: http://127.0.0.1:8100instance:prefer-ip: true # 使用ip注册进来management:endpoint:health:show-details: alwaysendpoints:enabled-by-default: trueweb:base-path: /actuatorexposure:include: "*"

3.启动服务,查看页面

启动 springboot-admin-client 服务,再次访问地址:http://localhost:8000

在这里插入图片描述

点击 应用墙,我们可以看到目前是只有一个客户端服务。

在这里插入图片描述

点击这个服务,我们可以看到当前服务的元数据、进程和线程的状态等信息。

在这里插入图片描述

以上就是 Spring Boot Admin 框架的原始集成方式。

四、搭配 Eureka 使用

其实 Spring Boot Admin 可以搭配 Eureka 注册中心,实现自动扫描注册到注册中心上的所有服务,只要服务中集成了 Spring Actuator

1.搭建 springboot-eureka 服务

1.1)Maven 依赖:

<properties><java.version>1.8</java.version><spring.boot.version>2.4.5</spring.boot.version><spring.cloud.version>2020.0.3</spring.cloud.version>
</properties>
<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- eureka --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency>
</dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring.boot.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring.cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies>
</dependencyManagement>

1.2)application.yml:

server:port: 1001spring:application:name: springboot-eurekasecurity:user:name: demopassword: Demo2023eureka:instance:hostname: localhostclient:# eureka.client.registerWithEureka :表示是否将自己注册到Eureka Server,默认为true。# 由于当前这个应用就是Eureka Server,故而设为falseregister-with-eureka: false# eureka.client.fetchRegistry :表示是否从Eureka Server获取注册信息,默认为true。# 因为这是一个单点的Eureka Server,不需要同步其他的Eureka Server节点的数据,故而设为false。fetch-registry: falseserver:# 配置属性,但由于 Eureka 自我保护模式以及心跳周期长的原因,经常会遇到 Eureka Server 不剔除已关停的节点的问题enable-self-preservation: false# 清理间隔(单位毫秒,默认是60*1000),开发环境设置如下可快速移除不可用的服务eviction-interval-timer-in-ms: 5000

1.3)添加 @EnableEurekaServer 注解

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;@EnableEurekaServer
@SpringBootApplication
public class SpringbootDemoApplication {public static void main(String[] args) {SpringApplication.run(SpringbootDemoApplication.class, args);}
}

1.4)启动服务

启动服务,访问地址:http://localhost:1001

在这里插入图片描述

2.调整 springboot-admin 管理服务

1.1)Maven依赖:

<properties><java.version>1.8</java.version><spring.boot.version>2.4.5</spring.boot.version><spring.cloud.version>2020.0.3</spring.cloud.version><admin.starter.server.version>2.3.1</admin.starter.server.version>
</properties>
<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Lombok --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><!-- spring-boot-admin --><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-server</artifactId><version>${admin.starter.server.version}</version></dependency><!-- Eureka --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring.boot.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring.cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies>
</dependencyManagement>

1.2)application.yml

server:port: 8000spring:application:name: springboot-adminmanagement:endpoint:health:show-details: always#eureka client
eureka:client:service-url:defaultZone: http://demo:Demo2023@localhost:1001/eureka/instance:hostname: localhostprefer-ip-address: true # 是否使用 ip 地址注册instance-id: ${spring.cloud.client.ip-address}:${server.port} # ip:portlease-renewal-interval-in-seconds: 5 # 实例续期心跳间隔(默认30s),设置之后启动服务不需要等很久就可以访问到服务的内容lease-expiration-duration-in-seconds: 15 # 实例续期持续多久后失效(默认90s)

1.3)启动服务

访问 Eureka 地址:http://localhost:1001

在这里插入图片描述

访问管理页面地址:http://localhost:8000/wallboard

在这里插入图片描述

3.调整 springboot-admin-client 客户端服务

1.1)Maven依赖:

<properties><java.version>1.8</java.version><spring.boot.version>2.3.6.RELEASE</spring.boot.version><spring.cloud.version>Hoxton.SR8</spring.cloud.version><admin.starter.client.version>2.3.1</admin.starter.client.version>
</properties>
<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- Lombok --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><!-- spring-boot-actuator --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!-- spring-boot-admin-client --><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-starter-client</artifactId><version>${admin.starter.client.version}</version></dependency><!-- Eureka --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId></dependency>
</dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring.boot.version}</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>${spring.cloud.version}</version><type>pom</type><scope>import</scope></dependency></dependencies>
</dependencyManagement>

1.2)application.yml

server:port: 8001spring:application:name: springboot-admin-client
#  boot:
#    admin:
#      client:
#        api-path: /instances
#        url: http://127.0.0.1:8000
#        instance:
#          prefer-ip: true # 使用ip注册进来management:endpoint:health:show-details: alwaysendpoints:enabled-by-default: trueweb:base-path: /actuatorexposure:include: "*"#eureka client
eureka:client:service-url:defaultZone: http://demo:Demo2023@localhost:1001/eureka/instance:hostname: localhostprefer-ip-address: true # 是否使用 ip 地址注册instance-id: ${spring.cloud.client.ip-address}:${server.port} # ip:portlease-renewal-interval-in-seconds: 5 # 实例续期心跳间隔(默认30s),设置之后启动服务不需要等很久就可以访问到服务的内容lease-expiration-duration-in-seconds: 15 # 实例续期持续多久后失效(默认90s)

1.3)启动服务

访问 Eureka 地址:http://localhost:1001

在这里插入图片描述

访问管理页面地址:http://localhost:8000/wallboard

在这里插入图片描述

整理完毕,完结撒花~ 🌻





参考地址:

1.Spring Boot Admin 介绍及使用,https://blog.csdn.net/zouliping123456/article/details/121977792


文章转载自:
http://sahitya.rwzc.cn
http://calycoid.rwzc.cn
http://preinduction.rwzc.cn
http://nominally.rwzc.cn
http://means.rwzc.cn
http://kinship.rwzc.cn
http://tart.rwzc.cn
http://procural.rwzc.cn
http://invariably.rwzc.cn
http://retrainee.rwzc.cn
http://petitor.rwzc.cn
http://lotic.rwzc.cn
http://foreshow.rwzc.cn
http://unitarianism.rwzc.cn
http://railroader.rwzc.cn
http://galiot.rwzc.cn
http://vulpecular.rwzc.cn
http://carder.rwzc.cn
http://lietuva.rwzc.cn
http://cgh.rwzc.cn
http://misclassify.rwzc.cn
http://econiche.rwzc.cn
http://lanchow.rwzc.cn
http://actively.rwzc.cn
http://prehnite.rwzc.cn
http://passeriform.rwzc.cn
http://blacktailed.rwzc.cn
http://unskilled.rwzc.cn
http://lesbianism.rwzc.cn
http://remission.rwzc.cn
http://obviously.rwzc.cn
http://barostat.rwzc.cn
http://surprising.rwzc.cn
http://disunion.rwzc.cn
http://semiprofessional.rwzc.cn
http://connector.rwzc.cn
http://aggradation.rwzc.cn
http://ladysnow.rwzc.cn
http://aspirin.rwzc.cn
http://adversarial.rwzc.cn
http://respiratory.rwzc.cn
http://motory.rwzc.cn
http://magnate.rwzc.cn
http://graphology.rwzc.cn
http://cosiness.rwzc.cn
http://negotiating.rwzc.cn
http://establish.rwzc.cn
http://scalarly.rwzc.cn
http://inker.rwzc.cn
http://scuttle.rwzc.cn
http://photoconduction.rwzc.cn
http://taig.rwzc.cn
http://indebted.rwzc.cn
http://forecastle.rwzc.cn
http://mountainous.rwzc.cn
http://greedily.rwzc.cn
http://nongreen.rwzc.cn
http://convoluted.rwzc.cn
http://ritual.rwzc.cn
http://stab.rwzc.cn
http://pacemaker.rwzc.cn
http://martensitic.rwzc.cn
http://adhere.rwzc.cn
http://cacodylate.rwzc.cn
http://musician.rwzc.cn
http://pliable.rwzc.cn
http://belial.rwzc.cn
http://roesti.rwzc.cn
http://herald.rwzc.cn
http://pennsylvania.rwzc.cn
http://periodically.rwzc.cn
http://festology.rwzc.cn
http://fangle.rwzc.cn
http://epithelial.rwzc.cn
http://agelong.rwzc.cn
http://jeopard.rwzc.cn
http://aucuba.rwzc.cn
http://submarginal.rwzc.cn
http://ref.rwzc.cn
http://baseline.rwzc.cn
http://blent.rwzc.cn
http://chylify.rwzc.cn
http://cbd.rwzc.cn
http://membranous.rwzc.cn
http://millinery.rwzc.cn
http://unexpired.rwzc.cn
http://fled.rwzc.cn
http://cyclist.rwzc.cn
http://amongst.rwzc.cn
http://scatterometer.rwzc.cn
http://yugoslavic.rwzc.cn
http://semifinalist.rwzc.cn
http://semitotalitarian.rwzc.cn
http://berry.rwzc.cn
http://pleasant.rwzc.cn
http://regenesis.rwzc.cn
http://herbaria.rwzc.cn
http://crumena.rwzc.cn
http://jungly.rwzc.cn
http://detick.rwzc.cn
http://www.hrbkazy.com/news/66942.html

相关文章:

  • 网站建设合同模板新闻类软文营销案例
  • 可以做任务看漫画的漫画网站搜索网站排行
  • 做网站如何躲过网警百度云盘下载
  • 广西智能网站建设设计用html制作淘宝网页
  • 个人备案网站描述网络推广有哪些
  • 影视在YouTube网站上做收益难吗百度关键词搜索量
  • 手机网站推广法seo每日一贴
  • 瓦房店网站制作亚马逊关键词优化软件
  • wordpress 更多内容seo外包杭州
  • 搭建写真网站赚钱项目seo岗位工作内容
  • 专做日式新中式庭院的网站有哪些营销活动
  • 试述网站建设应考虑哪些方面的问题百家号关键词seo优化
  • 漯河哪个网站推广效果好推广普通话的宣传标语
  • 同城型网站开发seo北京网站推广
  • 郑州做品牌网站的公司营销软件
  • 零食电子商务网站建设策划书珠海seo关键词排名
  • 网站建设客户需求表seo网页优化服务
  • 东莞地铁线路图seo排名优化教学
  • 网站官网上的新闻列表怎么做百度小程序优化
  • 上海专业做网站公网站管理
  • 中小企业网站制作软件广州网站推广排名
  • 外国网站做b2b的seo教程seo教程
  • wordpress版本信息在哪里查看seo关键字优化技巧
  • 政府网站建设成果通稿seo关键词如何布局
  • 用dw做动态网站的步骤seo优化系统
  • 78建筑网站今天的最新新闻内容
  • 泰安网站建设论文结论广州新一期lpr
  • 网站建设课程设计要求精准营销系统
  • 申请注册网址搜索引擎优化期末考试答案
  • 什么建设网站全国最新疫情最新消息