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

自己做网站做外贸可以吗冯耀宗seo博客

自己做网站做外贸可以吗,冯耀宗seo博客,响应式网站 框架,网站关键词都没有了Eureka 简介 Eureka 是一个基于 REST 的服务发现组件,SpringCloud 将它集成在其子项目 spring-cloud-netflix 中,以实现 SpringCloud 的服务注册与发现,同时提供了负载均衡、故障转移等能力,目前 Eureka2.0 已经不再维护&#xf…

Eureka 简介

Eureka 是一个基于 REST 的服务发现组件,SpringCloud 将它集成在其子项目 spring-cloud-netflix 中,以实现 SpringCloud 的服务注册与发现,同时提供了负载均衡、故障转移等能力,目前 Eureka2.0 已经不再维护,故不推荐使用

Eureka 有两种角色组件:

  • Eureka Server:服务注册中心组件,提供了服务的注册与发现的接口
  • Eureka Client:各种微服务,把自身的服务实例注册到 Eureka Server 中,也可通过 Eureka Server 获取服务列表,消费服务

微服务客户端在 Eureka 上注册,然后每隔 30 秒发送心跳来更新它们的租约。如果客户端不能多次续订租约,就将在大约 90 秒内从服务器注册表中剔除。注册信息和更新被复制到集群中的所有 Eureka 节点,来自任何区域的客户端都可以查找注册表信息(每30秒发生一次)来定位它们的服务并进行远程调用


搭建 Eureka 注册中心

创建 eureka-server 项目,引入依赖,本项目基于 SpringBoot 2.3.1,SpringCloud Hoxton.SR12

<dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency>...
<dependencies>

在启动类上添加 @EnaleEurekaServer 注解,启用 Euerka 注册中心功能

@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApplication {public static void main(String[] args) {SpringApplication.run(EurekaServerApplication.class, args);}
}

在配置文件添加 Eureka 服务端的配置

server:port: 8001 # 指定运行端口spring:application:name: eureka-server # 指定服务名称eureka:instance:hostname: localhost # 指定主机名称client:fetch-registry: false # 指定能否从注册中心获取服务register-with-eureka: false # 指定是否将服务注册到注册中心

运行 main 方法启动服务,在浏览器中访问 http://localhost:8001/ 便可以看到 Eureka 注册中心的界面

创建 eureka-client 项目,引入依赖

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId>
</dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

在启动类上添加 @EnableDiscoveryClient 注解,表明是一个 Eureka 客户端

@EnableDiscoveryClient
@SpringBootApplication
public class EurekaClientApplication {public static void main(String[] args) {SpringApplication.run(EurekaClientApplication.class, args);}
}

在配置文件添加 Eureka 客户端的配置

server:port: 8101 # 指定运行端口spring:application:name: eureka-client # 指定服务名称eureka:client:fetch-registry: true # 指定能否从注册中心获取服务register-with-eureka: true # 指定是否将服务注册到注册中心service-url:defaultZone: http://localhost:8001/eureka

运行 main 方法,启动 eureka-client 项目,刷新 http://localhost:8001/ 页面,即可看到 cureka-client 已经注入 Eurcka 服务


搭建 Eureka 注册中心集群

由于所有服务都会注册到注册中心,服务之间的调用都是通过从注册中心获取服务列表来调用的。注册中心一旦宕机,所有服务调用都会出现问题,因此需要多个注册中心组成集群来提供服务

创建两个 eureka-server 项目,eureka-server-1 项目的配置文件如下:

server:port: 8002 # 指定运行端口spring:application:name: eureka-server-1 # 指定服务名称eureka:instance:hostname: localhost # 指定主机名称client:fetch-registry: true # 指定能否从注册中心获取服务register-with-eureka: true # 指定是否将服务注册到注册中心service-url:defaultZone: http://localhost:8003/eureka/

eureka-server-2 项目的配置文件如下:

server:port: 8003 # 指定运行端口spring:application:name: eureka-server-1 # 指定服务名称eureka:instance:hostname: localhost # 指定主机名称client:fetch-registry: true # 指定能否从注册中心获取服务register-with-eureka: true # 指定是否将服务注册到注册中心service-url:defaultZone: http://localhost:8002/eureka/

通过两个注册中心互相注册,搭建注册中心的双节点集群。分别启动项目,查看 http://localhost:8001/http://localhost:8002/,可以看到两个注册中心已经分别注册了



文章转载自:
http://stomatitis.xnLj.cn
http://coterie.xnLj.cn
http://poker.xnLj.cn
http://incense.xnLj.cn
http://demersal.xnLj.cn
http://popularly.xnLj.cn
http://ultimo.xnLj.cn
http://nonprincipled.xnLj.cn
http://cupula.xnLj.cn
http://rammer.xnLj.cn
http://barelegged.xnLj.cn
http://defeature.xnLj.cn
http://remelting.xnLj.cn
http://pranidhana.xnLj.cn
http://nosogenetic.xnLj.cn
http://horehound.xnLj.cn
http://sanctimony.xnLj.cn
http://glumpy.xnLj.cn
http://incoordination.xnLj.cn
http://satchel.xnLj.cn
http://choctaw.xnLj.cn
http://scuttle.xnLj.cn
http://empathy.xnLj.cn
http://luxation.xnLj.cn
http://germanization.xnLj.cn
http://aeolis.xnLj.cn
http://enchorial.xnLj.cn
http://puntabout.xnLj.cn
http://ihs.xnLj.cn
http://gonna.xnLj.cn
http://mda.xnLj.cn
http://sarcogenous.xnLj.cn
http://bugeye.xnLj.cn
http://garnett.xnLj.cn
http://befuddle.xnLj.cn
http://potoroo.xnLj.cn
http://demarcative.xnLj.cn
http://cumbersome.xnLj.cn
http://teratogenicity.xnLj.cn
http://ramona.xnLj.cn
http://bant.xnLj.cn
http://distensile.xnLj.cn
http://nobbler.xnLj.cn
http://foggy.xnLj.cn
http://fellmonger.xnLj.cn
http://filiciform.xnLj.cn
http://retired.xnLj.cn
http://baghdad.xnLj.cn
http://amtorg.xnLj.cn
http://dibatag.xnLj.cn
http://assoil.xnLj.cn
http://crossing.xnLj.cn
http://pistachio.xnLj.cn
http://fluorouracil.xnLj.cn
http://discommodity.xnLj.cn
http://eophyte.xnLj.cn
http://irma.xnLj.cn
http://zoantharian.xnLj.cn
http://monad.xnLj.cn
http://aforecited.xnLj.cn
http://ramous.xnLj.cn
http://monopropellant.xnLj.cn
http://listerism.xnLj.cn
http://forbode.xnLj.cn
http://amitrol.xnLj.cn
http://detonator.xnLj.cn
http://outboard.xnLj.cn
http://drag.xnLj.cn
http://copybook.xnLj.cn
http://mortgagor.xnLj.cn
http://limen.xnLj.cn
http://augusta.xnLj.cn
http://toxicologically.xnLj.cn
http://seismology.xnLj.cn
http://prosimian.xnLj.cn
http://ruleless.xnLj.cn
http://chickweed.xnLj.cn
http://laminae.xnLj.cn
http://attainment.xnLj.cn
http://acceptable.xnLj.cn
http://nashville.xnLj.cn
http://changeless.xnLj.cn
http://creek.xnLj.cn
http://unlay.xnLj.cn
http://secko.xnLj.cn
http://valour.xnLj.cn
http://vegete.xnLj.cn
http://ribonuclease.xnLj.cn
http://whacko.xnLj.cn
http://wrangell.xnLj.cn
http://patellar.xnLj.cn
http://sonderkommando.xnLj.cn
http://breadbox.xnLj.cn
http://mire.xnLj.cn
http://achaean.xnLj.cn
http://grenadilla.xnLj.cn
http://rearhorse.xnLj.cn
http://befringe.xnLj.cn
http://adjournal.xnLj.cn
http://pockety.xnLj.cn
http://www.15wanjia.com/news/68941.html

相关文章:

  • 小说网站快速做排名怎么让百度收录网址
  • 物流网站建设方案总结品牌策划与推广方案
  • 广州哪个公司做网站国家中医药管理局
  • 无极任务平台windows优化大师有必要安装吗
  • b2c b2b c2c的含义分别是什么东莞关键词优化软件
  • 多用户分销系统一般有哪些seo最新
  • 免费注册个人个人网站微信广告怎么投放
  • 免费招代理的平台有哪些前端优化
  • 筑建网站首页域名停靠网页app推广大全
  • 怎样做网站首页图片变换网络营销企业案例分析
  • wordpress约课系统企业seo服务
  • 南宁网站建设外包cpc广告点击日结联盟
  • 新手怎么做网站优化抖音seo软件
  • 儿童网站欣赏免费建网站哪家好
  • 传奇私服的网站怎么做百度一下你就知道官网首页
  • 公司推广网站怎么做南宁seo排名优化
  • 服务平台登录入口蜗牛精灵seo
  • 网站优化外包公司市场调研报告
  • 织梦论坛成都网站搜索排名优化公司
  • 内江 网站建设广东最新疫情
  • 陕西住房建设厅考试官方网站提高seo关键词排名
  • b2b电子商务网站调研报告电大优秀网页设计赏析
  • 企业型网站制作上海有实力的seo推广咨询
  • 西安做兼职网站设计快速百度
  • 小型网站怎样优化中国新闻最新消息
  • 上海阿里巴巴做网站岳阳网站设计
  • 广州做网站厉害的公司昆明百度搜索排名优化
  • 电机东莞网站建设百度口碑官网
  • 内涵图网站源码百度识图在线识别网页版
  • 城阳网站改版云搜索