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 2021/09/09 06:30:43 UTC

[GitHub] [apisix] Singularity0909 opened a new pull request #5023: docs: add Chinese doc for discovery DNS method

Singularity0909 opened a new pull request #5023:
URL: https://github.com/apache/apisix/pull/5023


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


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



[GitHub] [apisix] Singularity0909 commented on a change in pull request #5023: docs: add Chinese doc for discovery DNS method

Posted by GitBox <gi...@apache.org>.
Singularity0909 commented on a change in pull request #5023:
URL: https://github.com/apache/apisix/pull/5023#discussion_r705594923



##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)
+    * [SRV 记录](#SRV 记录)
+
+## 通过 DNS 服务发现
+
+某些服务发现系统如 Consul,支持通过 DNS 提供系统信息。我们可以使用这种方法直接实现服务发现。
+
+首先我们需要配置 DNS 服务器的地址:
+
+```yaml
+# 添加到 config.yaml
+discovery:
+   dns:
+     servers:
+       - "127.0.0.1:8600"          # 使用 DNS 服务器的真实地址
+```
+
+与配置 Upstream `nodes` 项不同的是,DNS 服务发现将返回所有的记录。例如按照以下的 upstream 配置:
+
+```json
+{
+    "id": 1,
+    "discovery_type": "dns",
+    "service_name": "test.consul.service",
+    "type": "roundrobin"
+}
+```
+
+之后 `test.consul.service` 将被解析为 `1.1.1.1` 和 `1.1.1.2`,这个结果等同于:
+
+```json
+{
+    "id": 1,
+    "type": "roundrobin",
+    "nodes": [
+        {"host": "1.1.1.1", "weight": 1},
+        {"host": "1.1.1.2", "weight": 1}
+    ]
+}
+```
+
+注意所有来自 `test.consul.service` 的 IP 都有相同的权重。
+
+如果一个服务同时有 A 和 AAAA 记录,那么 A 记录的优先级更高。

Review comment:
       I would appreciate it if you make supplement on the document in English before I update it?
   
   https://github.com/apache/apisix/blame/master/docs/en/latest/discovery/dns.md#L69




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



[GitHub] [apisix] tokers commented on a change in pull request #5023: docs: add Chinese doc for discovery DNS method

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #5023:
URL: https://github.com/apache/apisix/pull/5023#discussion_r705309000



##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)

Review comment:
       ```suggestion
   * [基于 DNS 的服务发现](#基于 DNS 的服务发现)
   ```

##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)
+    * [SRV 记录](#SRV 记录)
+
+## 通过 DNS 服务发现

Review comment:
       Ditto.

##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)
+    * [SRV 记录](#SRV 记录)
+
+## 通过 DNS 服务发现
+
+某些服务发现系统如 Consul,支持通过 DNS 提供系统信息。我们可以使用这种方法直接实现服务发现。
+
+首先我们需要配置 DNS 服务器的地址:
+
+```yaml
+# 添加到 config.yaml
+discovery:
+   dns:
+     servers:
+       - "127.0.0.1:8600"          # 使用 DNS 服务器的真实地址
+```
+
+与配置 Upstream `nodes` 项不同的是,DNS 服务发现将返回所有的记录。例如按照以下的 upstream 配置:
+
+```json
+{
+    "id": 1,
+    "discovery_type": "dns",
+    "service_name": "test.consul.service",
+    "type": "roundrobin"
+}
+```
+
+之后 `test.consul.service` 将被解析为 `1.1.1.1` 和 `1.1.1.2`,这个结果等同于:
+
+```json
+{
+    "id": 1,
+    "type": "roundrobin",
+    "nodes": [
+        {"host": "1.1.1.1", "weight": 1},
+        {"host": "1.1.1.2", "weight": 1}
+    ]
+}
+```
+
+注意所有来自 `test.consul.service` 的 IP 都有相同的权重。
+
+如果一个服务同时有 A 和 AAAA 记录,那么 A 记录的优先级更高。

Review comment:
       It seems we should also specify the precedence between `A` and `SRV`.

##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)
+    * [SRV 记录](#SRV 记录)
+
+## 通过 DNS 服务发现
+
+某些服务发现系统如 Consul,支持通过 DNS 提供系统信息。我们可以使用这种方法直接实现服务发现。
+
+首先我们需要配置 DNS 服务器的地址:
+
+```yaml
+# 添加到 config.yaml
+discovery:
+   dns:
+     servers:
+       - "127.0.0.1:8600"          # 使用 DNS 服务器的真实地址
+```
+
+与配置 Upstream `nodes` 项不同的是,DNS 服务发现将返回所有的记录。例如按照以下的 upstream 配置:

Review comment:
       ```suggestion
   与在 Upstream的 `nodes` 对象中配置域名不同的是,DNS 服务发现将返回所有的记录。例如按照以下的 upstream 配置:
   ```




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



[GitHub] [apisix] spacewander commented on a change in pull request #5023: docs: add Chinese doc for discovery DNS method

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5023:
URL: https://github.com/apache/apisix/pull/5023#discussion_r705887854



##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)
+    * [SRV 记录](#SRV 记录)
+
+## 通过 DNS 服务发现
+
+某些服务发现系统如 Consul,支持通过 DNS 提供系统信息。我们可以使用这种方法直接实现服务发现。
+
+首先我们需要配置 DNS 服务器的地址:
+
+```yaml
+# 添加到 config.yaml
+discovery:
+   dns:
+     servers:
+       - "127.0.0.1:8600"          # 使用 DNS 服务器的真实地址
+```
+
+与配置 Upstream `nodes` 项不同的是,DNS 服务发现将返回所有的记录。例如按照以下的 upstream 配置:
+
+```json
+{
+    "id": 1,
+    "discovery_type": "dns",
+    "service_name": "test.consul.service",
+    "type": "roundrobin"
+}
+```
+
+之后 `test.consul.service` 将被解析为 `1.1.1.1` 和 `1.1.1.2`,这个结果等同于:
+
+```json
+{
+    "id": 1,
+    "type": "roundrobin",
+    "nodes": [
+        {"host": "1.1.1.1", "weight": 1},
+        {"host": "1.1.1.2", "weight": 1}
+    ]
+}
+```
+
+注意所有来自 `test.consul.service` 的 IP 都有相同的权重。
+
+如果一个服务同时有 A 和 AAAA 记录,那么 A 记录的优先级更高。

Review comment:
       @Singularity0909
   I just make a PR for you:
   https://github.com/apache/apisix/pull/5033/files




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



[GitHub] [apisix] spacewander commented on a change in pull request #5023: docs: add Chinese doc for discovery DNS method

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #5023:
URL: https://github.com/apache/apisix/pull/5023#discussion_r705887854



##########
File path: docs/zh/latest/discovery/dns.md
##########
@@ -0,0 +1,131 @@
+---
+title: DNS
+---
+
+<!--
+#
+# 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.
+#
+-->
+
+* [通过 DNS 服务发现](#通过 DNS 服务发现)
+    * [SRV 记录](#SRV 记录)
+
+## 通过 DNS 服务发现
+
+某些服务发现系统如 Consul,支持通过 DNS 提供系统信息。我们可以使用这种方法直接实现服务发现。
+
+首先我们需要配置 DNS 服务器的地址:
+
+```yaml
+# 添加到 config.yaml
+discovery:
+   dns:
+     servers:
+       - "127.0.0.1:8600"          # 使用 DNS 服务器的真实地址
+```
+
+与配置 Upstream `nodes` 项不同的是,DNS 服务发现将返回所有的记录。例如按照以下的 upstream 配置:
+
+```json
+{
+    "id": 1,
+    "discovery_type": "dns",
+    "service_name": "test.consul.service",
+    "type": "roundrobin"
+}
+```
+
+之后 `test.consul.service` 将被解析为 `1.1.1.1` 和 `1.1.1.2`,这个结果等同于:
+
+```json
+{
+    "id": 1,
+    "type": "roundrobin",
+    "nodes": [
+        {"host": "1.1.1.1", "weight": 1},
+        {"host": "1.1.1.2", "weight": 1}
+    ]
+}
+```
+
+注意所有来自 `test.consul.service` 的 IP 都有相同的权重。
+
+如果一个服务同时有 A 和 AAAA 记录,那么 A 记录的优先级更高。

Review comment:
       I just make a PR for you:
   https://github.com/apache/apisix/pull/5033/files




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



[GitHub] [apisix] spacewander merged pull request #5023: docs: add Chinese doc for discovery DNS method

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #5023:
URL: https://github.com/apache/apisix/pull/5023


   


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