[Umbrella] Support service discovery through etcd
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Search before asking
- [X] I have searched in the issues and found no similar issues.
Describe the proposal
On k8s, if we not had a zk yeet, we can use the existing etcd for service discovery.
Task list
- #1404
- #1505
- #2631
- #2644
- #3104
- #3141
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
Would you please describe your plan in more detail?
Sure.
The modules:
kyuubi-ha
- kyuubi-ha-common
- kyuubi-ha-zookeeper
- kyuubi-ha-etcd
Implementation
There are mainly two classes, ServiceDiscovery and ZooKeeperClientProvider, for other modules to use.
-
ServiceDiscovery
-
use a new class
AbstractInstanceClientinstead ofzkClient
-
Move static functions in
ServiceDiscoverytoDiscoveryClient
DiscoveryClientcontains discovery api( E.gcreateServiceNodeAndGetPath,getServiceNodesInfo) and client api (E.ggetChildren,delete).
-
ZooKeeperClientProviderAbstract asDiscoveryClientProvider
Usages
In other modules, original:
withZkClient(conf) { framework =>
createServiceNodeAndGetPath(conf, framework, uniqueNamespace, "localhost:10000")
framework.delete().forPath(nodePath)
}
we can change to:
withDiscoveryClient(conf) { framework =>
framework.createServiceNodeAndGetPath(conf, uniqueNamespace, "localhost:10000")
framework.delete(nodePath)
}
cc @pan3793 @yaooqinn @ulysses-you
look good to me, can these be put in the same module?
look good to me, can these be put in the same module?
Sure.
hi, it seems we still need zookeeper cluster, we expose kyuubi server to zookeeper, hive client can connect to server by zookeeper. how the hive client use etcd?
hi, it seems we still need zookeeper cluster, we expose ...how the hive client use etcd?
Yes, it does not support server discovery by default. Maybe we have two solutions: zetcd(It hasn't been updated for a while), or we can provide a client or jar support etcd. And, on kubernetes, may be one server is acceptable.