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

如何在百度上搜到网站网站维护英文

如何在百度上搜到网站,网站维护英文,建站公司哪家好 都选万维科技,无锡微信网站建设#x1f497;wei_shuo的个人主页 #x1f4ab;wei_shuo的学习社区 #x1f310;Hello World #xff01; Spring Cloud Eureka#xff1a;服务注册与发现 Spring Cloud Eureka是Spring Cloud生态系统中的一个组件#xff0c;它是用于实现服务注册与发现的服务治理组件。在… wei_shuo的个人主页 wei_shuo的学习社区 Hello World Spring Cloud Eureka服务注册与发现 Spring Cloud Eureka是Spring Cloud生态系统中的一个组件它是用于实现服务注册与发现的服务治理组件。在微服务架构中服务之间存在复杂的依赖关系而Spring Cloud Eureka可以帮助解决服务之间相互查找和通信的问题 Eureka简介 Eureka是Netflix开源的服务发现组件用于在分布式系统中实现服务注册与发现。它是Netflix公司在构建微服务架构时开发的核心组件之一后来成为了Spring Cloud生态系统中的一部分 Eureka注册中心搭建 Eureka服务端搭建 eureka-server依赖导入 dependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-starter-netflix-eureka-server/artifactId /dependency启动类添加注解EnableEurekaServer EnableEurekaServer SpringBootApplication public class EurekaServerApplication {public static void main(String[] args) {SpringApplication.run(EurekaServerApplication.class, args);} }配置文件application.yml配置 server:port: 8001 #指定运行端口 spring:application:name: eureka-server #指定服务名称 eureka:instance:hostname: localhost #指定主机地址client:fetch-registry: false #指定是否要从注册中心获取服务注册中心不需要开启register-with-eureka: false #指定是否要注册到注册中心注册中心不需要开启server:enable-self-preservation: false #关闭保护模式Eureka客户端搭建 eureka-client依赖导入 dependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-starter-netflix-eureka-client/artifactId /dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId /dependency启动类添加注解EnableDiscoveryClient EnableDiscoveryClient SpringBootApplication public class EurekaClientApplication {public static void main(String[] args) {SpringApplication.run(EurekaClientApplication.class, args);} }配置文件application.yml配置 server:port: 8101 #运行端口号 spring:application:name: eureka-client #服务名称 eureka:client:register-with-eureka: true #注册到Eureka的注册中心fetch-registry: true #获取注册实例列表service-url:defaultZone: http://localhost:8001/eureka/ #配置注册中心地址Eureka集群搭建 eureka-sever添加配置文件application-replica1.yml配置第一个注册中心 server:port: 8002 spring:application:name: eureka-server eureka:instance:hostname: replica1client:serviceUrl:defaultZone: http://replica2:8003/eureka/ #注册到另一个Eureka注册中心fetch-registry: trueregister-with-eureka: true给eureka-sever添加配置文件application-replica2.yml配置第二个注册中心 server:port: 8003 spring:application:name: eureka-server eureka:instance:hostname: replica2client:serviceUrl:defaultZone: http://replica1:8002/eureka/ #注册到另一个Eureka注册中心fetch-registry: trueregister-with-eureka: true修改Eureka-client连接到集群 server:port: 8102 spring:application:name: eureka-client eureka:client:register-with-eureka: truefetch-registry: trueservice-url:defaultZone: http://replica1:8002/eureka/,http://replica2:8003/eureka/ #同时注册到两个注册中心Eureka添加认证 添加SpringSecurity依赖 dependencygroupIdorg.springframework.cloud/groupIdartifactIdspring-cloud-starter-netflix-eureka-server/artifactId /dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-security/artifactId /dependency添加application.yml配置文件配置用户名、密码 server:port: 8004 spring:application:name: eureka-security-serversecurity: #配置SpringSecurity登录用户名和密码user:name: macropassword: 123456 eureka:instance:hostname: localhostclient:fetch-registry: falseregister-with-eureka: false添加 Java 配置WebSecurityConfig 默认情况下Spring Security会开启CSRFCross-Site Request Forgery保护这是一种用于防止跨站点请求伪造攻击的安全机制。当你添加了Spring Security依赖到应用程序中时每个POST、PUT、DELETE等修改类请求都需要在请求头中包含CSRF token才能被服务器接受 默认情况下添加SpringSecurity依赖的应用每个请求都需要添加CSRF token才能访问Eureka客户端注册时并不会添加所以需要配置/eureka/**路径不需要CSRF token EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter {Overrideprotected void configure(HttpSecurity http) throws Exception {http.csrf().ignoringAntMatchers(/eureka/**);super.configure(http);} }结语创作不易如果觉得博主的文章赏心悦目还请——点赞收藏⭐️评论
http://www.hkea.cn/news/14401734/

相关文章:

  • 天津建设工程协会网站cms开源框架
  • 个人服务器 网站建设郓城网站开发
  • 中小企业网站推广鞋子网站模板
  • 建网站需要哪些语言东莞房价一览表
  • 怎么做网站评论对于网络营销的认识
  • 网站开发的公司推荐搜索关键词热度
  • 做暖暖视频网站观看网站开发用什么开发
  • 公司注册代理注册西安网站关键词优化推荐
  • 建设网站的运行费包括什么地方如何用易语言做网站
  • 有没有catia做幕墙的网站网站开发视频会议插件
  • 如何做好公司网站163邮箱个人注册入口
  • 无锡专业制作外贸网站的公司sem是什么职位
  • 新网站多久收录内页建筑设计公司招聘
  • python合适做网站吗展示型网站方案
  • 好看的单页面网站模板免费下载没有网站 可以做cpa
  • 网站开发的重要性山东服务好的seo
  • 建企业网站一般多少钱泉州地区网站建设公司
  • android网站开发实例新加坡房产网站大全
  • 网站怎么做的qq邮件订阅网站开发现在怎么样
  • 宁波网站建设方式商丘做网站的费用
  • 华强北 网站建设安阳设计工厂
  • 网站开发网页上传和网页发布wordpress本地上传图片
  • python+网站开发实例教程外包做网站怎么拿源代码
  • wordpress後台建站如何做采集网站
  • 上海如何做网站生成器软件
  • 广东公诚通信建设监理有限公司网站想学设计怎么入门在家自己学
  • 瀑布流响应式网站模板wordpress最好的免费主题2018
  • 沈阳做微信和网站的公司微软雅黑适合于做网站吗
  • 安徽省工程建设监理协会网站雅布设计
  • 如何做中英文切换的双语网站百度快照优化排名怎么做