Spring cloud 使用Spring Cloud Netflix自动复制微服务
我有多个Spring云微服务。我希望在microservice无法完成其工作时自动复制microservice。 我试图找到任何解决方案,但只找到了以下内容:。这个解决方案不能应用于我的问题,因为它只描述了当我们有一定数量的微服务时的情况 如果你给我举一些例子来帮助我解决这个问题,我将非常感激 更新:我有几项微服务 尤里卡:Spring cloud 使用Spring Cloud Netflix自动复制微服务,spring-cloud,microservices,spring-cloud-netflix,netflix-ribbon,Spring Cloud,Microservices,Spring Cloud Netflix,Netflix Ribbon,我有多个Spring云微服务。我希望在microservice无法完成其工作时自动复制microservice。 我试图找到任何解决方案,但只找到了以下内容:。这个解决方案不能应用于我的问题,因为它只描述了当我们有一定数量的微服务时的情况 如果你给我举一些例子来帮助我解决这个问题,我将非常感激 更新:我有几项微服务 尤里卡: @SpringBootApplication @EnableEurekaServer public class EurekaApplication { publ
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args){
SpringApplication.run(EurekaApplication.class, args);
}
}
网关应用程序:
@EnableZuulProxy
@EnableEurekaClient
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
public class FirstSubsystemApplication implements CommandLineRunner{
public static void main(String[] args) {
SpringApplication.run(FirstSubsystemApplication.class);
}
@Override
public void run(String... args) throws Exception {
}
}
FirstSybSystem应用程序:
@EnableZuulProxy
@EnableEurekaClient
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
public class FirstSubsystemApplication implements CommandLineRunner{
public static void main(String[] args) {
SpringApplication.run(FirstSubsystemApplication.class);
}
@Override
public void run(String... args) throws Exception {
}
}
我想对FirstSubsystemApplication进行高负载,并自动启动其副本 你在哪里运行你的微服务?您是否使用Cloud Foundry或其他PaaS之类的工具?我们说的是缩放吗?我用尤里卡,祖尔,伪装。每个微服务工作都在tomcat上(将来它将在Docker中工作)。我是微服务的新手:-)Spring Cloud Netflix可以在实例之间实现负载平衡,但您需要像Cloud Foundry、Kubernetes、AWS、GCE或Azure这样的平台来扩展(复制)实例。你的问题不清楚你在问什么。我要求的是微服务的复制,而不是服务器节点的复制(如果你提到“实例”是指服务器节点,正如我所理解的)。我不认为我需要这样一个平台。事实上,我被这么多的技术弄糊涂了。有关于它的手册吗?我想了解我应该使用什么。我添加了我的简单代码作为我使用的示例。