Configuring serviceUrl.default and defaultZone

2,820 views
Skip to first unread message

daniel....@gmail.com

unread,
Jun 10, 2013, 7:26:15 PM6/10/13
to eureka_...@googlegroups.com
Hi,

I copied the SampleEurekaClient.java, eureka-client.props and eureka-client-test.props files to another project and could not get things to run. I found that the serviceUrls were null, leading to the error "No matches for the virtual host name :sampleservice.mydomain.net".
To compare, when I run the SampleEurekaClient from eureka/eureka-server/runservice.sh then the serviceUrl gets set correctly. This is because it's found in conf/sampleservice/sample-eureka-service.properties under the eureka.serviceUrl.default key.

For the Eureka Server Configuration section at https://github.com/Netflix/eureka/wiki/Running-the-Demo-Application it seems to imply that I'd be editing either eureka.serviceUrl.defaultZone or eureka.serviceUrl.default.defaultZone This is what I was editing, but that's not being read by default. DefaultEurekaClientConfig.getEurekaServerServiceUrls loads up
namespace + "serviceUrl." + "default"
if it can't read from
namespace + "serviceUrl." + myZone

So now I know how to correctly set these serviceUrls (I think) but I'm wondering what's the best way, and why there are these different properties?
What is the use of eureka.serviceUrl.default.defaultZone (unless I name my zone 'default.defaultZone')?
Why are there these properties in eureka-client.properties to set eureka.serviceUrl.*.defaultZone if there's a property eureka.region=default (not defaultZone)?

Karthikeyan Ranganathan

unread,
Jun 10, 2013, 7:36:54 PM6/10/13
to eureka_...@googlegroups.com
Good point - Actually the following property is not needed. It is just rendundant

eureka.serviceUrl.default.defaultZone=http://localhost/eureka/v2/
You should be okay just with 

eureka.serviceUrl.defaultZone=http://localhost/eureka/v2/


The idea behind this kind of property format is defined here. It is to support multiple zones for redundancy/failover to mitigate zonal failures.





--
You received this message because you are subscribed to the Google Groups "eureka_netflix" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eureka_netfli...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



daniel....@gmail.com

unread,
Jun 10, 2013, 7:59:26 PM6/10/13
to eureka_...@googlegroups.com
I see, thank you. I spent like 10 seconds looking at that page because I'm not going to use AWS. Now I understand.

However, eureka.serviceUrl.defaultZone=http://localhost/eureka/v2/ is not enough. I leave that blank and set eureka.serviceUrl.default=http://localhost/eureka/v2/ then it works. I'm not sure why myZone is not defaulting to 'defaultZone'

Still getting the "No matches for the virtual host name :sampleservice.mydomain.net" error, but that is surely a problem on my end.
Message has been deleted

daniel....@gmail.com

unread,
Jun 11, 2013, 1:28:26 PM6/11/13
to eureka_...@googlegroups.com, daniel....@gmail.com
The 'default' region must have a 'defaultZone' zone. I think it was conf/eureka-client-test.properties specifying eureka.us-east-1.availabilityZones=default that was tripping me up, because this property is not used at all, since the region is of course default, not us-east-1 and because conf/sampleservice/sample-eureka-service.properties specifies eureka.serviceUrl.default=http://localhost/eureka/v2/ which again will be unused.

suvojy...@gmail.com

unread,
Aug 3, 2016, 1:00:08 AM8/3/16
to eureka_netflix, daniel....@gmail.com

Is there any way to set "eureka.serviceUrl.default" at runtime?

Reply all
Reply to author
Forward
0 new messages