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

Integrate third-party CMDB to utilize the labels in CMDB for service discovery #187

Closed
yangyshdan opened this issue Oct 30, 2018 · 2 comments
Assignees
Milestone

Comments

@yangyshdan
Copy link
Collaborator

yangyshdan commented Oct 30, 2018

There is a scenario that for Nacos's naming search service, one single domainname may have different IPs that come from multiple datacenters. When one single client requests domianname's associated IPs from Nacos, Nacos logic could be only return the IPs that are in the same datacenter where the client server locates.

The above scenario can be achieved by Nacos with the implementation of Label. Several notes:

  1. Nacos should provides an API that can associate the IP/hostname with different labels. The labels could be datacenter, region, application, or whatever that could be used for describe an IP.
  2. Rule could be applied to Nacos to specify the rules about how to filter the result of the IPs for naming request. For example: for source IP of the naming search request with certain label, return the IP with the same label. (label could represent datacenter, region, etc).

API Reference for associate the IP/hostname with labels:

  • API URL: /nacos/v1/ns/applyHostLabel
  • Input Parameter:
    - String: IP
    - String: hostname
    - Hashmap<String, String>: labels

API Reference for hosts filtering, only target hosts matches certain label key/value that is from the client host should be returned.

  • API URL: /nacos/v1/ns/applyNamingResultFiltering
  • Input Parameter:
    - String: Domainname
    - Hashmap: labels (Note, label value could be *, which means matching any values)

A callback URL should be added in case target servers are occasionally online and offline, so that Nacos server can call callback to reflect the changes. For example, if certain IP is not marked with Label when requested, an async call should be called with the callback URL to fetch the labels.

Definition of Callback

  • Input Parameter:
    • String: URL
      The return should be fixed format, such as
    • String: Hashmap<String, String>: labels
@nanamikon
Copy link
Contributor

nanamikon commented Oct 30, 2018

A good feature! What's more, we have to query cmdb for lables when registe a new instance, it's better to add a paramter for callback url when registering a new instance as follow

Definition of Callback

  • Input Parameter:
    - String: IP

  • Return :
    - String: Hashmap<String, String>: labels

Nacos server can get labels from the callback url , and then registe the instance with the labels

@yangyshdan
Copy link
Collaborator Author

A good feature! What's more, we have to query cmdb for lables when registe a new instance, it's better to add a paramter for callback url when registering a new instance as follow

Definition of Callback

  • Input Parameter:
    • String: IP
  • Return :
    • String: Hashmap<String, String>: labels

Nacos server can get labels from the callback url , and then registe the instance with the labels

Original proposal has been update to reflect this idea.

nkorange added a commit that referenced this issue Dec 5, 2018
nkorange added a commit that referenced this issue Dec 6, 2018
nkorange added a commit that referenced this issue Dec 7, 2018
nkorange added a commit that referenced this issue Dec 10, 2018
@nkorange nkorange added this to the 0.7.0 milestone Dec 13, 2018
nkorange added a commit that referenced this issue Dec 13, 2018
nkorange added a commit that referenced this issue Dec 14, 2018
@nkorange nkorange changed the title Provide Label ability for Naming Service into NACOS for complex multi-DC scenario. Integrate third-party CMDB to utilize the labels in CMDB for service discovery Dec 17, 2018
ethonchen pushed a commit to ethonchen/nacos that referenced this issue Dec 17, 2018
* 'develop' of https://github.com/alibaba/nacos: (25 commits)
  Fix build error
  Update version
  Update version in banner.txt
  NPE protection
  Add plugin directory
  Disable CMDB by default
  Update default property
  Update version to 0.7.0
  alibaba#187 Fix bug
  Fix alibaba#461
  alibaba#187 Fix bug
  Update expression syntax
  Remove unused config
  Update version to 0.6.1
  Fixes alibaba#432
  Prepare for 0.6.1
  alibaba#429 Filter services by metadata
  alibaba#421 Fixed
  alibaba#187 Refactor some logic
  alibaba#187 Add Java docs
  ...
nkorange added a commit that referenced this issue Dec 18, 2018
nkorange added a commit that referenced this issue Dec 18, 2018
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

3 participants