Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #4710] Rewrite the quick start guide for the home page. #4709

Merged
merged 36 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 12 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ This section guide is just to help you quickly get started with EventMesh deploy
### Deployment Event Store

> EventMesh now supports multiple [Event Store](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status).The default storage mode is `standalone`.
> If you are in non-`standalone` mode, you need to deploy the required `store` first, using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/).
>
> If you are in non-`standalone` mode, you need to deploy the required `store` first, using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/).

### Run EventMesh Runtime locally

#### 1.Download EventMesh:
#### 1. Download EventMesh:

Download the latest version of the Binary Distribution from the [EventMesh Download](https://eventmesh.apache.org/download/) page and extract it:
```
Expand All @@ -80,18 +81,7 @@ tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz
cd apache-eventmesh-1.10.0
```

#### 2.Run EventMesh:

Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. The executable binaries contain all plugins in the bundle, thus there's no need to build them from source code.
```
vim conf/eventmesh.properties
```

Specify RocketMQ as Event Store(The default is standalone.):
```
# storage plugin
eventMesh.storage.plugin.type=rocketmq
```
#### 2. Run EventMesh:

Execute the `start.sh` script to start the EventMesh Runtime server.
```
Expand All @@ -114,7 +104,7 @@ When the script prints `shutdown server ok!`, it means EventMesh Runtime has sto

### Run EventMesh Runtime in Docker

#### 1.Pull EventMesh Image
#### 1. Pull EventMesh Image

Download the pre-built image of [EventMesh](https://hub.docker.com/r/apache/eventmesh) from Docker Hub with docker pull:
```
Expand All @@ -128,85 +118,22 @@ REPOSITORY TAG IMAGE ID CREATED SIZE
apache/eventmesh latest f32f9e5e4694 2 days ago 917MB
```

#### 2.Edit Configuration

If you are starting EventMesh Runtime in standalone mode and haven't customized the configuration, you can proceed to the next step.

First, create the EventMesh configuration file directory on the host machine. This directory can be freely specified:
```
sudo mkdir -p /data/eventmesh/conf
cd /data/eventmesh/conf
```

#### 3.Configure `eventmesh.properties`

This configuration file includes parameters required for the EventMesh Runtime environment and integration with other plugins.

Download the configuration file (replace `1.10.0` in the download link with the version you are using):

```
sudo wget https://raw.githubusercontent.com/apache/eventmesh/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties
```

Edit `eventmesh.properties`:
```
sudo vim eventmesh.properties
```

Specify RocketMQ as Event Store(The default is standalone):
```
# storage plugin
eventMesh.storage.plugin.type=rocketmq
```

Please check if the default port in the configuration file is occupied, if it is occupied please change it to an unoccupied port:

| Configuration Key | Default Value | Description |
|------------------------------------|---------------|------------------------------|
| `eventMesh.server.http.port` | `10105` | `EventMesh http server port` |
| `eventMesh.server.tcp.port` | `10000` | `EventMesh tcp server port` |
| `eventMesh.server.grpc.port` | `10205` | `EventMesh grpc server port` |
| `eventMesh.server.admin.http.port` | `10106` | `HTTP management port` |

#### 4.Configure `rocketmq-client.properties`

In the case of RocketMQ, the configuration file includes parameters required to connect to the RocketMQ namesrv.

Download the configuration file (replace 1.10.0 in the download link with the version you are using):
```
sudo wget https://raw.githubusercontent.com/apache/eventmesh/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties
```

Edit `rocketmq-client.properties`:
```
sudo vim rocketmq-client.properties
```

> Note that if the `nameserver` address you are running is not the default in the configuration file, change it to the `nameserver` address that is actually running.

Please check if the `default namesrvAddr` in the configuration file is occupied, if it is occupied please change it to an unoccupied address:

| Configuration Key | Default Value | Description |
|-----------------------------------------|---------------------------------|------------------------------------|
| `eventMesh.server.rocketmq.namesrvAddr` | `127.0.0.1:9876;127.0.0.1:9876` | `RocketMQ namesrv default address` |

#### 5.Run and Manage EventMesh Container
#### 2. Run and Manage EventMesh Container

Run an EventMesh container from the `apache/eventmesh` image with the `docker run` command.

- The `-p` option of the command binds the container port with the host machine port.
- The `-v` option of the command mounts the configuration files from files in the host machine.

Use the following command to start the EventMesh container:
```
sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -v /data/eventmesh/conf/eventmesh.properties:/data/app/eventmesh/conf/eventmesh.properties -v /data/eventmesh/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties -t apache/eventmesh:latest
sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -t apache/eventmesh:latest
```

The docker ps command lists the details (id, name, status, etc.) of the running containers. The container id is the unique identifier of the container.
The `docker ps` command lists the details (id, name, status, etc.) of the running containers. The container id is the unique identifier of the container.
```
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b7a1546ee96a apache/eventmesh:latest "bash bin/start.sh" 10 seconds ago Up 8 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105-10106->10105-10106/tcp, :::10105-10106->10105-10106/tcp, 0.0.0.0:10205->10205/tcp, :::10205->10205/tcp eventmesh
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c08130ee797 apache/eventmesh:latest "bash bin/start.sh" 9 seconds ago Up 8 seconds 0.0.0.0:10000->10000/tcp, 0.0.0.0:10105-10106->10105-10106/tcp, 0.0.0.0:10205->10205/tcp eventmesh
```

To read the log of the EventMesh container:
Expand All @@ -217,7 +144,7 @@ tail -n 50 -f eventmesh.out

### Run EventMesh Runtime in Kubernetes

#### 1.Deploy operator
#### 1. Deploy operator

Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`):
```
Expand All @@ -235,7 +162,7 @@ connectors.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z
runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z
```

#### 2.Execute the following command to deploy runtime, connector(To delete, simply replace `create` with `delete`).
#### 2. Execute the following command to deploy runtime, connector(To delete, simply replace `create` with `delete`).

```
make create
Expand Down
107 changes: 12 additions & 95 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,17 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以

本节指南将指导您分别从[本地](#在本地运行-eventmesh-runtime)、[Docker](#在-docker-中运行-eventmesh-runtime)、[K8s](#在-kubernetes-中运行-eventmesh-runtime)部署EventMesh的步骤:

本节指南只是帮助您快速入门 EventMesh 部署,按照默认配置启动 EventMesh,如果您需要更加详细的 EventMesh 部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。
本节指南按照默认配置启动 EventMesh,如果您需要更加详细的 EventMesh 部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。

### 部署 Event Store

> EventMesh 现在支持多个[事件存储](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status),默认存储模式为 `standalone`
>
> 如果是在非`standalone`模式下,需要先部署所需的`store`,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/)

### 在本地运行 EventMesh Runtime

#### 1.下载
#### 1. 下载

从 [EventMesh Download](https://eventmesh.apache.org/download/) 页面下载最新版本的 Binary Distribution 发行版并解压:
```
Expand All @@ -85,17 +86,6 @@ cd apache-eventmesh-1.10.0

#### 2. 运行

编辑`eventmesh.properties`以更改 EventMesh Runtime 的配置(如 TCP 端口、客户端黑名单)。
```
vim conf/eventmesh.properties
```

指定事件存储为 RocketMQ(默认为standalone):
```
# storage plugin
eventMesh.storage.plugin.type=rocketmq
```

执行 `start.sh` 脚本启动 EventMesh Runtime 服务器。
```
bash bin/start.sh
Expand All @@ -117,104 +107,31 @@ bash bin/stop.sh

### 在 Docker 中运行 EventMesh Runtime

#### 1.获取 EventMesh 镜像
#### 1. 获取 EventMesh 镜像

首先,你可以打开一个命令行,并且使用下面的 `pull` 命令从 [Docker Hub](https://hub.docker.com) 中下载最新发布的 [EventMesh](https://hub.docker.com/r/apache/eventmesh)。
```
sudo docker pull apache/eventmesh:latest
```

您可以使用以下命令列出并查看本地已有的镜像。
```
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apache/eventmesh latest f32f9e5e4694 2 days ago 917MB
```

#### 2.创建配置文件

如果您使用 standalone 模式启动 EventMesh Runtime,并且没有自定义配置,可以跳转至下一步骤。

首先,在宿主机上创建 EventMesh 的配置文件目录。此目录可以自由指定:
```
sudo mkdir -p /data/eventmesh/conf
cd /data/eventmesh/conf
```

#### 3.配置 `eventmesh.properties`

这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。

下载配置文件(替换下载链接中的 `1.10.0` 为您正在使用的版本)
```
sudo wget https://raw.githubusercontent.com/apache/eventmesh/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties
```

使用下面的 `vim` 命令编辑 `eventmesh.properties`。
```
sudo vim eventmesh.properties
```

指定事件存储为 RocketMQ (默认为 standalone):
```
# storage plugin
eventMesh.storage.plugin.type=rocketmq
```

请检查配置文件里的默认端口是否已被占用,如果被占用请修改成未被占用的端口:

| 属性 | 默认值 | 备注 |
|------------------------------------|---------|------------------------------|
| `eventMesh.server.http.port` | `10105` | `EventMesh http server port` |
| `eventMesh.server.tcp.port` | `10000` | `EventMesh tcp server port` |
| `eventMesh.server.grpc.port` | `10205` | `EventMesh grpc server port` |
| `eventMesh.server.admin.http.port` | `10106` | `HTTP management port` |

#### 4.配置 `rocketmq-client.properties`

这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。

下载配置文件(替换下载链接中的 `1.10.0` 为您正在使用的版本)
```
sudo wget https://raw.githubusercontent.com/apache/eventmesh/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties
```

使用下面的 `vim` 命令编辑 `rocketmq-client.properties`。
```
sudo vim rocketmq-client.properties
```

> 请注意,如果您正在运行的 namesrv 地址不是配置文件中的默认值,请将其修改为实际正在运行的 namesrv 地址。

请检查配置文件里的默认namesrvAddr是否已被占用,如果被占用请修改成未被占用的地址:

| 属性 | 默认值 | 备注 |
|-----------------------------------------|---------------------------------|------------------------------------|
| `eventMesh.server.rocketmq.namesrvAddr` | `127.0.0.1:9876;127.0.0.1:9876` | `RocketMQ namesrv default address` |

#### 5.运行EventMesh
#### 2. 运行EventMesh

现在你就可以开始根据下载好的EventMesh镜像运行容器了。

使用到的命令是 `docker run`,有以下两点内容需要格外注意。
使用到的命令是 `docker run`。

- 绑定容器端口和宿主机端口: 使用 `docker run` 的 `-p` 选项。
- 将宿主机中的两份配置文件挂在到容器中: 使用 `docker run` 的 `-v` 选项。

综合一下,对应的启动命令为:
```
sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -v /data/eventmesh/conf/eventmesh.properties:/data/app/eventmesh/conf/eventmesh.properties -v /data/eventmesh/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties -t apache/eventmesh:latest
```

接下来,你可以使用下面的命令查看容器的状态。
```
sudo docker ps
sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -t apache/eventmesh:latest
```

如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。
```
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5bb6b6092672 apache/eventmesh:latest "/bin/sh -c 'sh star…" 6 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105-10106->10105-10106/tcp, :::10105-10106->10105-10106/tcp, 0.0.0.0:10205->10205/tcp, :::10205->10205/tcp eventmesh
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c08130ee797 apache/eventmesh:latest "bash bin/start.sh" 9 seconds ago Up 8 seconds 0.0.0.0:10000->10000/tcp, 0.0.0.0:10105-10106->10105-10106/tcp, 0.0.0.0:10205->10205/tcp eventmesh
```

读取 EventMesh 容器的日志:
Pil0tXia marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -225,7 +142,7 @@ tail -n 50 -f eventmesh.out

### 在 Kubernetes 中运行 EventMesh Runtime

1.部署 Operator
#### 1. 部署 Operator

运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy` 即可):
```
Expand All @@ -243,7 +160,7 @@ connectors.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z
runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z
```

2.运行以下命令部署 runtime、connector (删除部署, 只需将 `create` 替换为 `delete` 即可).
#### 2. 运行以下命令部署 runtime、connector (删除部署, 只需将 `create` 替换为 `delete` 即可).
```
make create
```
Expand Down
Loading