Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to retrieve instances from any remote region #29

Closed
NiteshKant opened this issue Jul 17, 2013 · 0 comments
Closed

Add ability to retrieve instances from any remote region #29

NiteshKant opened this issue Jul 17, 2013 · 0 comments
Assignees

Comments

@NiteshKant
Copy link
Contributor

Currently eureka provides a way to get registry information from a remote aws region.
However, the behavior of this is not controllable by the user.
The instances from the remote region is added to the local registry only if the application, the instance belongs to, is not already available locally.

This change should allow users to retrieve instances for a specific region (via the eureka client).

The following setup would be required to achieve this:

Eureka Server

  1. The eureka server which will get data from a remote region must create a property: eureka.remoteRegionUrlsWithName with the content as key value pairs separated by a comma. The key is the name of the region and value is the http(s) url to the eureka server in the remote region. This will deprecate the existing property: eureka.remoteRegionUrls which does not have any insight into which region the URL belongs to.
  2. Optionally provide a whitelist of applications, per region (or global) which will restrict only a certain set of applications to be retrieved from a remote region. The retrieval here is referred to as the API view of the remote registry. The server internally will fetch the entire remote registry. The whitelist follows the property name: eureka.remoteRegion.[region_name].appWhiteList, where [region_name] can either be the string "global" or the name of the region (must match with what is provided in 1 above). The value is a comma separated list of app names. The global list is only consulted when there is no whitelist for the specific region. In absence of any whitelist all instances from the remote region will be retrieved.

Client

  1. Define a property: eureka.fetchRemoteRegionsRegistry with the value as comma separated list of regions from which this client should fetch the registry information. This obviously requires that the server actually is pulling data from those regions.
  2. For each remote region that the client need to fetch, define a property: "eureka.[region_name].availabilityZones" containing a comma separated list of all availability zones in the region. This is to reverse map, the availability zones (available as instance metadata) in eureka server registry response. Since, this mapping is static, it adds little value to add the extra parameter region in all the instance information. We can possibly infer this from availability zone, i.e. us-west-1c is in region us-west-1 but this is more or less to externalize this logic rather than bake in the code.
  3. Use the methods in DiscoveryClient to get instances for a specific region. In absence of a region, the client will fetch instances from the local region only.

Caveat

If the client choose this mode of fetching instances, it can not go back to the previous way of getting remote region instances i.e. only applications that are not available locally will be fetched from remote region without the client knowing about it.

@ghost ghost assigned NiteshKant Jul 17, 2013
NiteshKant added a commit to NiteshKant/eureka that referenced this issue Jul 17, 2013
Merge branch 'master' of https://github.com/Netflix/eureka

Conflicts:
	eureka-core/src/main/java/com/netflix/eureka/resources/ResponseCache.java
	gradle.properties
	gradle/release.gradle
NiteshKant added a commit to NiteshKant/eureka that referenced this issue Jul 22, 2013
Merge branch 'master' of https://github.com/Netflix/eureka

Conflicts:
	eureka-core/src/main/java/com/netflix/eureka/resources/ResponseCache.java
	gradle.properties
	gradle/release.gradle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant