-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: support for Service Discovery Across Multiple Nacos Clusters #10950
base: master
Are you sure you want to change the base?
Conversation
please fix the linter |
@monkeyDluffy6017 hello~ These errors seem to be unrelated to this PR. |
Could you add test cases to cover this? |
I will add test cases next week |
The ci problem has been fixed by #10959. Please merge latest master. |
CI is still failing |
|
@ShenFeng312 try using |
Co-authored-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Co-authored-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Co-authored-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Co-authored-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
@shreemaan-abhishek The 'others' field represents a list of additional Nacos configurations. Since the previous schema for Nacos configuration was an object, directly changing it to an array would render existing configurations incompatible. Therefore, I've utilized the 'others' field to extend this functionality. Of course, if we decide that backward compatibility is not necessary, we can redesign this configuration schema. Currently, my implementation involves adding a new layer of 'nacosName' within the original 'applications' map. This layer corresponds to different Nacos configurations. Additionally, the asynchronous tasks for fetching Nacos configurations have been modified from fetching from a single Nacos instance to fetching from multiple instances. They are organized into different maps based on the 'name' specified in the configuration. |
please pay attention here: #10950 (comment) |
fixed |
can you also mention that https://apisix.apache.org/docs/apisix/plugins/kafka-logger/#attributes |
Yes |
I think this line is enough: 6d2dcc2?diff=split&w=0#diff-8d872babc717e9d733641b56bfc530ef98751fbe4e68f08d79b2b83109c22fffR302 And it think it's better if the comment says: "deprecated, use nacos.hosts instead" |
local query_path = instance_list_path .. service_info.service_name | ||
.. token_param .. namespace_param .. group_name_param | ||
.. signature_param | ||
.. token_param .. namespace_param .. group_name_param |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are many other whitespace changes like this, please revert them
@@ -405,12 +434,17 @@ function _M.init_worker() | |||
return | |||
end | |||
|
|||
default_weight = local_conf.discovery.nacos.weight | |||
log.info('default_weight:', default_weight) | |||
--default_weight = local_conf.discovery.nacos.weight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because default_weight
in different nacos may different @shreemaan-abhishek
local fetch_interval = local_conf.discovery.nacos.fetch_interval | ||
log.info('fetch_interval:', fetch_interval) | ||
access_key = local_conf.discovery.nacos.access_key | ||
secret_key = local_conf.discovery.nacos.secret_key | ||
--access_key = local_conf.discovery.nacos.access_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because access_key
and secret_key
in different nacos may different @shreemaan-abhishek
@@ -109,6 +109,7 @@ services: | |||
- consul.cluster | |||
|
|||
## Nacos cluster | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is not needed
host: | ||
- "http://192.168.33.1:8848" | ||
hosts: | ||
- host: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem the right way. I think the following is better:
nacos:
hosts:
- xyz
- abc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean to configure it like this?
hosts:
name1:
- host:
- xxx
name2:
- host:
- xxx
@shreemaan-abhishek we may need config different access_key in different nacos
Co-authored-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Description
Fixes #10799
Checklist