kyuubi icon indicating copy to clipboard operation
kyuubi copied to clipboard

[Umbrella] Support service discovery through etcd

Open hddong opened this issue 4 years ago • 7 comments

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!

hddong avatar Nov 16 '21 01:11 hddong

Would you please describe your plan in more detail?

pan3793 avatar Nov 17 '21 11:11 pan3793

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.

  1. ServiceDiscovery
  • use a new class AbstractInstanceClient instead of zkClient image

  • Move static functions in ServiceDiscovery to DiscoveryClient image DiscoveryClient contains discovery api( E.g createServiceNodeAndGetPath, getServiceNodesInfo) and client api (E.g getChildren, delete).

  1. ZooKeeperClientProvider Abstract as DiscoveryClientProvider image

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)
}

hddong avatar Nov 19 '21 01:11 hddong

cc @pan3793 @yaooqinn @ulysses-you

hddong avatar Nov 19 '21 01:11 hddong

look good to me, can these be put in the same module?

yaooqinn avatar Nov 19 '21 02:11 yaooqinn

look good to me, can these be put in the same module?

Sure.

hddong avatar Nov 19 '21 02:11 hddong

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?

charlesy6 avatar Nov 22 '21 03:11 charlesy6

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.

hddong avatar Nov 22 '21 12:11 hddong