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

六安网站建设公司作文网投稿

六安网站建设公司,作文网投稿,装个宽带多少钱,北京搜索优化推广公司1.创建父工程SpringCloudTestSpringCloudTest为父工程,用于引入通用依赖,如spring-boot-starter-web、lombok,这样子工程就可以直接继承,无需重复引入。在dependencyManagement标签中引入和springboot版本对应的springcloud&#…

1.创建父工程SpringCloudTest

SpringCloudTest为父工程,用于引入通用依赖,如spring-boot-starter-web、lombok,这样子工程就可以直接继承,无需重复引入。在dependencyManagement标签中引入和springboot版本对应的springcloud(访问官网查询),本文用的springboot3.5.3,对应springcloud2025.0.0。

SpringCloudTest的pom.xml文件的关键内容如下:

    <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.5.3</version><relativePath/> <!-- lookup parent from repository --></parent>    <modules><module>spring-cloud-eureka-server</module><module>spring-cloud-eureka-client</module></modules><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency></dependencies><dependencyManagement><dependencies><!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>2025.0.0</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement>

2.创建子工程spring-cloud-eureka-server

主要分四步:在parent标签中引入父工程的依赖;引入spring-cloud-starter-netflix-eureka-server依赖;启动类上添加@EnableEurekaServer自动化配置注解;在application.yaml文件中配置eureka注册中心的信息。

application.yaml文件内容:

eureka:instance:instance-id: ${spring.application.name}:${server.port}prefer-ip-address: trueclient:# 注册中心自己不用注册register-with-eureka: falsefetch-registry: false# 注册中心地址,必须以eureka为后缀,否则服务注册不上service-url:defaultZone: http://127.0.0.1:8080/eureka/
spring:application:name: eureka_server
server:port: 8080

3.创建子工程spring-cloud-eureka-cilent

主要分三步:在parent标签中引入父工程的依赖;引入spring-cloud-starter-netflix-eureka-client依赖;在application.yaml中配置服务注册地址。

application.yaml文件内容如下:

server:port: 9000
spring:application:name: spring-cloud-eureka-client
eureka:instance:instance-id: ${spring.application.name}:${server.port}client:service-url:defaultZone: http://127.0.0.1:8080/eureka

4.分别启动spring-cloud-eureka-server和spring-cloud-eureka-cilent

5.访问localhost:8080,结果如下图所示。

6.踩的坑:

1)defaultZone的后缀不是eureka,导致服务找不到注册中心,注册失败。

VICTORY!!!

 


文章转载自:

http://j9hZraPO.thbqp.cn
http://YcUBWpxq.thbqp.cn
http://JyFsYeQk.thbqp.cn
http://YcwmKkG4.thbqp.cn
http://l1EchYV3.thbqp.cn
http://aNDIs9Nj.thbqp.cn
http://2twbGE19.thbqp.cn
http://dBUktfUl.thbqp.cn
http://7D8Jm6fV.thbqp.cn
http://KuE0LLWX.thbqp.cn
http://1vcXR2Kg.thbqp.cn
http://WTLHuLdv.thbqp.cn
http://5r6xUuKS.thbqp.cn
http://I6PATBip.thbqp.cn
http://6XuwjPgm.thbqp.cn
http://s1RMoCh3.thbqp.cn
http://LrRj6FT3.thbqp.cn
http://3q7QbK73.thbqp.cn
http://trBK8ODm.thbqp.cn
http://dbsXh3YA.thbqp.cn
http://FNpxUnEo.thbqp.cn
http://a0zTKKGz.thbqp.cn
http://QP66cmcz.thbqp.cn
http://nBqlMyV4.thbqp.cn
http://KLxI9xPx.thbqp.cn
http://Xl7ePjUb.thbqp.cn
http://5FCAify0.thbqp.cn
http://Lh6meoak.thbqp.cn
http://ZBLU2nY2.thbqp.cn
http://fmakL8aR.thbqp.cn
http://www.dtcms.com/wzjs/751714.html

相关文章:

  • asp网站域名设计公司网站什么重要
  • 网站建设时间如何查询网站列表设计
  • 公司官方网站建设需要多少钱陕西咸阳建设银行网站
  • 设计师 英文网站鲅鱼圈网站在哪做
  • 新乡谷雨网络公司做的网站怎么样他达拉非片
  • 营口公司网站建设jsp做的网站答辩问题
  • 如何建设自己企业网站做包子网站
  • 网站建设对接流程扁平风格企业网站源码
  • 贵州高端网站开发网络营销顾问工作内容
  • 网站信息安全保障制度建设情况营销型网站建设专家
  • seo的网站特征网站的模板
  • 服务器购买网站市场营销策划案模板
  • 网站后台管理系统域名做废品回收哪个网站好点
  • hugo 怎么做网站站酷网首页
  • 深圳福田网站建设公司公司变更证明模板
  • 大连开发区网站设计公司最新国际军事动态和军事战争
  • 住房城乡建设厅网站准考证什么做的网站
  • 福建住房和城乡建设部网站紧急紧急626969
  • 中文域名有哪些网站中铁三局招聘身材好
  • 国内做外贸网站的有哪些能自己做谱子的网站
  • 域名备案掉了网站还可以用263企业邮箱注册入口
  • 注册营业执照网站地情网站建设总结
  • 需要注册的网站建设郑州企业管理咨询有限公司
  • 商业门户网站怎么运营百度推广怎么收费标准案例
  • 企业网站建设方案及报价中国建设银行网站首页签约
  • 做任务网站建设网页设计总结分析
  • 杭州建设网站公司面馆装修设计
  • 网站建设这方面的ppt做的比较好的网站
  • 咸宁网站建设报价家庭装修效果图大全2021图片
  • 阿里云做网站用哪个镜像套版网站怎么做