You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2017/12/25 02:15:34 UTC
[GitHub] WillemJiang closed pull request #13: SCB-111 document translate for website general development
WillemJiang closed pull request #13: SCB-111 document translate for website general development
URL: https://github.com/apache/incubator-servicecomb-website/pull/13
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/_users/customized-tracing.md b/_users/customized-tracing.md
index abfdec2..ef08da5 100644
--- a/_users/customized-tracing.md
+++ b/_users/customized-tracing.md
@@ -3,35 +3,35 @@ title: "Customized Tracing"
lang: en
ref: customized-tracing
permalink: /users/customized-tracing/
-excerpt: "????????"
+excerpt: "Dotting for Customized Tracing"
last_modified_at: 2017-08-15T15:01:43-04:00
redirect_from:
- /theme-setup/
---
{% include toc %}
-## ????
+## Concept Disctiption
-?????????????????????????????????????????????????????????????????????????????????
+A distributed call chain tracking records the service calling sequence, but developers also need information about link invocation inside a microservice to describe a complete call chain. In this way, they can locate error and identify potential performance problems more easily.
-## ????
+## Prerequisites
-* ??????????????????Java Chassis???????
+* To use the customized dotting function, you need to configure and set the Java Chassis microservice call chain.
-## ????
+## Precautions
-* ??`@Span`??????????????Java Chassis??????????????
-* ??`@Span`????????Spring???Bean????????[?????](https://stackoverflow.com/questions/41383941/load-time-weaving-for-non-spring-beans-in-a-spring-application)???
+* The customized dotting that uses the `@Span` annotation can only be called using the thread that calls Java Chassis.
+* To add the `@Span` annotation, you must use the Bean method of Spring. Otherwise, you need to configure dotting following the procedure in this section.
-## ????????
+## Customized Dotting Call Chain
-??????Zipkin???`@Span`????????????????Java Chassis?????????`@Span`???????????????????????????????
+This function integrates Zipkin and provides the `@Span` annotation to customize dotting for the method you want to track. Java Chassis automatically tracks all the methods that track the `@Span` annotation, associating the local method call information with the call information between services.
-## ????:
+## Procedure:
-### ????
+### Add dependency
-?? ServiceComb Java Chassis ?????????????? pom.xml?
+For microservices based on ServiceComb Java Chassis, add the following content to pom.xml
```xml
<dependency>
@@ -40,9 +40,9 @@ redirect_from:
</dependency>
```
-### ?????????
+### Enable customized dotting
-??????Spring??????`@EnableZipkinTracing`???
+Addthe `@EnableZipkinTracing` annotation to the application portal or the Spring configuration class:
```java
@SpringBootApplication
@@ -54,9 +54,9 @@ public class ZipkinSpanTestApplication {
}
```
-### ????
+### Customize dotting
-?????????????`@Span`???
+Add the `@Span` annotation to the method that requires dotting customization:
```java
@Component
@@ -75,23 +75,23 @@ public class SlowRepoImpl implements SlowRepo {
}
```
-????????`@Span`?????????? Zipkin ?????????
+In this way, Zipkin-based customized dotting is enabled using the @Span annotation.
-## ???????
+## Customize reported data
-????????????????????
+The call chain reported by customized dotting contains the following pieces of data:
-* **span name** ?????????????
-* **call.path** ?????????????
+* **span name** which is the full name of the annotated method by default.
+* **call.path** which is the signature of the annotated method by default.
-???????`SlowRepoImp`?????????
+ For example, the data reported in SlowRepoImp is as follows:
-| key | value |
-| :--- | :--- |
-| span name | crawl |
+| key | value |
+| :-------- | :--------------------------------------- |
+| span name | crawl |
| call.path | public abstract java.lang.String io.servicecomb.tests.tracing.SlowRepo.crawl\(\) throws java.lang.InterruptedException |
-?????????????????????????
+To customize reported data, you can specify customized parameters:
```java
public static class CustomSpanTask {
diff --git a/_users/distributed-tracing.md b/_users/distributed-tracing.md
index 77f6813..253064f 100644
--- a/_users/distributed-tracing.md
+++ b/_users/distributed-tracing.md
@@ -1,36 +1,36 @@
---
-title: "????????"
+title: "Distributed Tracing"
lang: en
ref: distributed-tracing
permalink: /users/distributed-tracing/
-excerpt: "????????"
+excerpt: "Distributed Tracing"
last_modified_at: 2017-08-15T15:01:43-04:00
redirect_from:
- /theme-setup/
---
{% include toc %}
-## ????
+## Concept Description
-?????????????????????????????????????????????????????????????
+The microservice architecture addresses many problems of single applications but has several drawbacks, for example, network instability may lead to latency.
-????????????????????????????????????????????????????????????????????? ??????????????????
+In a single application, all the modules are running in the same process without interworking. However, in the microservice architecture, services are communicated through network, and we have to address network problems, such as latency, timeout, and segmentation.
-??????????????????????????????????????????????????????????????????????
+As services expand, we can hardly monitor how data is transferred in the complex service architecture. How do we efficiently monitor network latency and visualize the data flows of services?
-**????????**?????????????????????????????
+The distributed tracing system efficiently monitor network latency of the microservice and visualize data flow during the service.
## Zipkin
-> [Zipkin](http://zipkin.io/)?????????????? ?????????????????????????????????????? ????Zipkin ????? Google [Dapper paper](http://research.google.com/pubs/pub36356.html)?
+> [Zipkin](http://zipkin.io/) is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in microservice architectures. It manages both the collection and lookup of this data. Zipkin's design is based on Google [Dapper paper](http://research.google.com/pubs/pub36356.html)?
-ServiceComb ??? Zipkin ???????????????????????????????
+ServiceComb integrates the automatic call tracing function provided by Zipkin, so that users can focus on service demands.
-## ????:
+## Procedure
-### ????
+### Add dependency
-?? ServiceComb Java Chassis ?????????????? pom.xml?
+For microservice based on ServiceComb Java Chassis, add the following content to pom.xml
```xml
<dependency>
@@ -39,7 +39,7 @@ ServiceComb ??? Zipkin ?????????????????
</dependency>
```
-???????? Spring Cloud + Zuul ? API ????? workshop demo ?? manager service ????????????????
+If the microservice is based on the API of Spring Cloud Zuul, such as the manager service of the workshop demo, add the following dependency:
```xml
<dependency>
@@ -48,9 +48,9 @@ ServiceComb ??? Zipkin ?????????????????
</dependency>
```
-### ???????????
+### Configure tracing and data collection
-?microservice.yaml???????????????????
+Set addresses for the tracing processor and data collection in the microservice.yaml file.
```yaml
cse:
@@ -66,7 +66,7 @@ servicecomb:
address: http://zipkin.servicecomb.io:9411
```
-???????????????????????????????? Zipkin ? Java chassis ?????????????
+In this way, we enable the Zipkin-and-Java-based chassis distributed tracing system without changing any code.
-**???** ?????????????? zipkin ??? Spring Cloud?????? zipkin ?????????????????? pom ??? zipkin ???
+**NOTE:** If other dependencies introduce the Zipkin system, such as Spring Cloud, running errors may occur due to version inconsistency. In this case, you need to specify the Zipkin version in the pom project.
{: .notice--warning}
diff --git a/_users/local-develop-test.md b/_users/local-develop-test.md
index f2d972a..178cb66 100644
--- a/_users/local-develop-test.md
+++ b/_users/local-develop-test.md
@@ -1,59 +1,59 @@
---
-title: "???????"
+title: "Local Development and Test"
lang: en
ref: huawei-cloud
permalink: /users/local-develop-test/
-excerpt: "???????"
+excerpt: "Local Development and Test"
last_modified_at: 2017-08-15T15:01:43-04:00
redirect_from:
- /theme-setup/
---
{% include toc %}
-## ????
+## Concept Description
-??????????????????/?????????????????????[?????????](/users/service-definition/)???????????[?????????](/users/develop-with-rest-template/)??????????????????????????????????????????????????????????????????????
+This section describes how developers can locally develop and commission consumer and provider applications. Both service providers and consumers need to connect to the remote service center. Two methods of building Local ServiceCenter for local microservice commissioning are as follows:
-* [????????](#????????)?
+* Starting [Local Service Center](#????????)?
-* [??local file????????Mock??](#mock????????)?
+* Starting Local Service Center [Mock mechanism](#mock????????)?
-???????????????????????????????????????????????????????/?????????????
+Service center is an important component in the microservice architecture, and is used for managing, registering, and detecting metadata and instance metadata. The logic relationship between the service center and microservice provider/consumer is as follows:
-
+
-## ????????
+## Starting Local ServiceCenter
-* **??1** ????????????[??Service Center??](/users/setup-environment/#??service-center)?
+* **Step 1** Starting local service center, please refer to [Setup Environment](/users/setup-environment/#??service-center),
-* **?? 2** ?????????????????/????microservice.yaml?????ServerCenter????????????
+* **Step 2** After local service center is started, configure the service center address in the microservice.yaml file that stores SDK configuration information, as shown in the following example:
```yaml
cse:
service:
registry:
- address: http://127.0.0.1:30100 #?????????
+ address: http://127.0.0.1:30100 #Indicates the service center address and port number
```
-* **?? 3** ??????/????????????????
+* **Step 3** Develop service providers and consumers enable the microservice for local tests.
-## Mock????????
+## Enable Local ServiceCenter Using the Mock Mechanism
-* **?? 1**????????????registry.yaml??????
+* **Step 1** Create the registry.yaml file for Local ServiceCenter
```yaml
springmvctest:
- id: "001"
version: "1.0"
- appid: myapp #?????id
+ appid: myapp #Commissioning service ID
instances:
endpoints:
rest://127.0.0.1:8080
```
- ???mock????????????????????????????\(consumer\)?????????????\(provider\)
+ NOTE: The mock mechanism needs an API definition on its own. Currently, only local commissioning for service consumers is supported.
-* **?? 2**??????Main???????????
+* **Step 2** Add the following code to the end of the Main function for service consumers.
```java
public class xxxClient {
@@ -64,6 +64,6 @@ redirect_from:
}
```
-setProperty???????registry.yaml?????????????????????????????
+ NOTE: Set the second parameter of setProperty to the absolute path of registry.yaml file in the disk. The path separator depends on the system it is in.
-* **?? 3**????????????????????
+* **Step 3** Develop service consumers and enable the microservice for local tests.
\ No newline at end of file
diff --git a/_users/use-servicecomb-in-spring-boot.md b/_users/use-servicecomb-in-spring-boot.md
index 907ae0d..446dc09 100644
--- a/_users/use-servicecomb-in-spring-boot.md
+++ b/_users/use-servicecomb-in-spring-boot.md
@@ -1,41 +1,41 @@
---
-title: "?Spring Boot???ServiceComb"
+title: "Use ServiceComb in Spring Boot"
lang: en
ref: use-servicecomb-in-spring-boot
permalink: /users/use-servicecomb-in-spring-boot/
-excerpt: "?Spring Boot???ServiceComb"
+excerpt: "Use ServiceComb in Spring Boot"
last_modified_at: 2017-08-15T15:01:43-04:00
redirect_from:
- /theme-setup/
---
{% include toc %}
-## ??Service Center???????Spring Cloud??
-### ????
+## Using the Service Center and Governance Center to Manage the Spring Cloud Application
+### Concept Description
-??????SpringCloud????????????????SpringCloud????ServiceComb???????Service Center??????
+This section describes how to change configurations in the native Spring Cloud application to allow the Spring Cloud application to use the service center and governance center in the microservice framework.
-### ????
+### Scenario
-* SpringCloud????????Spring Cloud Eureka???????????????????????
+* The Spring Cloud Eureka client provides the service discovery and service registration function in the distributed environment by default.

-* ServiceComb???????Service Center??????????????????????????????????????
+* The service center in microservice framework is used to manage and process registration and discovery of service metadata and service instance metadata, and also supports the following functions:
-> * ??pull/push??????????
+> * The pull and push modes used to monitor instance changes
>
-> * ??????????????????
+> * Dynamic instance scale-out, massive persistent connections, or short connections.
>
-> * ??????????????????
+> * Advanced management features, such as gray release and sersvice grouping.
-??SpringBoot/Cloud????????????ServiceComb???SDK?????????????????????????????
+You can use Spring Cloud or Spring Boot to develop applications, enable services run in the microservice SDK container, and use functions, such as high-performance communication, service governance, and distributed transaction management.
-### ????
+### Configuration Description
-??SpringBoot/Cloud?????????????????????????????ServiceComb?SDK????
+Use Spring Boot or Spring Cloud to develop applications and perform the following steps based on the original application to interconnect with the SDK components of ServiceComb.
-* **?? 1** ?pom???????dependencyManagement?
+* **Step 1** Add dependencyManagement to teh POM file:
```xml
<dependencyManagement>
@@ -51,21 +51,21 @@ redirect_from:
</dependencyManagement>
```
-* **?? 2** ?pom??????
+* **Step 2** Add the following dependency to POM file.
```xml
<dependency>
- <!--?????????sdk???-->
+ <!--let services run in the microservice SDK container.-->
<group>io.servicecomb</group>
<artifactId>spring-boot-starter-provider</artifactId>
</dependency>
<dependency>
- <!--??????-->
+ <!--Use Service Center.-->
<group>io.servicecomb</group>
<artifactId>spring-boot-starter-discovery</artifactId>
</dependency>
<dependency>
- <!--??????Spring boot embedded tomcat?-->
+ <!--Let Servieces run in Spring boot embedded tomcat-->
<group>io.servicecomb</group>
<artifactId>spring-boot-starter-transport</artifactId>
</dependency>
@@ -78,9 +78,9 @@ redirect_from:
</dependency>
```
-* **?? 3** ?????????
+* **Step 3** Configure the processing chain and protocol:
- ?resources?????microservice.yaml????????????????????[??????](/users/service-definition/)??????
+ Create the microservice.yaml file in the resources directory and define the service. For details, see Service Definition. For example:
```yaml
APPLICATION_ID: discoverytest
@@ -90,33 +90,33 @@ redirect_from:
cse:
service:
registry:
- address: http://127.0.0.1:30100 #????????
+ address: http://127.0.0.1:30100 #Service Center registration
rest:
- address: 0.0.0.0:8080 #???????
+ address: 0.0.0.0:8080 #Port number released by the service
handler:
chain:
Provider:
- default: bizkeeper-provider #??????
+ default: bizkeeper-provider #Call processing chain
```
-* **??4** ????ServiceComb??????
+* **Step 4** To use the ServiceComb configuration center, run the following commands
- ?pom??????
+ Add the following dependency to POM file:
```java
<dependency>
- <!--??????-->
+ <!--Use the configuration center-->
<group>io.servicecomb</group>
<artifactId>spring-boot-starter-discovery</artifactId>
</dependency>
```
-* **?? 5** ????????@EnableServiceComb?
+* **Step 5** Add the annotation @EnableServiceComb to the main class:
```java
@EnableDiscoveryClient
@SpringBootApplication
- @EnableServiceComb //????
+ @EnableServiceComb //new annotation
public class xxxServer {
public static void main(String[] args) {
SpringApplication.run(xxxServer.class, args);
@@ -124,7 +124,7 @@ redirect_from:
}
```
-* **?? 6** ????????????[????](/users/service-contract/)??????
+* **Step 6** Define the API definition. For details ,see [Service Contract](/users/service-contract/):
```java
// ControllerImpl.class:
@@ -139,31 +139,29 @@ redirect_from:
}
```
-* **?? 7** ??xxxServer?????????ServiceComb?Service Center?
+* **Step 7** Start the xxxServer. The service can be registered in the service center of ServiceComb.
-## ?ServiceComb?????Spring Boot??
-### ????
+## Integrating Spring Boot into Java Chassis
+### Concept Description
-???????ServiceComb?????SpringBoot???????????
+This section describes advantages and procedures of integrating the Spring Boot framework in the Java Chassis framework.
-### ????
+### Scenario
-#### **SpringBoot??**
+#### **Spring Boot framework**
-??Spring Boot??Pivotal?????????????????????Spring???????????????????????????????????????????????????????????Spring Boot??????????????????????????Boot?????????????Boot???"starter"??????????????????
+??Spring Boot is a new framework provided by the Pivotal team. It is designed to simplify the initial establishment and development of new Spring applications. The framework is configured in a specific manner so that developers do not need to define the sample configuration. Spring Boot is a collection of some databases and can be used by the construction system of any projects. The Boot function is modularized. By importing the starter module of Spring Boot, you can add many dependencies to a project.
-#### **?ServiceComb???SpringBoot**
+#### **Integrating Spring Boot into ServicComb**
-???????ServiceComb????????????????ServiceComb??????????????????????pom??????????????????ServiceComb????????????????handler-loadbalance?????????ServiceComb??????starter?????Spring Boot??????Spring Boot???????????starter???SpringCloud?????????
+??You need to use the native Java Chassis framework to develop microservice applications. To use the functions provided by the Java Chaasis framework, add dependency packages to the POM file of microservice project. For example, to use the load balancing service provided by the Java Chassis framework, add the dependency package of the handler-loadbalance package. In this way, functions provided by ServiceComb can be inserted into Spring Boot in the manner of starter, and the microservice can be built together with the startere (such as Spring Cloud) provided by Spring B
-### ServiceComb??SpringBoot
+### Integrating Spring Boot into ServiceComb
-??????ServiceComb?????????????????[???????](/users/service-definition/)?[???????](/users/develop-with-rest-template/)???????????SpringBoot???
+??You need to use the Java Chassis framework to develop microservice applications, and then integrate the Spring Boot framework.
-????????SpringBoot??????????????????????????maven?????????
-
-* **?? 1** ???pom????<dependencyManagement>???
+* **Step 1** Add the dependency Management node to the POM file.
```xml
<dependencyManagement>
@@ -179,9 +177,9 @@ redirect_from:
</dependencyManagement>
```
-* **?? 2** ???????
+* **Step 2** Add the following dependency:
- ??ServiceComb???Spring Boot??
+ Import Spring Boot dependency provided by ServiceComb
```xml
<dependency>
@@ -190,8 +188,6 @@ redirect_from:
</dependency>
```
- ??Spring Boot??
-
```xml
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -203,20 +199,20 @@ redirect_from:
</dependency>
```
-* **?? 3** ?resources?????application.yml??????????
+* **Step 3** Create the application.yaml file in the resources directory. The file content is as follows:
```yaml
server:
- port: 7999 #??????springboot????
+ port: 7999 #Port number of the Spring Boot service
```
-* **?? 4** ????????????
+* **Step 4** Add the following annotation for the microservice main class:
```java
package xxx
import xxx
- @SpringBootApplication //????
- @EnableServiceComb //????
+ @SpringBootApplication //New Annotation
+ @EnableServiceComb //New Annotation
public class xxxServer/Client {
public static void main(final String[] args) {
? Log4jUtils.init();
diff --git a/assets/images/local_develop_test_en.png b/assets/images/local_develop_test_en.png
new file mode 100644
index 0000000..3e8845f
Binary files /dev/null and b/assets/images/local_develop_test_en.png differ
----------------------------------------------------------------
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