Skip to content

Commit

Permalink
Enhance en docs (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Jan 2, 2023
1 parent 2c50e2c commit 95a9f4f
Show file tree
Hide file tree
Showing 443 changed files with 28,239 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .htaccess
Expand Up @@ -29,6 +29,6 @@
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?faq/?([\w\-/]+)?$ "/zh/docs3-v2/java-sdk/faq/$1" [L,R=302]

RewriteRule ^/?faq/?([\w\-/]+)?$ "/en/docs/java-sdk/faq/$1" [L,R=302]
RewriteRule ^/?faq/?([\w\-/]+)?$ "/en/docs3-v2/java-sdk/faq/$1" [L,R=302]

</IfModule>
4 changes: 2 additions & 2 deletions content/en/_index.html
Expand Up @@ -6,10 +6,10 @@

{{< blocks/cover title="Apache Dubbo" image_anchor="top" height="auto" color="primary" >}}
<div class="mx-auto">
<a class="btn btn-lg btn-primary mr-3 mb-4" href="{{< relref "/docs" >}}">
<a class="btn btn-lg btn-primary mr-3 mb-4" href="{{< relref "/docs3-v2" >}}">
LEARN MORE <i class="fas fa-arrow-alt-circle-right ml-2"></i>
</a>
<a class="btn btn-lg btn-light mr-3 mb-4" href="/en/blog/2020/05/18/past-releases/">
<a class="btn btn-lg btn-light mr-3 mb-4" href="/en/release/">
DOWNLOAD <i class="fas fa-download ml-2 "></i>
</a>
<a class="btn btn-lg btn-secondary mr-3 mb-4" href="https://github.com/apache/dubbo">
Expand Down
3 changes: 3 additions & 0 deletions content/en/blog/releases/past-releases.md
Expand Up @@ -6,6 +6,9 @@ description: >
This article will introduce you how to understand the details of each version and upgrade matters needing attention.
---

{{% pageinfo %}} This document is no longer maintained. You are currently viewing a snapshot version. If you want to see the latest version of the documentation, see [Latest Version](/en/release/).
{{% /pageinfo %}}

## Verification

you can follow these [procedures](https://www.apache.org/info/verification) and the [KEYS](https://downloads.apache.org/dubbo/KEYS) file to verify the download files
Expand Down
3 changes: 0 additions & 3 deletions content/en/community/_index.md
@@ -1,8 +1,5 @@
---
title: Community
menu:
main:
weight: 40
---

<!--add blocks of content here to add more sections to the community page -->
Expand Down
3 changes: 0 additions & 3 deletions content/en/docs/_index.md
Expand Up @@ -3,9 +3,6 @@
title: "Documentation"
linkTitle: "Documentation"
weight: 20
menu:
main:
weight: 20
---

Welcome to the Dubbo documentation site!
Expand Down
1 change: 0 additions & 1 deletion content/en/docs3-v2/erlang-sdk/_index.md
Expand Up @@ -5,6 +5,5 @@ title: "Erlang"
linkTitle: "Erlang"
weight: 500
description: "Erlang SDK Manual"
manualLinkRelref: ../../../docs/v3.0/languages/erlang/
---

1 change: 0 additions & 1 deletion content/en/docs3-v2/golang-sdk/_index.md
Expand Up @@ -5,6 +5,5 @@ title: "Golang"
linkTitle: "Golang"
weight: 20
description: "Go SDK Manual"
manualLinkRelref: ../../../docs/v3.0/languages/golang/
---

19 changes: 19 additions & 0 deletions content/en/docs3-v2/java-sdk/_index.md
@@ -0,0 +1,19 @@

---
type: docs
title: "Java"
weight: 10
no_list: true
hide_summary: true
description: "Java SDK Manual"
---

- Quick start:
- [Spring Boot Quick Development Dubbo Service](quick-start/spring-boot/)
- [Configuration Reference Manual](reference-manual/config/)
- Advanced features:
- [Extended Filter, Router to intercept traffic](concepts-and-architecture/service-invocation/)
- Reference book:
- [Registry Configuration Guide](reference-manual/registry/)
- Upgrades and Compatibility:
- [3.0 Migration Guide](upgrades-and-compatibility/)
11 changes: 11 additions & 0 deletions content/en/docs3-v2/java-sdk/advanced-features-and-usage/_index.md
@@ -0,0 +1,11 @@

---
type: docs
title: "Advanced Features"
linkTitle: "Advanced Features"
weight: 4
no_list: true
hide_summary: true
description: "The following is a list of all functions supported by Dubbo, browse directly on this page or view them by category on the left menu."
---

@@ -0,0 +1,8 @@

---
type: docs
title: "Others"
linkTitle: "Others"
weight: 5
---

@@ -0,0 +1,70 @@
---
type: docs
title: "Kubernetes Probe"
linkTitle: "Kubernetes Probe"
weight: 5
description: "Understand the extension and application scenarios of Dubbo3 and Kubernetes life cycle alignment probe"
---

## Feature description
[Pod lifecycle](https://kubernetes.io/zh/docs/concepts/workloads/pods/pod-lifecycle/) is closely related to service scheduling. Through the implementation of official Kubernetes probes, Dubbo3 and even the entire application can The life cycle of the Pod and the life cycle of the Pod. In the entire life cycle of the Pod, only the health check part of the Pod is affected. We can configure the liveness probe (survival probe) and readiness probe (readability probe) to Affects the life cycle of the container.

Through the SPI mechanism of Dubbo3, various "probes" are implemented internally, based on the HTTP service of the Dubbo3 QOS operation and maintenance module, so that the container probe can obtain the status of the corresponding probe in the application. In addition, the implementation mechanism of SPI is also conducive to users' self-expanding of internal "probes", so that the entire application life cycle can be more effectively controlled.

**SPI interfaces corresponding to the three probes**

- livenessProbe: `org.apache.dubbo.qos.probe.LivenessProbe`
- readinessProbe: `org.apache.dubbo.qos.probe.ReadinessProbe`
- startupProbe: `org.apache.dubbo.qos.probe.StartupProbe`

The interface will automatically obtain the implementation of all SPIs of the current application, and the interface will return success if the SPI implementations of the corresponding interface are successfully ready.

For an introduction to more extensions of Dubbo3 SPI, see [Dubbo SPI Extensions](/en/docs3-v2/java-sdk/reference-manual/spi/description/)

## scenes to be used
- kubelet uses `liveness probe` to determine if your application is running, to see if it is alive. Generally speaking, if your program crashes, Kubernetes will immediately know that the program has terminated, and then restart the program. The purpose of our liveness probe is to capture that the current application has not terminated or crashed. If these situations occur, restart the container in this state so that the application can still continue in the presence of bugs run down.
- The kubelet uses `readiness probe` to determine if the container is ready to receive traffic. Is it ready and ready to work now. Only when the containers in the Pod are all in the ready state, the kubelet will consider the Pod to be in the ready state, because there may be multiple containers under a Pod. If the Pod is not ready, we will remove it from the Service's Endpoints list, so that our traffic will not be routed to the Pod.

## How to use

### Survival detection

For the livenessProbe liveness detection, since the Dubbo3 framework itself cannot obtain the liveness status of the application, this interface has no default implementation and returns success by default. Developers can expand this SPI interface according to the SPI definition, and judge whether it is alive or not from the application level.

About [liveness liveness probe](../../../reference-manual/spi/description/liveness/) extension example
### Readiness check

For the readinessProbe readiness detection, Dubbo3 currently provides two detection dimensions by default. One is to judge whether the Dubbo3 service itself is started or stopped, and the other is to check whether all services have registered interfaces. If all services have been offline from the registration center (you can Operate via QOS Operations) will return Not Ready.

About the [readiness readiness probe](../../../reference-manual/spi/description/readiness/) extended example

### Start detection

For startupProbe startup detection, Dubbo3 currently provides a detection dimension by default, which is to return to the ready state after all startup processes (interface exposure, registration center writing, etc.) are completed.

About the [startup startup probe](../../../reference-manual/spi/description/startup/) extended example

### Reference example
```yaml
livenessProbe:
httpGet:
path: /live
port: 22222
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
httpGet:
path: /ready
port: 22222
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
httpGet:
path: /startup
port: 22222
failureThreshold: 30
periodSeconds: 10
```
> QOS When the computing node detects memory pressure, kuberentes will BestEffort -> Burstable -> Guaranteed to evict Pods in sequence.
At present, all three probes have corresponding interfaces, and the path is the command in QOS. Please modify the port information according to the QOS configuration (the default port is 22222). For other parameters, please refer to [Kubernetes official documentation](https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).
@@ -0,0 +1,50 @@
---
type: docs
title: "Graceful shutdown"
linkTitle: "Graceful shutdown"
weight: 2
description: "Let the Dubbo service complete graceful shutdown"
---

## Feature description

Graceful shutdown means that the service instance can be stopped safely and smoothly without affecting the ongoing business.
A Dubbo service may be both a service provider and a service consumer. When the service is stopped:
1. Consumers will no longer request stopped service instances
2. The request being processed by the service instance can be processed normally

## scenes to be used

1. Stop the service with `kill PID`
2. Stop the service through `/shutdown` of SpringBoot Actuator

Dubbo 3.0 and above supports different types of Java applications, including SpringBoot applications, Spring applications, and non-Spring applications.

## How to use

Set the graceful shutdown timeout, the default timeout is 10 seconds, if it times out, it will be forced to shut down.
This parameter can be configured in the dubbo.properties file, for example: 30 seconds.
```properties
# Stop service waiting time, unit: milliseconds
dubbo.service.shutdown.wait=30000
```

## Precautions

1. Dubbo uses JDK's ShutdownHook to complete graceful shutdown, so if the user uses `kill -9 PID` and other forced shutdown commands, it will not execute graceful shutdown, and will only execute when `kill PID` is passed.

2. Verify that Dubbo's ShutdownHook is executed. You can find the keyword in the log file: `Run shutdown hook now.`

3. If Spring is used, please upgrade to version 4.2 and above, it is recommended to use version 5 or above

4. If SpringBoot is used, Dubbo's ShutdownHook will be executed before SpringBoot's ShutdownHook,
If you use SpringBoot 2.3 and above, it is recommended to use it with SpringBoot's graceful shutdown, and configure it in the configuration file application.yml:
```yml
server:
shutdown: graceful
```

5. If the ShutdownHook does not take effect, you can call it yourself according to the specific scenario:
```java
ApplicationModel.defaultModel().destroy();
```
@@ -0,0 +1,120 @@
---
type: docs
title: "Log Framework Adaptation and Runtime Management"
linkTitle: "Log framework adaptation and runtime management"
weight: 4
description: "Adapt to the log framework in Dubbo and support dynamic switching of the log framework used at runtime"
---
## Feature description
Adaptation of log frameworks. Since `2.2.1`, dubbo has built-in adaptation of log4j, slf4j, jcl, and jdk log frameworks.

Log framework runtime management, starting from `3.0.10`, dubbo-qos runtime management supports query log configuration and dynamically modify the used log framework and log level.

> The log configuration modified by dubbo-qos is not stored persistently, and will become invalid after the application is restarted.
## scenes to be used

## How to use
## Log framework adaptation
The logging output policy can be explicitly configured in the following ways

### 1. Command line

```sh
java -Ddubbo.application.logger=log4j
```

### 2. Specify in `dubbo.properties`

```
dubbo.application.logger=log4j
```

### 3. Configuration in `dubbo.xml`

```xml
<dubbo:application logger="log4j" />
```

For custom extensions, please refer to [Log Adapter Extension](../../../reference-manual/spi/description/logger-adapter)

## Logging framework runtime management
### 1. Query log configuration

Command: `loggerInfo`

**example**
```bash
> telnet 127.0.0.1 22222
> loggerInfo
```

**output**
```
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
___ __ __ ___ ___ ____
/ _ \ / / / // _ ) / _ ) / __ \
/ // // /_/ // _ |/ _ |/ /_/ /
/____/ \____//____//____/ \____/
dubbo>loggerInfo
Available logger adapters: [jcl, jdk, log4j, slf4j]. Current Adapter: [log4j]. Log level: INFO
```

### 2. Modify log level

Command: `switchLogLevel {level}`

level: `ALL`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF`

**example**
```bash
> telnet 127.0.0.1 22222
> switchLogLevel WARN
```

**output**
```
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
___ __ __ ___ ___ ____
/ _ \ / / / // _ ) / _ ) / __ \
/ // // /_/ // _ |/ _ |/ /_/ /
/____/ \____//____//____/ \____/
dubbo>loggerInfo
Available logger adapters: [jcl, jdk, log4j, slf4j]. Current Adapter: [log4j]. Log level: INFO
dubbo>switchLogLevel WARN
OK
dubbo>loggerInfo
Available logger adapters: [jcl, jdk, log4j, slf4j]. Current Adapter: [log4j]. Log level: WARN```
```
### 3. Modify the log output framework
Command: `switchLogger {loggerAdapterName}`
loggerAdapterName: `slf4j`, `jcl`, `log4j`, `jdk`, `log4j2`
**example**
```bash
> telnet 127.0.0.1 22222
> switchLogger slf4j
```

**output**
```
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
___ __ __ ___ ___ ____
/ _ \ / / / // _ ) / _ ) / __ \
/ // // /_/ // _ |/ _ |/ /_/ /
/____/ \____//____//____/ \____/
dubbo>loggerInfo
Available logger adapters: [jcl, slf4j, log4j, jdk]. Current Adapter: [log4j]. Log level: INFO
dubbo>switchLogger slf4j
OK
dubbo>loggerInfo
Available logger adapters: [jcl, slf4j, log4j, jdk]. Current Adapter: [slf4j]. Log level: INFO
```

0 comments on commit 95a9f4f

Please sign in to comment.