You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/08/28 10:36:39 UTC

[GitHub] WillemJiang closed pull request #58: saga docs fix issue

WillemJiang closed pull request #58: saga docs fix issue
URL: https://github.com/apache/incubator-servicecomb-docs/pull/58
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/saga-reference/en_US/README.md b/saga-reference/en_US/README.md
index 58a2b2b..3965cbd 100644
--- a/saga-reference/en_US/README.md
+++ b/saga-reference/en_US/README.md
@@ -1,6 +1,4 @@
 # Saga User Guide
-[![ZH doc](https://img.shields.io/badge/document-中文-blue.svg)](user_guide_zh.md)
-
 ## Prerequisites
 You will need:
 1. [JDK 1.8][jdk]
diff --git a/saga-reference/en_US/SUMMARY.md b/saga-reference/en_US/SUMMARY.md
index 3def406..030ac02 100644
--- a/saga-reference/en_US/SUMMARY.md
+++ b/saga-reference/en_US/SUMMARY.md
@@ -4,6 +4,4 @@
 * [Design](design.md)
 * [TLS](enable_ssl.md)
 * [API](api/api.md)
-* [Q&A](faq/how_to_use_mysql_as_alpha_backend_database.md)
-
-
+* [Q&A](faq/how_to_use_mysql_as_alpha_backend_database.md)
\ No newline at end of file
diff --git a/saga-reference/en_US/design.md b/saga-reference/en_US/design.md
index a1e0143..1d7b76a 100644
--- a/saga-reference/en_US/design.md
+++ b/saga-reference/en_US/design.md
@@ -1,5 +1,4 @@
 # Saga Pack Design
-[![ZH doc](https://img.shields.io/badge/document-中文-blue.svg)](design_zh.md)
 ## Overview
 Pack contains two components: *alpha* and *omega*. Alpha is the pack leader and backed by database to make sure transaction events stored permanently while omega is the pack worker and embedded inside services to intercept transaction invocation and report events to alpha.
 
diff --git a/saga-reference/en_US/user_guide.md b/saga-reference/en_US/user_guide.md
index 293004b..eecc681 100644
--- a/saga-reference/en_US/user_guide.md
+++ b/saga-reference/en_US/user_guide.md
@@ -1,6 +1,4 @@
 # Saga User Guide
-[![ZH doc](https://img.shields.io/badge/document-中文-blue.svg)](user_guide_zh.md)
-
 ## Prerequisites
 You will need:
 1. [JDK 1.8][jdk]
diff --git a/saga-reference/zh_CN/README.md b/saga-reference/zh_CN/README.md
index ba5386e..9a40607 100644
--- a/saga-reference/zh_CN/README.md
+++ b/saga-reference/zh_CN/README.md
@@ -1,6 +1,4 @@
 # Saga 用户指南
-[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](user_guide.md)
-
 ## 准备环境
 1. 安装[JDK 1.8][jdk]
 2. 安装[Maven 3.x][maven]
diff --git a/saga-reference/zh_CN/SUMMARY.md b/saga-reference/zh_CN/SUMMARY.md
index d761f77..da33bcc 100644
--- a/saga-reference/zh_CN/SUMMARY.md
+++ b/saga-reference/zh_CN/SUMMARY.md
@@ -1,9 +1,6 @@
 # 目录
-
 * [用户手册](user_guide_zh.md)
-* [设计文档](design.md)
+* [设计文档](design_zh.md)
 * [TLS通信](enable_ssl.md)
 * [API](api/api.md)
-* [Q&A](faq/how_to_use_mysql_as_alpha_backend_database_zh.md)
-
-
+* [Q&A](faq/how_to_use_mysql_as_alpha_backend_database_zh.md)
\ No newline at end of file
diff --git a/saga-reference/zh_CN/design_zh.md b/saga-reference/zh_CN/design_zh.md
index 7659755..afbb07e 100644
--- a/saga-reference/zh_CN/design_zh.md
+++ b/saga-reference/zh_CN/design_zh.md
@@ -1,5 +1,4 @@
 # Saga Pack 设计文档
-[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](design.md)
 ## 概览
 Pack中包含两个组件,即 **alpha** 和 **omega**。
 * alpha充当协调者的角色,主要负责对事务的事件进行持久化存储以及协调子事务的状态,使其得以最终与全局事务的状态保持一致。
diff --git a/saga-reference/zh_CN/user_guide_zh.md b/saga-reference/zh_CN/user_guide_zh.md
index 5e156a9..c3eab1a 100644
--- a/saga-reference/zh_CN/user_guide_zh.md
+++ b/saga-reference/zh_CN/user_guide_zh.md
@@ -1,6 +1,4 @@
 # Saga 用户指南
-[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](user_guide.md)
-
 ## 准备环境
 1. 安装[JDK 1.8][jdk]
 2. 安装[Maven 3.x][maven]
diff --git a/service-center-reference/en_US/README.md b/service-center-reference/en_US/README.md
index 1b618b6..3b12510 100644
--- a/service-center-reference/en_US/README.md
+++ b/service-center-reference/en_US/README.md
@@ -1,9 +1,27 @@
-## Index
+## Service-Center Design
 
-* [Design](design.md)
+Service-Center(SC) is a service registry that allows services to register their instance information and to discover providers of a given service.
+SC uses etcd to store all the information of micro-service and its instances. Below is the diagram stating the working principles and flow of SC.
 
-* [Development Guide](dev-guide.md) 
+#### On StartUp
+Here we assume that micro-services are written using [java-chassis](https://github.com/ServiceComb/java-chassis) sdk. So when micro-service boots up then java-chassis sdk does the following list of tasks.
 
-* [Cluster Mode](sc-cluster.md)
- 
-* [Deploy with TLS](security-tls.md)
+1. On startup provider registers the micro-service to SC if not registered earlier and also register its instance information like its Ip and Port on which instance is running.
+2. SC stores the provider information in etcd.
+3. On startup consumer retrieves the list of all provider instance from SC using the micro-service name of the provider.
+4. Consumer sdk stores all the information of provider instances in its cache.
+5. Consumer sdk creates a web socket connection to SC to watch all the provider instance information, if there is any change in the provider then sdk updates it's cache information.
+
+![Onstartup](static_files/onStartup.PNG)
+
+#### Communication between Consumer -> Provider
+Once the bootup is successful then the consumer can communicate with providers flawlessly, below is the diagram illustrating the communication between provider and consumer.
+
+![Commuication](static_files/communication.PNG)
+
+Provider instance regularly sends heartbeat signal every 30 seconds to SC, if SC does not receive the heartbeat for particular instance then the information in etcd expires and the provider instance information is removed.  
+Consumer watches the information of provider instances from SC and if there is any change then the cache is updated.  
+When Consumer needs to communicate to Provider then consumer reads endpoints of the provider instances from cache and do loadbalancing to communicate to Provider.
+
+Note: This document is in beta stage, feel free to contribute to this document.
+w
\ No newline at end of file
diff --git a/service-center-reference/en_US/SUMMARY.md b/service-center-reference/en_US/SUMMARY.md
index 1b618b6..4ec5e75 100644
--- a/service-center-reference/en_US/SUMMARY.md
+++ b/service-center-reference/en_US/SUMMARY.md
@@ -1,4 +1,4 @@
-## Index
+# Index
 
 * [Design](design.md)
 
diff --git a/service-center-reference/book.json b/service-center-reference/en_US/book.json
similarity index 100%
rename from service-center-reference/book.json
rename to service-center-reference/en_US/book.json
diff --git a/service-center-reference/en_US/dev-guide.md b/service-center-reference/en_US/dev-guide.md
index 98f3527..7718241 100644
--- a/service-center-reference/en_US/dev-guide.md
+++ b/service-center-reference/en_US/dev-guide.md
@@ -1,7 +1,6 @@
 # Development Guide
 
-This chapter is about how to implement the feature of micro-service discovery with ServiceCenter,
-and you can get more detail at [here](/server/core/swagger/v3.yaml)
+This chapter is about how to implement the feature of micro-service discovery with ServiceCenter.
 
 ## Micro-service registration
 ```bash
diff --git a/service-center-reference/zh_CN/README.md b/service-center-reference/zh_CN/README.md
index 19d6864..f82c09b 100644
--- a/service-center-reference/zh_CN/README.md
+++ b/service-center-reference/zh_CN/README.md
@@ -1,9 +1,29 @@
-## 目录
+## Service-Center 设计原理
 
-* [设计原理](design-zh.md)
+Service-Center(SC)是一个服务注册中心,允许服务注册他们的实例信息并发现给定服务的提供者。以下简称SC:
+SC使用ETCD存储微服务的所有信息及其实例。下面是SC的工作原理和流程图。
 
-* [开发手册](dev-guide.md) 
+#### On StartUp
+假设我们的微服务是使用 [java-chassis](https://github.com/ServiceComb/java-chassis) SDK编写的。因此,当微服务启动时,Java chassis SDK执行以下任务列表。
 
-* [集群方式部署](sc-cluster.md)
+1 在启动provider时注册微服务到SC。(执行该步的条件是:既没有在之前注册,也没在sc登记它的实例信息,如它的IP和端口上运行的实例信息)
 
-* [TLS部署](security-tls.md)
+2 SC将provider信息存储在ETCD中。
+
+3 被启用的consumer检索所有provider实例的列表 (这个列表是由provider微服务名称构成,且从sc获得)
+
+4 Consumer SDK将provider实例的所有信息存储在其缓存中。
+
+5 Consumer SDK创建到SC的Web socket连接,以查看所有提供程序实例信息,如果提供者中有任何更改,SDK更新其缓存信息。
+
+
+![Onstartup](static_files/onStartup.PNG)
+
+#### Consumer -> Provider 之间的通信
+一旦启动成功,那么消费者可以完美地与提供者通信,下面是说明提供者和消费者之间的通信的图表。
+
+![Commuication](static_files/communication.PNG)
+
+Provider程序实例每隔30秒定期发送心跳信号到SC,如果SC不接收某一个实例的心跳,则该实例信息将在ETCD中过期,并且该provider实例信息被sc移除。Consumer由SC监视Provider实例的信息,如果有任何变化,则更新缓存。当Consumer需要与Provider通信时,Consumer从缓存读取Provider实例的endpoints,并进行负载平衡以与provider者通信。
+
+Note: 这个文档是beta阶段,可以自由的向该文档提交贡献.
diff --git a/service-center-reference/zh_CN/SUMMARY.md b/service-center-reference/zh_CN/SUMMARY.md
index 19d6864..1f17073 100644
--- a/service-center-reference/zh_CN/SUMMARY.md
+++ b/service-center-reference/zh_CN/SUMMARY.md
@@ -1,4 +1,4 @@
-## 目录
+# 目录
 
 * [设计原理](design-zh.md)
 
diff --git a/service-center-reference/zh_CN/book.json b/service-center-reference/zh_CN/book.json
new file mode 100644
index 0000000..b96be93
--- /dev/null
+++ b/service-center-reference/zh_CN/book.json
@@ -0,0 +1,5 @@
+{
+  "structure": {
+    "readme": "design-zh.md"
+  }
+}
\ No newline at end of file
diff --git a/service-center-reference/zh_CN/dev-guide.md b/service-center-reference/zh_CN/dev-guide.md
index 2fd6e28..2817898 100644
--- a/service-center-reference/zh_CN/dev-guide.md
+++ b/service-center-reference/zh_CN/dev-guide.md
@@ -1,6 +1,6 @@
 # 开发指南
 
-这个章节是关于如何基于实现微服务发现功能,你可以找到更多细节 [here](/server/core/swagger/v3.yaml)
+这个章节是关于如何基于实现微服务发现功能
 
 ## Micro-service注册
 ```bash
diff --git a/service-center-reference/zh_CN/sc-cluster.md b/service-center-reference/zh_CN/sc-cluster.md
index ea2ddf2..2dfaf49 100644
--- a/service-center-reference/zh_CN/sc-cluster.md
+++ b/service-center-reference/zh_CN/sc-cluster.md
@@ -1,30 +1,33 @@
-### Deploying Service-Center in Cluster Mode
+###在群集模式下部署Service-Center
 
-As Service-center is a stateless application so it can be seamlessly deployed in cluster mode to achieve HA.
-SC is dependent on the etcd to store the microservices information so you can opt for running etcd standalone or in [cluster](https://github.com/coreos/etcd/blob/master/Documentation/op-guide/container.md) mode.
-Once you are done with installing the etcd either in cluster or standalone mode then you can follow the below steps to run the Service-Center.
+由于服务中心是无状态应用程序,因此可以在群集模式下无缝部署以实现HA。
+SC依赖于etcd来存储微服务信息,因此您可以选择独立运行etcd或在[cluster]中运行(https://github.com/coreos/etcd/blob/master/Documentation/op-guide/container.md )模式。
+完成以群集或独立模式安装etcd后,您可以按照以下步骤运行服务中心。
 
-Let's assume you want to install 2 instances of Service-Center on VM with following details  
+假设您要在VM上安装2个Service-Center实例,并提供以下详细信息
 
 | Name    | Address     |  
 | :-----: | :---------: |  
 | VM1     | 10.12.0.1   |   
 | VM2     | 10.12.0.2   |  
 
-Here we assume your etcd is running on http://10.12.0.4:2379 (you can follow [this](https://github.com/coreos/etcd/blob/master/Documentation/op-guide/container.md) guide to install etcd in cluster mode.)
+这里我们假设您的etcd在http://10.12.0.4:2379上运行(您可以关注[this](https://github.com/coreos/etcd/blob/master/Documentation/op-guide/container.md )指导在集群模式下安装etcd。)
 
 ##### Step 1
-Download the SC release from [here](https://github.com/apache/incubator-servicecomb-service-center/releases) on all the VM's.
+
+从所有VM上的[here](https://github.com/apache/incubator-servicecomb-service-center/releases)下载SC版本。
+
 ```
 # Untar the release
 # tar -xvf service-center-X.X.X-linux-amd64.tar.gz
 
 ```
 
-Note: Please don't run start.sh as it will also start the etcd.
+注意:请不要运行start.sh,因为它也会启动etcd。
 
 ##### Step 2
-Edit the configuration of the ip/port on which SC will run and etcd ip
+编辑ip/port(SC运行需要)和etcd ip的配置
+
 ###### VM1
 ```
 # vi conf/app.conf
@@ -47,7 +50,8 @@ manager_cluster = "10.12.0.4:2379"
 ./service-center
 ```
 
-Note: In `manger_cluster` you can put the multiple instances of etcd in the cluster like 
+注意:在`manger_cluster`中,你可以将etcd的多个实例放在集群中
+
 ```
 manager_cluster= "10.12.0.4:2379,10.12.0.X:2379,10.12.0.X:2379"
 ```
@@ -94,9 +98,9 @@ Verify your instances
 }
 ```
 
-As we can see here the Service-Center can auto-discover all the instances of the Service-Center running in cluster, this auto-discovery feature is used by the [Java-Chassis SDK](https://github.com/apache/incubator-servicecomb-java-chassis) to auto-discover all the instances of the Service-Center by knowing atleast 1 IP of Service-Center running in cluster.
+我们在这里可以看到Service-Center可以自动发现在集群中运行的Service-Center的所有实例,[Java-Chassis SDK]使用此自动发现功能(https://github.com/apache / incubator-servicecomb-java-chassis)通过了解集群中运行的服务中心的至少1个IP来自动发现服务中心的所有实例。
 
-In your microservice.yaml you can provide the SC IP of both the instance or any one instance, sdk can auto-discover other instances and use the other instances to get microservice details in case of failure of the first one.
+在您的microservice.yaml中,您可以提供实例或任何一个实例的SC IP,sdk可以自动发现其他实例,并使用其他实例在第一个实例失败的情况下获取微服务详细信息。
 ```
 cse:
   service:
@@ -104,6 +108,5 @@ cse:
       address: "http://10.12.0.1:30100,http://10.12.0.2:30100"
       autodiscovery: true
 ```
-In this case sdk will be able to discover all the instances of SC in cluster.
-
+在这种情况下,sdk将能够发现集群中SC的所有实例。
 
diff --git a/service-center-reference/zh_CN/security-tls.md b/service-center-reference/zh_CN/security-tls.md
index f0a45b0..11a4645 100644
--- a/service-center-reference/zh_CN/security-tls.md
+++ b/service-center-reference/zh_CN/security-tls.md
@@ -1,18 +1,18 @@
-# Setup SSL/TLS
+#设置SSL / TLS
 
-## Requirement
-Service center(SC) takes several files related SSL/TLS options.
+##要求
+服务中心(SC)需要多个SSL / TLS相关文件。
 
-1. Environment variable 'SSL_ROOT': The directory contains certificates. If not set, uses 'etc/ssl' under the SC work directory.
-1. $SSL_ROOT/trust.cer: Trusted certificate authority.
-1. $SSL_ROOT/server.cer: Certificate used for SSL/TLS connections to SC.
-1. $SSL_ROOT/server_key.pem: Key for the certificate. If key is encrypted, 'cert_pwd' must be set.
-1. $SSL_ROOT/cert_pwd(optional): The password used to decrypt the private key.
+1.环境变量'SSL_ROOT':该目录包含证书。如果未设置,则使用SC工作目录下的“etc / ssl”。
+1. $ SSL_ROOT / trust.cer:可信证书颁发机构。
+1. $ SSL_ROOT / server.cer:用于与SC的SSL / TLS连接的证书。
+1. $ SSL_ROOT / server_key.pem:证书的密钥。如果密钥已加密,则必须设置'cert_pwd'。
+1. $ SSL_ROOT / cert_pwd(可选):用于解密私钥的密码。
 
-## Configuration
-Please modify the conf/app.conf before start up SC
+##配置
+请在启动SC之前修改conf / app.conf
 
-1. ssl_mode: Enabled SSL/TLS mode. [0, 1]
-1. ssl_verify_client: Whether the SC verify client(including etcd server). [0, 1]
-1. ssl_protocols: Minimal SSL/TLS protocol version. ["TLSv1.0", "TLSv1.1", "TLSv1.2"]
-1. ssl_ciphers: A list of cipher suite. By default, uses TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256
+1. ssl_mode:启用SSL / TLS模式。 [0,1]
+1. ssl_verify_client:是否验证SC客户端(包括etcd服务器)。 [0,1]
+1. ssl_protocols:最小SSL / TLS协议版本。 [“TLSv1.0”,“TLSv1.1”,“TLSv1.2”]
+1. ssl_ciphers:密码组列表。默认情况下,使用TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256
\ No newline at end of file


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services