You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/06 14:26:17 UTC

[GitHub] [apisix] tzssangglass commented on a diff in pull request #6751: feat(zookeeper): support zookeeper service discovery

tzssangglass commented on code in PR #6751:
URL: https://github.com/apache/apisix/pull/6751#discussion_r844017888


##########
docs/en/latest/discovery/zookeeper.md:
##########
@@ -0,0 +1,144 @@
+---
+title: zookeeper
+---
+
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+-->
+
+## Service Discovery Via Zookeeper
+
+`Zookeeper` service discovery needs to rely on the [apisix-seed](https://github.com/api7/apisix-seed) project.
+
+### How `apisix-seed` Works
+
+![APISIX-SEED](../../../assets/images/apisix-seed.svg)
+
+`apisix-seed` completes data exchange by watching the changes of `etcd` and `zookeeper` at the same time.
+
+The process is as follows:
+
+1. `APISIX` registers an upstream and specifies the service discovery type as `zookeeper` to `etcd`.
+2. `apisix-seed` watches the resource changes of `APISIX` in `etcd` and filters the discovery type and obtains the service name.
+3. `apisix-seed` binds the service to the `etcd` resource and starts watching the service in zookeeper.
+4. The client registers the service with `zookeeper`.
+5. `apisix-seed` gets the service changes in `zookeeper`.
+6. `apisix-seed` queries the bound `etcd` resource information through the service name, and writes the updated service node to `etcd`.
+7. The `APISIX` worker watches `etcd` changes and refreshes the service node information to the memory.
+
+### Setting `apisix-seed` and Zookeeper
+
+The configuration steps are as follows:
+
+1. Start the Zookeeper service
+
+```bash
+docker run -itd --rm --name=dev-zookeeper -p 2181:2181 zookeeper:3.7.0
+```
+
+2. Download and compile the `apisix-seed` project.
+
+```bash
+git clone https://github.com/api7/apisix-seed.git
+cd apisix-seed
+go build
+```
+
+3. Modify the `apisix-seed` configuration file, config path `conf/conf.yaml`.

Review Comment:
   Modify the `apisix` configuration file?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org