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

中外商贸网站建设平台网站 空间 服务器 免费

中外商贸网站建设平台,网站 空间 服务器 免费,wordpress云落主题,欧美风格网站源码1.简介 Spring Boot Admin为项目常用的监控方式#xff0c;可以动态的监控服务是否运行和运行的参数#xff0c;如类的调用情况、流量等。其中分为server与client#xff1a; server#xff1a; 提供展示UI与监控服务。client#xff1a;加入server#xff0c;被监控的… 1.简介 Spring Boot Admin为项目常用的监控方式可以动态的监控服务是否运行和运行的参数如类的调用情况、流量等。其中分为server与client server 提供展示UI与监控服务。client加入server被监控的项目。 同时在监控的过程中spring-boot-starter-actuator也被经常提及actuator使用后会在被项目内部打上探针提供一系列的监控api接口如堆内存、栈内存等。下文数据为actuator提供。 2.server端 2.1 新建springboot项目 这里不多说常用方法新建springboot项目。 2.2 修改pom文件 由于使用了spring cloud alibaba生态所以这里将nacos包也加入了请自行选择。 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactIdoptionaltrue/optional/dependencydependencygroupIdde.codecentric/groupIdartifactIdspring-boot-admin-starter-server/artifactIdversion2.2.0/version/dependency!-- SpringCloud Alibaba Nacos --dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-discovery/artifactId/dependency!-- SpringCloud Alibaba Nacos Config --dependencygroupIdcom.alibaba.cloud/groupIdartifactIdspring-cloud-starter-alibaba-nacos-config/artifactId/dependency/dependencies2.3 修改yml文件 server端暂无其他配置。 server:port: 8008servlet:context-path: /monitor spring:application:name: monitor-resource # Eureka页面显示2.4 修改 加入EnableAdminServer注解。 SpringBootApplication EnableAdminServer public class MonitorApplication {public static void main(String[] args) {SpringApplication.run(MonitorApplication.class, args);}}访问ip:端口/context-path就可以访问了。页面如下。 3.client端 3.1 修改pom文件 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-actuator/artifactId/dependencydependencygroupIdde.codecentric/groupIdartifactIdspring-boot-admin-starter-client/artifactIdversion2.2.0/version/dependency3.2 修改yml文件 在有context-path情况下需要加入特殊配置否则报错。本文为nacos中的配置请参考。 server:port: 8008servlet:context-path: /monitor spring:application:name: monitor-resource boot:admin:client:api-path:url: http://127.0.0.1:8008/monitor # 这里为server地址如果有context-path需要加入instance:prefer-ip: true # 使用ip注册进来management-url: /monitorcloud:nacos:discovery:# 服务注册地址server-addr: ip:8848metadata: # 如果有context-path需要加上否者报错management:context-path: ${server.servlet.context-path}/actuatorconfig:# 配置中心地址server-addr: ip:8848# 配置文件格式file-extension: yml management: # actuator配置endpoint:health:show-details: alwaysendpoints:enabled-by-default: trueweb:exposure:include: *启动后即可加入server服务页面展示如下 4.Security 4.1 修改pom文件。 dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-security/artifactId/dependency4.2 修改application.xml文件 加入登录账号密码。 spring:security:user:name: adminpassword: 1qazWSX4.3 新增登入登出配置 这里需要配置登入登出的页面地址同其他博文相同配置。 Configuration public class SecuritySecureConfig extends WebSecurityConfigurerAdapter {private final String adminContextPath;public SecuritySecureConfig(AdminServerProperties adminServerProperties) {this.adminContextPath adminServerProperties.getContextPath();}Overrideprotected void configure(HttpSecurity http) throws Exception {// formatter:offSavedRequestAwareAuthenticationSuccessHandler successHandler new SavedRequestAwareAuthenticationSuccessHandler();successHandler.setTargetUrlParameter( redirectTo );http.authorizeRequests().antMatchers( adminContextPath /assets/** ).permitAll().antMatchers( adminContextPath /login ).permitAll().anyRequest().authenticated().and().formLogin().loginPage( adminContextPath /login ).successHandler( successHandler ).and().logout().logoutUrl( adminContextPath /logout ).and().httpBasic().and().csrf().disable();} }再次登录可以看到需要账号登录。
http://wiki.neutronadmin.com/news/212015/

相关文章:

  • 宁波公司网站建设价格广西专业网站建设
  • 更改了网站关键词后要怎么做成都网站快速排名优化
  • 建设网站哪家比较好专业html5网站建设
  • 厦门市建设局网站规划标准网站建设q a
  • 怎么让谷歌收录我的网站js制作网页制作步骤
  • 绵阳微网站制作做农产品的网站名称
  • 图片做动画网站wordpress 内链插件
  • 怎么样自己制作网站百度提交工具
  • 建设网站申请书施秉网站建设
  • 中山专业手机网站建设二级建造师证报考要求
  • ui设计比较成功的网站页面西安公司建设网站
  • 中国建设人才信息网是官方网站吗wordpress更新慢
  • app网站开发协议梦幻西游网页版下载
  • 使用python建设一个论坛网站php 购物网站开发
  • 诸城做网站建设的东莞网络营销价格咨询
  • 大连建设网官网网上办公大厅汉阳网站推广优化
  • 可以跟关键词密度过高的网站交换友情链接吗广州网站策划公司
  • ftp发布asp.net网站免费做产品宣传的网站
  • 淘宝基地网站怎么做wordpress婚庆模板下载
  • 网站建设的渠道策略智慧团建网站登录平台手机版
  • 网站建设前端和后端的区别沧州企业网站
  • wordpress做旅游网站wordpress网页标签图标
  • 企业网站的建立流程的第一步是网上推广工作
  • 网站开发软件的选择ui设计手机交互界面下载
  • 餐饮网站模板做网站到内容填充需要多久
  • 影楼网站模版网站建设综合实践 教材
  • 大气网站模板免费下载网站没有后台怎么更新文章
  • wordpress本站主题wordpress 目录改变
  • 分类型网站建设星空无限传媒官网免费下载
  • 同个网站可以做多个外链吗登录wordpress建立数据库