Skip to content

Commit

Permalink
doc: update documents for consolidated scheduling strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
D-D-H committed Mar 2, 2024
1 parent f00c273 commit b4787d9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 63 deletions.
1 change: 0 additions & 1 deletion cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ spec:
value: password
args:
- --jifa.role=master
- --jifa.scheduling-strategy=elastic
- --jifa.storage-pvc-name=jifa-pvc
- --jifa.storage-path=/jifa-storage
- --jifa.service-account-name=jifa-service-account
Expand Down
25 changes: 7 additions & 18 deletions site/docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,61 +70,50 @@ Type:String

Default:Read from the environment variable `MYSQL_PASSWORD`, and `jifa` is used if it's not set.

## scheduling-strategy

The scheduling strategy.

Type: Enum

- `STATIC`
- `ELASTIC`

Default: null

## storage-pvc-name

The name of PersistentVolumeClaim used in an elastic cluster.
The name of PersistentVolumeClaim used in the cluster.

Type: String

Default: null

## service-account-name

The name of ServiceAccount used in an elastic cluster.
The name of ServiceAccount used in the cluster.

Type: String

Default: null

## elastic-worker-image

Docker image used in an elastic cluster to run `WORKER` nodes.
Docker image used in the cluster to run `ELASTIC_WORKER` nodes.

Type: String

Default: null

## elastic-worker-jvm-options

JVM options used by `WORKER` nodes in an elastic cluster
JVM options used by `ELASTIC_WORKER` nodes in the cluster

Type:String

Default:null

## elastic-worker-port

The service port of `WORKER` nodes in an elastic cluster.
The service port of `ELASTIC_WORKER` nodes in the cluster.

Type: int

Default: 8102

## elastic-worker-idle-threshold

The idle threshold of `WORKER` nodes in an elastic cluster, in minutes, with a minimum value of 2. When a `WORKER` node
is idle for more than this threshold, it will automatically stop.
The idle threshold of `ELASTIC_WORKER` nodes in the cluster, in minutes, with a minimum value of 2. When
a `ELASTIC_WORKER` node is idle for more than this threshold, it will automatically stop.

Type: int

Expand Down
19 changes: 6 additions & 13 deletions site/docs/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,17 @@ In cluster mode, users need to prepare a MySQL database.

There are two types of roles:

- `MASTER`: is responsible for receiving analysis requests and forwarding to `WORKER` nodes.
- `MASTER`: is responsible for receiving analysis requests and forwarding to worker nodes.
- `STATIC_WORKER`: is responsible for processing analysis requests.
- `ELASTIC_WORKER`: is responsible for processing analysis requests.

- `WORKER`: is responsible for processing analysis requests.

Based on different scheduling strategies, the cluster is divided into two types:

- Elastic Cluster: `WORKER` nodes are scheduled on-demand. Users need to prepare a K8S cluster. The role of `WORKER`
nodes is `ELASTIC_WORKER`.

- Static Cluster: `WORKER` nodes need to be started in advance. The `role` of `WORKER` nodes is `STATIC_WORKER`.

### Elastic Cluster
### Deploy a Cluster

Refer to [cluster.yml](https://github.com/eclipse/jifa/blob/main/cluster.yml).

Command: `kubectl apply -f cluster.yml`

### Static Cluster
### Deploy a Static Cluster (only contains master nodes and static worker nodes)

The first two steps are the same as standalone mode.

Expand All @@ -53,7 +46,7 @@ The first two steps are the same as standalone mode.
$ export MYSQL_USER=<username>
$ export MYSQL_PASSWORD=<password>

$ ./jifa/bin/jifa --jifa.role=master --jifa.scheduling-strategy=static
$ ./jifa/bin/jifa --jifa.role=master
```

- Launch `STATIC_WORKER` nodes
Expand Down
23 changes: 6 additions & 17 deletions site/docs/zh/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,60 +69,49 @@

默认值:从环境变量 `MYSQL_PASSWORD` 中读取,若未设置则为 `jifa`

## scheduling-strategy

调度策略。

类型:Enum

- `ELASTIC`
- `STATIC`

默认值:null

## storage-pvc-name

弹性集群中使用的 PersistentVolumeClaim 名称。
集群中使用的 PersistentVolumeClaim 名称。

类型:String

默认值:null

## service-account-name

弹性集群中使用的 ServiceAccount 名称。
集群中使用的 ServiceAccount 名称。

类型: String

默认值: null

## elastic-worker-image

弹性集群中用于运行 `WORKER` 节点的镜像。
集群中用于运行 `WORKER` 节点的镜像。

类型:String

默认值:null

## elastic-worker-jvm-options

弹性集群中用于设置 `WORKER` 节点的 JVM 参数。
集群中用于设置 `ELASTIC_WORKER` 节点的 JVM 参数。

类型:String

默认值:null

## elastic-worker-port

弹性集群中 `WORKER` 节点的服务监听端口。
集群中 `ELASTIC_WORKER` 节点的服务监听端口。

类型:int

默认值:8102

## elastic-worker-idle-threshold

弹性集群中 `WORKER` 节点的空闲时间阈值,单位为分钟,最小值为 2。当一个 WORKER 节点的空闲时间超过此值时,将会自动停止。
集群中 `ELASTIC_WORKER` 节点的空闲时间阈值,单位为分钟,最小值为 2。当一个 `ELASTIC_WORKER` 节点的空闲时间超过此值时,将会自动停止。

类型:int

Expand Down
22 changes: 8 additions & 14 deletions site/docs/zh/guide/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,24 @@

集群模式需要准备一个 MySQL 数据库。

集群中有两类运行角色
集群中有三类运行角色

- `MASTER`:主节点,负责接收分析请求,并将请求转发到相应的 `WORKER`
- `WORKER`:工作节点,负责处理分析请求。

根据调度策略的不同,集群分为:

- 弹性集群:`WORKER` 节点按需调度。用户需要准备一个 K8S 集群。`WORKER` 节点的 `role``ELASTIC_WORKER`
- 静态集群:需要事先启动 `WORKER` 节点。`WORKER` 节点的 `role``STATIC_WORKER`
- `MASTER`:主节点,负责接收分析请求,并将请求转发到相应的工作节点。
- `STATIC_WORKER`:静态工作节点,负责处理分析请求。
- `ELASTIC_WORKER`:弹性工作节点,负责处理分析请求。

适用场景:

- 搭建平台供多个团队使用,且有较多的机器资源。
- 与其他系统进行集成。

### 弹性集群的部署步骤
### 部署集群

可参考 [cluster.yml](https://github.com/eclipse/jifa/blob/main/cluster.yml)

命令:`kubectl apply -f cluster.yml`

### 静态集群的部署步骤
### 部署静态集群(仅包含主节点和静态工作节点)

构建和解压步骤和单机模式一样。

Expand All @@ -55,11 +51,10 @@
$ export MYSQL_USER=<username>
$ export MYSQL_PASSWORD=<password>

# 启动 MASTER,将调度策略设置为 static
$ ./jifa/bin/jifa --jifa.role=master --jifa.scheduling-strategy=static
$ ./jifa/bin/jifa --jifa.role=master
```

- 启动 `STATIC_WORKER` 节点
- 启动一个或多个 `STATIC_WORKER` 节点

```shell
# 设置数据库环境变量
Expand All @@ -68,6 +63,5 @@
$ export MYSQL_USER=<username>
$ export MYSQL_PASSWORD=<password>

# 启动 STATIC_WORKER
$ ./jifa/bin/jifa --jifa.role=static_worker
```

0 comments on commit b4787d9

Please sign in to comment.