You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2017/12/25 01:14:02 UTC

[incubator-servicecomb-website] branch master updated: edge service document translation (#11)

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git


The following commit(s) were added to refs/heads/master by this push:
     new cebca45  edge service document translation (#11)
cebca45 is described below

commit cebca4597c9e4ac19d001d02ed63088dac81576d
Author: lujunruhit <34...@users.noreply.github.com>
AuthorDate: Mon Dec 25 09:14:00 2017 +0800

    edge service document translation (#11)
---
 _users/nginx.md | 64 ++++++++++++++++++++++++++++++---------------------------
 1 file changed, 34 insertions(+), 30 deletions(-)

diff --git a/_users/nginx.md b/_users/nginx.md
index 3458420..2b994ee 100644
--- a/_users/nginx.md
+++ b/_users/nginx.md
@@ -1,107 +1,111 @@
 ---
-title: "使用confd和Nginx做边缘服务"
+title: "Using Confd and Nginx for Edge Service"
 lang: en
 ref: edging-service-nginx
 permalink: /users/edging-service/nginx/
-excerpt: "使用confd和Nginx做边缘服务"
+excerpt: "Using Confd and Nginx for Edge Service"
 last_modified_at: 2017-08-15T15:01:43-04:00
 redirect_from:
   - /theme-setup/
 ---
 
 {% include toc %}
-## 概念阐述
+## Concept Description
 
 ### **confd**
 
-confd是一个轻量级的配置管理工具,源码地址:[https://github.com/kelseyhightower/confd](https://github.com/kelseyhightower/confd),它可以将配置信息存储在etcd、consul、dynamodb、redis以及zookeeper等。confd定期会从这些存储节点pull最新的配置,然后重新加载服务,完成配置文件的更新。
+confd is a lightweight configuration management tool. The source code address is: https://github.com/kelseyhightower/confd](https://github.com/kelseyhightower/confd), It can store configuration information in etcd, consul, dynamodb, redis, and zookeeper. confd regularly pulls the latest configuration from storage nodes and then reloads services to complete updating the configuration file.
 
 ### **Nginx**
 
-Nginx \(engine x\)是一个高性能的HTTP和反向代理服务器,具有负载均衡的功能。详情请参考[http://www.nginx.cn/doc/](http://www.nginx.cn/doc/)。本小节介绍的服务主要使用到的是Nginx的http代理功能。
+Nginx \(engine x\) is a high-performance HTTP and  reverse proxy server that has the load balancing function. For details, see [http://www.nginx.cn/doc/](http://www.nginx.cn/doc/). This secton describes the HTTP proxy function of Nginx.
 
-## 场景描述
+## Scenario
 
-本小节介绍的技术是使用nginx+confd做边缘服务,同时可以对接ServiceComb微服务框架中的服务中心,从服务中心中拉去服务信息通过confd动态更新nginx的配置。
+This section describes how to use Nginx and confd to serve as edge services. Also, you can connect Nginx and confd to service center in the Java Chassis microservice framework and dynamically update configuration of Nginx using confd.
 
-使用nginx+confd动态反向代理的实现步骤可参考文章[http://www.cnblogs.com/Anker/p/6112022.html](http://www.cnblogs.com/Anker/p/6112022.html),本节主要介绍confd如何对接ServiceComb框架的服务中心。
+For details about how to use the dynamic reverse proxy of Nginx and confd, see [http://www.cnblogs.com/Anker/p/6112022.html](http://www.cnblogs.com/Anker/p/6112022.html), This section describes how to interconnect Confd with the service center of the Java Chassis framework.
 
-## 对接服务中心
+## Interconnecting with the Service Center
 
-本节介绍的技术核心在于如何使得confd获取到服务中心的服务信息,服务中心开放了以下接口供外部调用:
+This section describes how to enable confd to obtain service information from the service center. The service center provides the following APIs for external calls:
 
-### **方法一:http调用**
+### **Method 1: HTTP call**
 
-服务中心开放http接口均需要添加租户头部信息:“X-Tenant-Name:tenantName”,tenameName为租户名,默认为default,例如"X-Tenant-Name:default"。
+The tenant header information of "X-Tenant-Name:tenantName" needs to be added to the HTTP API in the Service Center. tenameName is the tenant name. The default value is default, such as X-Tenant-Name:default.
 
-* 检查服务中心健康状态
+* Check the health status of the service center
 
   ```http
    GET 127.0.0.1:9980/health
   ```
 
-* 获取所有微服务信息
+* Obtain all microservice information
 
   ```http
    GET 127.0.0.1:9980/registry/v3/microservices
   ```
 
-* 获取指定id的微服务信息
+* Obtain the microservice information with a specified ID
 
-> 1. 首先根据微服务信息获取serviceId
+> 1. Obtain the service ID based on the microservice information
 >
 >    ```http
 >    GET 127.0.0.1:9980/registry/v3/existence?type=microservice&appId={appId}&serviceName={serviceName}&version={version}
 >    ```
 >
-> 2. 根据上述接口返回的serviceId获取微服务完整信息
+> 2. Obtain complete microservice information based on the service ID returned by API
 >
 >    ```http
 >    GET 127.0.0.1:9980/registry/v3/microservices/{serviceId}
 >    ```
 
-* 获取指定微服务的所有实例信息
+* Obtain all instance information from specified microservice
 
   ```http
    GET 127.0.0.1:9980/registry/v3/microservices/{serviceId}/instances
   ```
-   需要在header中添加:"X-ConsumerId:{serviceId}"。
+   Add the following information to the header file:
 
-* 查找微服务实例信息
+   "X-ConsumerId:{serviceId}"
+
+* Searching microservice instance information
 
   ```http
    GET 127.0.0.1:9980/registry/v3/instances?appId={appId}&serviceName={serviceName}&version={version}
   ```
-   需要在header中添加"X-ConsumerId:{serviceId}"。
+  Add the following information to the header file:
+
+  "X-ConsumerId:{serviceId}"
 
-注意:在实际开发中请访问实际的service-center访问地址,并将上述url中{}的变量替换成具体值,http返回的数据均为json格式
+NOTE: The preceding service center address is provides as example only. Set the variables enclosed in curly brackets ({}) as needed. The data returned via HTTP is in JSON format.
 
-### **方法二:使用servicecomb开源代码接口**
+### **Method 2: Using the open-source code API**
 
-在开发微服务应用,只需要调用servicecomb框架代码中的工具类RegistryUtil.java中提供的接口,即可获取服务中心的信息,接口描述如下:
+During the development of the microservice application, you only need to call the API provided by the tool RegistryUtil.java in the ServiceComb framework code to obtain the information in the Service Center. The API is described as follows:
 
-* 获取所有微服务信息
+* Obtain all microservice information
    ```java
    List<Microservice> getAllMicroservices();
    ```
 
-* 获取微服务唯一标识
+* Obtain the unique ID of the microservice.
    ```java
    String getMicroserviceId(String appId, String microserviceName, String versionRule);
    ```
 
-* 根据微服务唯一标识查询微服务静态信息 
+* Query the microservice static information based on the unique ID of the microservice.
    ```java
    Microservice getMicroservice(String microserviceId);
    ```
 
-* 根据多个微服务唯一标识查询所有微服务实例信息
+* Query all the microservice instance information based on the unique IDs of the microservices.
    ```java
    List<MicroserviceInstance> getMicroserviceInstance(String consumerId, String providerId);
    ```
-* 按照app+interface+version查询实例endpoints信息  
+* Query the instance end points information based on the application, interface, and version.  
    ```java
    List<MicroserviceInstance> findServiceInstance(String consumerId, String appId, String serviceName,String versionRule);
    ```
 
-通过上述http接口可获取到服务中心的微服务和其实例的信息,从而通过confd动态更新nginx配置。
+You can obtain information about the microservice and instance of the Service Center using the HTTP API to dynamically update the Nginx configuration using confd.

-- 
To stop receiving notification emails like this one, please contact
['"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>'].