Closed minhvc closed 6 years ago
@minhvc Thanks for your interest in this project.
The config seems good! Have you register it in your Startup class?
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddDiscoveryClient(Configuration);
services.AddMvc();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseDiscoveryClient();
app.UseMvc();
}
}
yes, I use APIServiceAA of you at the article https://www.c-sharpcorner.com/article/building-api-gateway-using-ocelot-in-asp-net-core-service-discoveryeureka/
Thank for your respronse, now microservice connected successfully to eureka server. but "Lease expiration enabled" always is false and when micro service is down (die or shut down) the instances currently registered is not refresh my eureka server setting:
spring.application.name=service-registry
server.port=8761
#server.address= 192.168.1.88
eureka.instance.hostname=192.168.1.88
eureka.instance.ip-address= 192.168.1.88
#eureka.server.enable-self-preservation= false
eureka.server.eviction-interval-timer-in-ms=1000
eureka.server.renewal-percent-threshold = 0.0
eureka.instance.lease-expiration-duration-in-seconds = 5
eureka.client.register-with-eureka=true
eureka.client.fetch-registry= false
eureka.client.service-url.defaultZone=http://192.168.1.88:8761/eureka/
eureka.client.initial-instance-info-replication-interval-seconds=5
Can you share your eureka server configuration? Help me please, thanks
Here is the configuration
server:
port: 8761
eureka:
client:
registerWithEureka: false
fetchRegistry: false
server:
waitTimeInMsWhenSyncEmpty: 0
You can follow this repo spring-cloud-samples/eureka
I use this code to run a eureka server. https://github.com/spring-guides/gs-service-registration-and-discovery The java eureka client connects successfully to the eureka server. But not .Net Services shows on Server Dashboard my service config:
How can I fix it? Thanks