These are chat archives for spring-cloud/spring-cloud

12th
Jul 2016
Spencer Gibb
@spencergibb
Jul 12 2016 00:34
probably
Włodzimierz Rożkow
@rozhok
Jul 12 2016 09:24

does anyone noticed that eureka registration is performs before app init?

2016-07-12 09:20:21.651  INFO 1 --- [           main] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2016-07-12 09:20:23.600  INFO 1 --- [           main] c.n.e.EurekaDiscoveryClientConfiguration : Registering application portal-backend with eureka with status UP
[org.springframework.boot:type=Endpoint,name=configurationPropertiesReportEndpoint]
[org.springframework.boot:type=Endpoint,name=archaiusEndpoint]
2016-07-12 09:20:24.111  INFO 1 --- [           main] b.c.e.u.UndertowEmbeddedServletContainer : Undertow started on port(s) 19841 (http)
2016-07-12 09:20:24.117  INFO 1 --- [           main] c.n.e.EurekaDiscoveryClientConfiguration : Updating port to 19841
2016-07-12 09:20:24.128  INFO 1 --- [           main] co.cococo.portal.PortalApplication      : Started PortalApplication in 49.726 seconds (JVM running for 68.725)
2016-07-12 09:21:13.136 DEBUG 1 --- [  XNIO-2 task-1] c.m.p.configuration.CustomPathFilter     : Initializing filter 'customPathFilter'
2016-07-12 09:21:13.137 DEBUG 1 --- [  XNIO-2 task-1] c.m.p.configuration.CustomPathFilter     : Filter 'customPathFilter' configured successfully
2016-07-12 09:21:13.144  INFO 1 --- [  XNIO-2 task-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization started
2016-07-12 09:21:13.178  INFO 1 --- [  XNIO-2 task-1] o.s.web.servlet.DispatcherServlet        : FrameworkServlet 'dispatcherServlet': initialization completed in 34 ms

I'm getting a little downtime period when Client is registered on Eureka but app is not initialized

Fabian Wallwitz
@cforce
Jul 12 2016 09:27
@spencergibb @dsyer
Is it true your Team is working on making spring cloud services available on marketplace of PWS and pcfdev?
Dave Syer
@dsyer
Jul 12 2016 10:39
It's already available
It's a different team at Pivotal though
On PWS I think it's only available to whitelisted orgs
For PCF you just download a tile
@rozhok is it trying to locate the configserver using eureka?
Włodzimierz Rożkow
@rozhok
Jul 12 2016 10:41
no
there is other services trying to communicate with this one
because it registered
but they receive errors
until spring boot app will be fully initialized
Dave Syer
@dsyer
Jul 12 2016 10:42
There is a race condition for sure.
what version of s-c-netflix are you using?
and do you have s-c-context on the classpath (that changes the registration behaviour)
and are you using server.port=0?
Włodzimierz Rożkow
@rozhok
Jul 12 2016 10:56
1.1.3.RELEASE
I don't have a sprint-cloud-context artifact in classpath
I use strict port
Dave Syer
@dsyer
Jul 12 2016 10:58
I think with a fixed port (if that's what you mean) the behaviour is fairly well defined
There might still be a race
But you'd have to be pretty unlucky for the registration to reach the dependent services before this one is ready. I don't think we see this in the wild much.
Maybe something else is slowing down your server start up?
Włodzimierz Rożkow
@rozhok
Jul 12 2016 10:59
there is a lot of "registering jmx stuff" in between
Dave Syer
@dsyer
Jul 12 2016 11:00
Does it take more than 30secs?
From your logs it looks like about 0.5 sec between registration and the server reporting it is listening
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:01
yes
Dave Syer
@dsyer
Jul 12 2016 11:01
That's not really enough to be a problem.
(I would have thought)
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:02
seems that we have servlet filter I'm not awared about...
will check and get back
Dave Syer
@dsyer
Jul 12 2016 11:04
The server is started after the client registers. That might be something we can change (I'm not sure).
But it's not usually a problem
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:06
I'm doing blue/green deployment and it's problem when we have some sequence of requests
I've tuned ribbon timeouts/retries a bit, but there is still small percentage of failures
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:25
is there way to register eureka oh herselft as application? I want to add healthCheck page and I want to include it's logic into eureka server
Dave Syer
@dsyer
Jul 12 2016 11:29
eureka.client.healthcheck.enabled=true maybe?
"eureka oh herself" I didn't understand
We are quite interested in your experience of trying to do zero downtime. I'm not sure "blue-green" really describes what most people do with Eureka.
@ryanjbaxter is collecting use cases
Maybe you two could compare notes
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:36
eureka.client.healthcheck.enabled=true what is this for? I have a bunch of services registered on eureka, half of them is vital for app, half is not.
I'd like to create endpoint which will check
  1. Is all vital services up and registered on eureka
  2. Is non-vital services up and registered on eureka
    depends of results I'd like to return red, yellow and green codes in response

We are quite interested in your experience of trying to do zero downtime.

It's not related to eureka, btw, I'm doing following stuff:

  1. Someone pushes to repo
  2. I ask AWS to spin up additional instance
  3. I deploy new verstion of app to new instance
  4. I wait until it becomes deployed
  5. I replace rest of instances one by one
Despite I've tuned timouts, there is a still little downtime which I'm not sure coming is
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:42
I need whole app health check url for NewRelic app
I have Zuul proxy as an entry point
so I want to configure /health endpoint but it should point to eureka
Włodzimierz Rożkow
@rozhok
Jul 12 2016 11:51
I think I'll just configure it like
zuul:
  routes:
    users:
      path: /health
      url: http://{eureka_ip}/health
Dave Syer
@dsyer
Jul 12 2016 11:55
That makes sense to me (the health check).
But that is the health of the eureka server, not the zuul proxy
Is that what you need?
Włodzimierz Rożkow
@rozhok
Jul 12 2016 12:00
No, I need to check, like, that everyone is registered on Eureka
and provide binary/trinary response for it
Włodzimierz Rożkow
@rozhok
Jul 12 2016 12:27
nailed it
Dave Syer
@dsyer
Jul 12 2016 12:49
Do tell
Włodzimierz Rożkow
@rozhok
Jul 12 2016 12:55
nope
didn't nailed
perhaps because of AWS ENI connectivity issues
Ribbon just tells me that "not instances of service available"
Włodzimierz Rożkow
@rozhok
Jul 12 2016 13:04
well
I think I'll move healthcheck endpoint to some other service, not to the eureka itself
bitsofinfo
@bitsofinfo
Jul 12 2016 14:25
anyone have any thoughts on how to get this to work? Trying placing the class manually, still to no avail. https://github.com/spring-cloud/spring-cloud-netflix/issues/1057#issuecomment-232063555
bitsofinfo
@bitsofinfo
Jul 12 2016 14:55
For now I'm just creating a replacement org.apache.http.conn.ssl.BrowserCompatHostnameVerifier that does nothing, which thankfully seems to solve a lot of these issues until they can just be fixed/supported. (i.e. adequate customization of the HostnameVerifiers used for many of these underlying libs that use apaches SSLSocketFactory)
bitsofinfo
@bitsofinfo
Jul 12 2016 15:07
I am just trying to run a spring-cloud based backend where all of my services (including discovery, config server) all present a shared self-signed SSl cert, that is trusted in all jvm's cacerts of all my other consumer services.
Dave Syer
@dsyer
Jul 12 2016 15:23
If it's a global setting for the http client I don't think it has any bearing on Spring Cloud
You just need to configure the socket factory before it is used
bitsofinfo
@bitsofinfo
Jul 12 2016 15:26
thats the thing, is that in several places its not and there is no way to customize the hostname verifier
my solution is a total hack, but the only way I can permit my CN's, then defer to the normal BrowserCompat code to enforce normal rules.
JonathanAaron
@JonathanAaron
Jul 12 2016 15:51
When connecting a client to config server, the service I run after zuul comes up with a warning: No instances found of configserver (config-server) then fetches a config from server localhost:8888. My config server is on 8001. The services I start up after that finds the config server at 8001. Do you guys know where the eureka client is coming up with 8888?
Dave Syer
@dsyer
Jul 12 2016 15:54
That's just the default port for the config server
So I guess you didn't ask eureka?
Or you asked it and it wasn't available and you didn't ask to fail fast
JonathanAaron
@JonathanAaron
Jul 12 2016 15:54
I see. Thanks Dave!
Ivan
@ismorodin
Jul 12 2016 19:51
How to configure Zuul Routes with service Id + path ?
Marcos Barbero
@marcosbarbero
Jul 12 2016 19:54
What you mean by serviceId + path?
This configuration doesn’t fit your use case?
zuul.routes:
  the-service-id:
    serviceId: the-service-id
    path: /the-service-path/**
Ivan
@ismorodin
Jul 12 2016 20:05
No! I want
zuul.routes:
  the-service-id:
    serviceId: the-service-id/v1/tickets
    path: /tickets/**
Spencer Gibb
@spencergibb
Jul 12 2016 20:06
that’s not currently supported
Ivan
@ismorodin
Jul 12 2016 20:07
@spencergibb too bad!
Marcos Barbero
@marcosbarbero
Jul 12 2016 20:08
Maybe writing your own ZuulFilterwill do the trick
Spencer Gibb
@spencergibb
Jul 12 2016 20:08
I think there is an open issue
absolutely could write a custom filter
Ivan
@ismorodin
Jul 12 2016 20:10
i think it's good idea! Do you have the approximate examples?
Ivan
@ismorodin
Jul 12 2016 20:15
@spencergibb Ок, i will trying do it! Thanks!
Spencer Gibb
@spencergibb
Jul 12 2016 20:15
we love pull requests
Marcos Barbero
@marcosbarbero
Jul 12 2016 20:44
@spencergibb what about a rate limit module for zuul? Something like that, I know there was an open PR into spring-cloud-netflix but I don’t know it’s status. Anyhow, I did my own implementation using redis, if it is welcome I can work on a proper solution with InMemory implementation and unit tests.
Spencer Gibb
@spencergibb
Jul 12 2016 20:44
the PR also uses redis
Marcos Barbero
@marcosbarbero
Jul 12 2016 20:45
Yeah, I saw that… but in my own tests it was not working fine, I’ve to remember what was wrong, but something was not properly done