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

[Umbrella] Support service discovery through etcd #1392

Closed
3 tasks done
hddong opened this issue Nov 16, 2021 · 7 comments
Closed
3 tasks done

[Umbrella] Support service discovery through etcd #1392

hddong opened this issue Nov 16, 2021 · 7 comments

Comments

@hddong
Copy link
Contributor

hddong commented Nov 16, 2021

Code of Conduct

Search before asking

  • 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

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@pan3793
Copy link
Member

pan3793 commented Nov 17, 2021

Would you please describe your plan in more detail?

@hddong
Copy link
Contributor Author

hddong commented Nov 19, 2021

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
Copy link
Contributor Author

hddong commented Nov 19, 2021

cc @pan3793 @yaooqinn @ulysses-you

@yaooqinn
Copy link
Member

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

@hddong
Copy link
Contributor Author

hddong commented Nov 19, 2021

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

Sure.

@charlesy6
Copy link
Contributor

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?

@hddong
Copy link
Contributor Author

hddong commented Nov 22, 2021

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.

yaooqinn pushed a commit that referenced this issue Dec 6, 2021
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
Decouple zookeeper #1392

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1506 from hddong/move-serviceNodeInfo.

Closes #1505

7bd7f18 [hongdongdong] [KYUUBI #1505] Move ServiceNodeInfo to a separate file

Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
Signed-off-by: Kent Yao <yao@apache.org>
@pan3793 pan3793 closed this as completed Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants