Skip to content

Commit

Permalink
add doc and fix package
Browse files Browse the repository at this point in the history
  • Loading branch information
xdu-chenrj committed Oct 17, 2024
1 parent 006581a commit 46e9db3
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 5 deletions.
55 changes: 55 additions & 0 deletions docs/docs/en/guide/installation/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,61 @@ If you are a new hand and want to experience DolphinScheduler functions, we reco

Cluster deployment uses the same scripts and configuration files as [pseudo-cluster deployment](pseudo-cluster.md), so the preparation and deployment steps are the same as pseudo-cluster deployment. The difference is that pseudo-cluster deployment is for one machine, while cluster deployment (Cluster) is for multiple machines. And steps of "Modify Configuration" are quite different between pseudo-cluster deployment and cluster deployment.

## Enable SSL (optional)
In cluster deployment, you can enable SSL authentication. Secure Sockets Layer, SSL, abbreviated as SSL, is a secure protocol that encrypts transmitted data to ensure that information is not eavesdropped or tampered with during transmission. In addition, it can authenticate servers and ensure data integrity.

To enable SLL authentication, you have two things to do. Firstly, you need to generate `cert.crt` and `private.pem` files.

Step 1: Install OpenSSL

Firstly, ensure that you have installed OpenSSL. In most Linux distributions, OpenSSL is usually pre installed. If not, you can install it using the following command:

On Ubuntu/Debian:
```bash
sudo apt-get install openssl
```

On CentOS/RHEL:
```bash
sudo yum install openssl
```
Step 2: Generate private key (private.pem)

Open the terminal and run the following command to generate a private key:

```bash
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
```

This command will generate a 2048 bit RSA private key and save it as a private.pem file.

Step 3: Generate Certificate Signing Request (CSR)

Before generating a certificate, you need to generate a Certificate Signing Request (CSR). Run the following command:

```bash
openssl req -new -key private.pem -out request.csr
```
This command will prompt you to enter some information, such as country, state/province, organization name, etc. The information you input will be embedded into the generated certificate.

Step 4: Generate a self signed certificate (cert.crt)

Use CSR to generate self signed certificates. Run the following command:
```bash
openssl x509 -req -days 365 -in request.csr -signkey private.pem -out cert.crt
```
This command will generate a self signed certificate with a validity period of 365 days and save it as a cert.crt file.

Then modify the `application.yaml` file in the `dolphinscheduler-master`, `dolphinscheduler-worker`, and `dolphinscheduler-api` modules.
```yaml
rpc:
ssl:
enabled: true
cert-file-path: /path/cert.crt
key-file-path: /path/private.pem
```
You need to change `enabled` to `true` and configure the file routing for `cert-file-path` and `key-file-path`.

### Prerequisites and DolphinScheduler Startup Environment Preparations

Distribute the installation package to each server of each cluster and perform all the steps in [pseudo-cluster deployment](pseudo-cluster.md) on each machine.
Expand Down
59 changes: 59 additions & 0 deletions docs/docs/zh/guide/installation/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,65 @@

集群部署(Cluster)使用的脚本和配置文件与[伪集群部署](pseudo-cluster.md)中的配置一样,所以所需要的步骤也与伪集群部署大致一样。区别就是伪集群部署针对的是一台机器,而集群部署(Cluster)需要针对多台机器,且两者“修改相关配置”步骤区别较大

### 开启SSL(可选)
在集群部署中,你可以开启SSL认证。Secure Sockets Layer,缩写作 SSL,是一种安全协议,能够加密传输的数据,确保在数据传输过程中,信息不会被窃听或篡改,此外还可以对服务器进行身份验证以及保障数据的完整性。

开启SLL认证,你有两件事要做。 首先你需要生成`cert.crt``private.pem`文件。

步骤1:安装 OpenSSL

首先,确保您已经安装了 OpenSSL。在大多数 Linux 发行版中,OpenSSL 通常已预装。如果没有,您可以通过以下命令安装它:

在 Ubuntu/Debian 上:

```bash
sudo apt-get install openssl
```

在 CentOS/RHEL 上:

```bash
sudo yum install openssl
```

步骤 2:生成私钥(private.pem)

打开终端并运行以下命令生成私钥:

```bash
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
```
此命令会生成一个 2048 位的 RSA 私钥,并将其保存为 private.pem 文件。

步骤 3:生成证书签署请求(CSR)

在生成证书之前,您需要生成一个证书签署请求(CSR)。运行以下命令:

```bash
openssl req -new -key private.pem -out request.csr
```
此命令会提示您输入一些信息,例如国家、州/省、组织名等。您输入的信息将会嵌入到生成的证书中。

步骤 4:生成自签名证书(cert.crt)

使用 CSR 来生成自签名证书。运行以下命令:

```bash
openssl x509 -req -days 365 -in request.csr -signkey private.pem -out cert.crt
```
此命令会生成一个有效期为 365 天的自签名证书,并将其保存为 cert.crt 文件。

然后修改`dolphinscheduler-master``dolphinscheduler-worker``dolphinscheduler-api`模块中的`application.yaml`文件。
```yaml
rpc:
ssl:
enabled: true
cert-file-path: /path/cert.crt
key-file-path: /path/private.pem
```
您需要将`enabled`改为`true`,同时将配置`cert-file-path`和`key-file-path`的文件路劲。


### 前置准备工作 && 准备 DolphinScheduler 启动环境

需要将安装包分发至每台集群的每台服务器上,并且需要在每台机器中进行配置执行[伪集群部署](pseudo-cluster.md)中的所有执行项
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.dolphinscheduler.e2e.cases.tasks;
package org.apache.dolphinscheduler.e2e.cases.ssl;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -42,7 +42,7 @@
import org.junitpioneer.jupiter.DisableIfTestFails;

@TestMethodOrder(MethodOrderer.MethodName.class)
@DolphinScheduler(composeFiles = "docker/gluster-test/docker-compose.yaml")
@DolphinScheduler(composeFiles = "docker/ssl-test/docker-compose.yaml")
@DisableIfTestFails
public class SslShellTaskE2ETest extends BaseWorkflowE2ETest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ public class NettyServerConfig {
*/
private int listenPort;

/**
* nettySslConfig
*/
@Builder.Default
private NettySslConfig nettySslConfig = new NettySslConfig();
}

0 comments on commit 46e9db3

Please sign in to comment.