From d0b125d6b95b339d17929ebfa072a805046a0b87 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Tue, 2 Jan 2024 11:28:39 +0800 Subject: [PATCH 01/36] operator quick start link --- README.md | 4 ++++ README.zh-CN.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 5f21912972..6281fdf1ac 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ Here are the guidelines: [Step 3: Run our demos](https://eventmesh.apache.org/docs/instruction/demo) +[Step 4: EventMesh-Operator quick start](https://eventmesh.apache.org/docs/next/instruction/operator) + Besides, we also provide the docker-version guidelines for you if you prefer Docker: [Step 1: Deploy eventmesh-store using docker](https://eventmesh.apache.org/docs/instruction/store-with-docker) @@ -75,6 +77,8 @@ Besides, we also provide the docker-version guidelines for you if you prefer Doc [Step 3: Run our demos](https://eventmesh.apache.org/docs/instruction/demo) +[Step 4: EventMesh-Operator quick start](https://eventmesh.apache.org/docs/next/instruction/operator) + ## Contributing Each contributor has played an important role in promoting the robust development of Apache EventMesh. We sincerely appreciate all contributors who have contributed code and documents. diff --git a/README.zh-CN.md b/README.zh-CN.md index d5febb2655..8e812a2eda 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -71,6 +71,8 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 [第3步: 运行示例](https://eventmesh.apache.org/docs/instruction/demo) +[第4步:EventMesh-Operator快速开始](https://eventmesh.apache.org/docs/next/instruction/operator/) + 另外,如果您更喜欢使用Docker,则我们还为您提供了Docker版本的指南: [第1步: 使用Docker部署EventMesh Store](https://eventmesh.apache.org/docs/instruction/store-with-docker) @@ -79,6 +81,8 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 [第3步: 运行示例](https://eventmesh.apache.org/docs/instruction/demo) +[第4步:EventMesh-Operator快速开始](https://eventmesh.apache.org/docs/next/instruction/operator/) + ## 贡献 每个贡献者在推动 Apache EventMesh 的健康发展中都发挥了重要作用。我们真诚感谢所有为代码和文档作出贡献的贡献者。 From 618de76b6219dbef5f0ef74bbeb9be8ae54bf562 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Tue, 2 Jan 2024 11:33:19 +0800 Subject: [PATCH 02/36] update --- README.zh-CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 8e812a2eda..b5ca23523c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -71,7 +71,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 [第3步: 运行示例](https://eventmesh.apache.org/docs/instruction/demo) -[第4步:EventMesh-Operator快速开始](https://eventmesh.apache.org/docs/next/instruction/operator/) +[第4步:EventMesh-Operator快速入门](https://eventmesh.apache.org/docs/next/instruction/operator/) 另外,如果您更喜欢使用Docker,则我们还为您提供了Docker版本的指南: @@ -81,7 +81,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 [第3步: 运行示例](https://eventmesh.apache.org/docs/instruction/demo) -[第4步:EventMesh-Operator快速开始](https://eventmesh.apache.org/docs/next/instruction/operator/) +[第4步:EventMesh-Operator快速入门](https://eventmesh.apache.org/docs/next/instruction/operator/) ## 贡献 From a691e9858b587c1d1b2ddc552d7d0ed7e4b43826 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 3 Jan 2024 11:26:37 +0800 Subject: [PATCH 03/36] README.zh-CN.md --- README.zh-CN.md | 591 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 570 insertions(+), 21 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index b5ca23523c..36c50a16cd 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -61,27 +61,576 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 - [EventMesh-catalog](https://github.com/apache/eventmesh-catalog): 使用 AsyncAPI 进行事件模式管理的目录服务。 - [EventMesh-go](https://github.com/apache/eventmesh-go): EventMesh 运行时的 Go 语言实现。 -## 快速开始 - -指南: - -[第1步: 部署EventMesh Store](https://eventmesh.apache.org/docs/instruction/store) - -[第2步: 启动EventMesh Runtime](https://eventmesh.apache.org/docs/instruction/runtime) - -[第3步: 运行示例](https://eventmesh.apache.org/docs/instruction/demo) - -[第4步:EventMesh-Operator快速入门](https://eventmesh.apache.org/docs/next/instruction/operator/) - -另外,如果您更喜欢使用Docker,则我们还为您提供了Docker版本的指南: - -[第1步: 使用Docker部署EventMesh Store](https://eventmesh.apache.org/docs/instruction/store-with-docker) - -[第2步: 使用Docker启动EventMesh Runtime](https://eventmesh.apache.org/docs/instruction/runtime-with-docker) - -[第3步: 运行示例](https://eventmesh.apache.org/docs/instruction/demo) - -[第4步:EventMesh-Operator快速入门](https://eventmesh.apache.org/docs/next/instruction/operator/) +## 快速入门 +本段指南将指导您完成EventMesh的部署步骤 +- [部署EventMesh Store](#部署eventmesh-store) + - [本地部署EventMesh Store](#本地部署eventmesh-store) + - [使用Docker部署EventMesh Store](#使用docker部署eventmesh-store) +- [部署EventMesh Runtime](#部署eventmesh-runtime) + - [本地构建运行](#本地构建运行) + - [源码启动](#1源码启动-) + - [本地二进制构建](#2-本地二进制构建) + - [远程部署](#远程部署) + - [Docker部署EventMesh Runtime](#docker部署eventmesh-runtime以140版本为例) +- [eventmesh-sdk-java demo](#eventmesh-sdk-java-demo-) + - [TCP](#1tcp-) + - [HTTP](#2http) + - [GRPC](#3grpc) + - [测试](#4测试-) +- [运行EventMesh-Operator](#运行eventmesh-operator) + - [本地源码运行](#本地源码运行) + +### 部署EventMesh Store +开始之前需要准备以下环境: +``` +建议使用64位操作系统,建议使用Linux/Unix; +64位JDK 1.8+; +Gradle至少为7.0, 推荐7.0.* +4g+可用磁盘用于eventmesh-store服务器 +eventmesh在非standalone模式下,依赖RocketMQ作为存储层;若采用standalone模式,则可跳过该步,直接进行runtime的部署 +``` +#### 本地部署EventMesh Store + +##### 1) 下载 +从[RocketMQ官方网站](https://rocketmq.apache.org/download/)下载Binary代码(推荐使用4.9.*版本),这里以4.9.4为例: +``` +unzip rocketmq-all-4.9.4-bin-release.zip +cd rocketmq-all-4.9.4-bin-release/ +``` +##### 2) 启动 +1.启动Name Server: +``` +nohup sh bin/mqnamesrv & tail -f ~/logs/rocketmqlogs/namesrv.log +``` +如果在看到The Name Server boot success...,则说明Name Server启动成功。 + +2.启动Broker: +``` +nohup sh bin/mqbroker -n localhost:9876 & +tail -f ~/logs/rocketmqlogs/broker.log +``` +如果在看到The broker boot success...,则说明Broker启动成功 + +#### 使用Docker部署EventMesh Store + +##### 1) 拉取镜像 +在命令行输入如下命令直接从 docker hub 上获取 RocketMQ 镜像: +``` +sudo docker pull apache/rocketmq:4.9.4 +``` +您可以使用以下命令列出并查看本地已有的镜像: +``` +sudo docker images +``` +如果终端显示如下所示的镜像信息,则说明 RocketMQ 镜像已经成功下载到本地。 +``` +REPOSITORY TAG IMAGE ID CREATED SIZE +apache/rocketmq 4.9.4 a2a50ca263c3 13 months ago 548MB +``` + +##### 2) 运行容器 +1.运行namerv容器和broker容器: +``` +sudo docker run -d -p 9876:9876 \ + -v `pwd`/data/namesrv/logs:/root/logs \ + -v `pwd`/data/namesrv/store:/root/store \ + --name rmqnamesrv \ + apache/rocketmq:4.9.4 \ + sh mqnamesrv +``` + +2.运行broker容器: +``` +sudo docker run -d -p 10911:10911 -p 10909:10909 \ + -v `pwd`/data/broker/logs:/root/logs \ + -v `pwd`/data/broker/store:/root/store \ + --name rmqbroker \ + --link rmqnamesrv:namesrv \ + -e "NAMESRV_ADDR=namesrv:9876" \ + apache/rocketmq:4.9.4 \ + sh mqbroker -c ../conf/broker.conf +``` +请注意 **rocketmq-broker ip**是**pod ip**, 如果你想修改这个**ip**, 可以通过挂载容器中**broker.conf**文件的方式并修改文件中的**brokerIP1**配置项为自定义值。 + +### 部署EventMesh Runtime +EventMesh Runtime是EventMesh集群中有状态的Mesh节点,负责Source Connector与Sink Connector之间的事件传输,并可以使用EventMesh Storage作为事件的存储队列。 + +#### 本地构建运行 + +依赖准备: +``` +建议使用64位操作系统,建议使用Linux / Unix; +64位JDK 1.8+; +Gradle至少为7.0, 推荐 7.0.* +``` +##### 1)源码启动 + +1.下载源码: +从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。比如目前最新版,您将获得`apache-eventmesh-1.9.0-source.tar.gz`。 + +2.安装插件: + +有两种方式安装插件: + +- classpath加载: 本地开发可以通过在 eventmesh-starter 模块 build.gradle 中进行声明,例如声明使用 rocketmq 插件 +``` +implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") +``` + +- 文件加载: 通过将插件安装到插件目录,EventMesh在运行时会根据条件自动加载插件目录下的插件,可以通过执行以下命令安装插件 +``` +./gradlew clean jar dist && ./gradlew installPlugin +``` + +3.使用插件 +EventMesh 会默认加载 dist/plugin 目录下的插件,可以通过-DeventMeshPluginDir=your_plugin_directory来改变插件目录。运行时需要使用的插件实例可以在 confPath目录下面的eventmesh.properties中进行配置。例如通过以下设置声明在运行时使用rocketmq插件。 +``` +#connector plugin +eventMesh.connector.plugin.type=rocketmq +``` + +4.配置VM启动参数 +``` +-Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml +-Deventmesh.log.home=eventmesh-runtime/logs +-Deventmesh.home=eventmesh-runtime +-DconfPath=eventmesh-runtime/conf +``` +> 注:如果操作系统为Windows, 可能需要将文件分隔符换成'\' + +5.启动运行 +``` +运行org.apache.eventmesh.starter.StartUp的主要方法 +``` + +##### 2) 本地二进制构建 + +1.下载源码 + +从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。比如目前最新版,您将获得`apache-eventmesh-1.9.0-source.tar.gz`。 +``` +tar -xvzf apache-eventmesh-1.9.0-source.tar.gz +cd apache-eventmesh-1.9.0-src/ +``` + +使用 Gradle 构建源代码。 +``` +gradle clean dist +``` + +编辑`eventmesh.properties`以更改EventMesh Runtime的配置(如 TCP 端口、客户端黑名单)。 +``` +cd dist +vim conf/eventmesh.properties +``` + +2.构建并加载插件 +Apache EventMesh引入了 SPI 机制,使 EventMesh 能够在运行时发现并加载插件。有两种方式安装插件: +- Gradle依赖项: 在`eventmesh-starter/build.gradle`中将插件声明为构建依赖项。 +``` +dependencies { + implementation project(":eventmesh-runtime") + + // 示例: 加载 RocketMQ 插件 + implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") +} +``` + +- 插件目录: EventMesh会根据`eventmesh.properties`加载`dist/plugin`目录中的插件。Gradle的`installPlugin`任务会构建插件并将其移动到`dist/plugin`目录中。 +``` +gradle installPlugin +``` + +3.启动Runtime + +执行`start.sh`脚本启动EventMesh Runtime服务器。 +``` +bash bin/start.sh +``` + +查看输出日志: +``` +tail -f logs/eventmesh.out +``` + +#### 远程部署 + +在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,以1.9.0版本为例,您将获得`apache-eventmesh-1.9.0-bin.tar.gz`。 +1.下载: +``` +# 解压 +tar -xvzf apache-eventmesh-1.9.0-bin.tar.gz +cd apache-eventmesh-1.9.0 +``` + +2.部署 + +编辑`eventmesh.properties`以更改EventMesh Runtime的配置(如 TCP 端口、客户端黑名单)。 +``` +vim conf/eventmesh.properties +``` + +执行`start.sh`脚本启动EventMesh Runtime服务器。 +``` +bash bin/start.sh +``` +如果看到`EventMeshTCPServer[port=10000] started....` 则说明设置成功。 + +查看输出日志: +``` +cd /root/apache-eventmesh-1.9.0/logs +tail -f eventmesh.out +``` + +停止: +``` +bash bin/stop.sh +``` + +#### Docker部署EventMesh Runtime(以1.4.0版本为例) + +准备: +- 建议使用64位的linux系统。 +- 请预先安装Docker Engine。Docker的安装过程可以参考[docker官方文档](https://docs.docker.com/engine/install/)。 +- 建议掌握基础的docker概念和命令行,例如注册中心、挂载等等。不过这不是必须的,因为本次操作所需的命令都已为您列出。 +- 若您选择非standalone模式,请确保[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/)已成功启动并且可以使用ip地址访问到;若您选择standalone模式,则无需启动RocketMQ 。 + +1.获取EventMesh镜像 +首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub]()中下载最新发布的[EventMesh]()。 +``` +sudo docker pull eventmesh/eventmesh:v1.4.0 +``` + +您可以使用以下命令列出并查看本地已有的镜像。 +``` +sudo docker images +``` + +如果终端显示如下所示的镜像信息,则说明 EventMesh 镜像已经成功下载到本地。 +``` +$ sudo docker images +REPOSITORY TAG IMAGE ID CREATED SIZE +eventmesh/eventmesh v1.4.0 6e2964599c78 16 months ago 937MB +``` + +2.创建配置文件: +在根据EventMesh镜像运行对应容器之前,你需要创建两个配置文件,分别是:`eventMesh.properties`和`rocketmq-client.properties`。 +首先,你需要使用下面的命令创建这两个文件。 +``` +sudo mkdir -p /data/eventmesh/rocketmq/conf +cd /data/eventmesh/rocketmq/conf +sudo touch eventmesh.properties +sudo touch rocketmq-client.properties +``` + +3.配置`eventMesh.properties` +这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 +使用下面的`vim`命令编辑`eventmesh.properties`。 +``` +sudo vim eventmesh.properties +``` +你可以直接将 GitHub 仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties)中的内容复制过来。 + +请检查配置文件里的默认端口是否已被占用,如果被占用请修改成未被占用的端口: + +| 属性 | 默认值 | 备注 | +|----------------------------|-------|----------------------------| +| 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 | + +4.配置`rocketmq-client.properties` + +这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 + +使用下面的`vim`命令编辑`eventmesh.properties`。 +``` +sudo vim eventmesh.properties +``` +你可以直接将GitHub仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties)中的内容复制过来 +> 请注意,如果您正在运行的 namesetver 地址不是配置文件中的默认值,请将其修改为实际正在运行的nameserver地址。 + +请检查配置文件里的默认namesrvAddr是否已被占用,如果被占用请修改成未被占用的地址: + +| 属性 | 默认值 | 备注 | +|---------------------------------------|-------------------------------|----------------------------------| +| eventMesh.server.rocketmq.namesrvAddr | 127.0.0.1:9876;127.0.0.1:9876 | RocketMQ namesrv default address | + +5.运行EventMesh +现在你就可以开始根据下载好的EventMesh镜像运行容器了。 +使用到的命令是`docker run`,有以下两点内容需要格外注意。 +- 绑定容器端口和宿主机端口: 使用`docker run`的`-p`选项。 +- 将宿主机中的两份配置文件挂在到容器中: 使用`docker run`的`-v`选项。 + +综合一下,对应的启动命令为: +``` +sudo docker run -d \ + -p 10000:10000 -p 10105:10105 \ + -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ + -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ + eventmesh/eventmesh:v1.4.0 +``` +如果运行命令之后看到新输出一行字符串,那么运行 EventMesh 镜像的容器就启动成功了。 + +接下来,你可以使用下面的命令查看容器的状态。 +``` +sudo docker ps +``` + +如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。 +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +5bb6b6092672 eventmesh/eventmesh:v1.4.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll +``` + +6.管理EventMesh容器 +在成功的运行了 EventMesh 容器后,你可以通过进入容器、查看日志、删除容器等方式管理容器。 +**进入容器**命令示例: +``` +sudo docker exec -it [your container id or name] /bin/bash +``` + +在容器中**查看日志**命令示例: +``` +cd ../logs +tail -f eventmesh.out +``` + +**删除容器**命令示例: +``` +sudo docker rm -f [your container id or name] +``` + +### eventmesh-sdk-java demo +> EventMesh-sdk-java作为客户端,与eventmesh-runtime通信,用于完成消息的发送和接收。 +> EventMesh-sdk-java支持异步消息和广播消息。异步消息表示生产者只发送消息,不关心回复消息。广播消息表示生产者发送一次消息,所有订阅广播主题的消费者都将收到消息 +> EventMesh-sdk-java支持HTTP,TCP 和 GRPC 协议。 + +TCP, HTTP 和 GRPC 示例都在eventmesh-examples模块下 + +#### 1.TCP +##### 1.1 异步消息 +- 创建主题`TEST-TOPIC-TCP-ASYNC`,可以通过`rocketmq-console`或者`rocketmq tools`命令 +- 启动消费者,订阅上一步骤已经创建的Topic +``` +运行 org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe 的main方法 +``` +- 启动发送端,发送消息 +``` +运行 org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish 的main方法 +``` +##### 1.2 广播消息 +- 创建主题`TEST-TOPIC-TCP-BROADCAST`,可以通过`rocketmq-console`或者`rocketmq tools`命令 +- 启动消费端,订阅上一步骤已经创建的Topic +``` +运行 org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribeBroadcast 的main方法 +``` +- 启动发送端,发送广播消息 +```` +运行 org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublishBroadcast 的main方法 +```` + +#### 2.HTTP +> 对于HTTP,eventmesh-sdk-java对对于异步事件实现了发送与订阅 +> 在演示中,Java类LiteMessage的content字段表示一个特殊的协议,因此,如果您要使用eventmesh-sdk-java的http-client,则只需设计协议的内容并在同一时间提供消费者的应用程序。 + +##### 2.1 异步事件 +> 生产者将事件发送给下游即可,无需等待响应 +- 创建主题`TEST-TOPIC-HTTP-ASYNC`,可以通过`rocketmq-console`或者`rocketmq tools`命令 +- 启动消费端,订阅Topic + 异步事件消费端为spring boot demo,运行demo即可启动服务并完成Topic订阅 +``` +运行 org.apache.eventmesh.http.demo.sub.SpringBootDemoApplication 的main方法 +``` +> 启动发送端,发送消息 +``` +运行 org.apache.eventmesh.http.demo.pub.eventmeshmessage.AsyncPublishInstance 的main方法 +``` +#### 3.GRPC +> eventmesh-sdk-java 实现了 gRPC 协议. 它能异步和同步发送事件到 eventmesh-runtime. 它可以通过webhook和事件流方式订阅消费事件, 同时也支持 CNCF CloudEvents 协议. +##### 3.1 异步事件发送 和 webhook订阅 +> `Async生产者`异步发送事件到`eventmesh-runtime`, 不需要等待事件储存到`event-store`在`webhook`消费者, 事件推送到消费者的`http endpoint url`。这个URL在消费者的`Subscription`模型定于. 这方法跟前面的`Http eventmsh client`类似。 +- 在rocketmq 创建主题`TEST-TOPIC-GRPC-ASYNC` +- 启动 publisher 发送事件 +``` +运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPublishInstance 的main方法 +``` +- 启动webhook消费者 +``` +运行 org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication 的main方法 +``` +##### 3.2 同步事件发送和事件流订阅 +> `同步生产者`发送事件到`eventmesh-runtime`, 同时等待事件储存到`event-store`在事件流消费者,事件以流的形式推送到`ReceiveMsgHook`客户端。 这方法类似`eventmesh client`. +- 在rocketmq 创建主题`TEST-TOPIC-GRPC-RR` +- 启动`Request-Reply publisher`发送事件 +``` +运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestReplyInstance 的main方法 +``` +- 启动`stream subscriber` +``` +运行 org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe 的main方法 +``` +##### 3.3 批量事件发布 +> 批量发布多个事件到 eventmesh-runtime. 这是异步操作 +- 在rocketmq创建主题`TEST-TOPIC-GRPC-ASYNC` +- 启动 publisher 来批量发布事件 +``` +运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.BatchPublishInstance 的main方法 +``` + +#### 4.测试 + +完成[store](#部署eventmesh-store)和[runtime](#部署eventmesh-runtime)的部署后,就可以在`eventmesh-examples`模块下运行我们的`demo`来体验`eventmesh`了! + +gradle编译: +``` +cd apache-eventmesh-1.9.0-src/eventmesh-examples +gradle clean dist +cd ./dist/bin +``` + +##### 4.1 TCP +TCP Sub +``` +bash tcp_eventmeshmessage_sub.sh +``` +打开对应log文件查看日志: +``` +cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_pub.out +``` +TCP Pub +``` +bash tcp_pub_eventmeshmessage.sh +``` +打开对应log文件查看日志: +``` +cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_sub.out +``` +##### 4.2 TCP Broadcast +TCP Sub Broadcast +``` +sh tcp_sub_eventmeshmessage_broadcast.sh +``` +打开对应log文件查看日志: +``` +cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_sub_broadcast.out +``` +TCP Pub Broadcast +``` +sh tcp_pub_eventmeshmessage_broadcast.sh +``` +打开对应log文件查看日志: +``` +cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_pub_broadcast.out +``` + +##### 4.3 HTTP +HTTP Sub +``` +sh http_sub.sh +``` +打开对应log文件查看日志: +``` +cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +tail -f demo_http_sub.out +``` +HTTP Pub +``` +sh http_pub_eventmeshmessage.sh +``` +打开对应log文件查看日志: +``` +cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +tail -f demo_http_pub.out +``` +你可以在`/logs`目录下面看到不同模式的运行日志。 + +### 运行EventMesh-Operator + +准备: +``` +docker +golang (version 1.19) +kubernetes (kubectl) +kubernetes和docker之间有一定的兼容性,请检查它们之间的版本兼容性,并下载相应的版本,以确保它们能一起正常工作。 +``` + +#### 本地源码运行 + +1.启动: +进入eventmesh-operator目录。 +``` +cd eventmesh-operator +``` +将CRD安装到k8s集群。 +``` +make install + +# Uninstall CRDs from the K8s cluster +make uninstall +``` + +如果出现错误`eventmesh-operator/bin/controller-gen: No such file or directory` +运行以下命令: +``` +# 如有必要,在本地下载controller-gen. +make controller-gen +# 如有必要,在本地下载kustomize. +make kustomize +``` +查看crds信息: +``` +# 运行以下命令查看 crds 信息: +kubectl get crds +NAME CREATED AT +connectors.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z +runtimes.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z +``` + +运行eventmesh-operator: +``` +# run controller +make run + +# 成功启动pod后,运行以下命令查看pod。 +kubectl get pods +NAME READY STATUS RESTARTS AGE +connector-rocketmq-0 1/1 Running 0 12m +eventmesh-runtime-0-a-0 1/1 Running 0 12m +``` + +2.创建和删除CRs: +自定义资源对象位于: `/config/samples` +删除CR,只需将`create`替换为`delete`即可。 +``` +# 为eventmesh-runtime、eventmesh-connector-rocketmq创建CR,创建clusterIP可让eventmesh-runtime与其他组件通信。 +make create + +#success: +configmap/runtime-config created +runtime.eventmesh-operator.eventmesh/eventmesh-runtime created +service/runtime-cluster-service created +configmap/connector-rocketmq-config created +connectors.eventmesh-operator.eventmesh/connector-rocketmq created + +# 查看创建的service. +kubectl get service +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +runtime-cluster-service ClusterIP 10.109.209.72 10000/TCP 17s + +# 运行以下命令查看pod. +kubectl get pods +NAME READY STATUS RESTARTS AGE +connector-rocketmq-0 1/1 Running 0 12m +eventmesh-runtime-0-a-0 1/1 Running 0 12m + +# 删除CR +make delete +``` ## 贡献 From 748807c3ba47d78d3384e95e7dc48af3b3d2667a Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 3 Jan 2024 14:20:17 +0800 Subject: [PATCH 04/36] update README.zh-CN.md --- README.zh-CN.md | 77 +++---------------------------------------------- 1 file changed, 4 insertions(+), 73 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 36c50a16cd..01cb6eebc7 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -63,9 +63,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ## 快速入门 本段指南将指导您完成EventMesh的部署步骤 -- [部署EventMesh Store](#部署eventmesh-store) - - [本地部署EventMesh Store](#本地部署eventmesh-store) - - [使用Docker部署EventMesh Store](#使用docker部署eventmesh-store) +- [部署EventMesh Store](#部署eventmesh-store) - [部署EventMesh Runtime](#部署eventmesh-runtime) - [本地构建运行](#本地构建运行) - [源码启动](#1源码启动-) @@ -80,77 +78,10 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 - [运行EventMesh-Operator](#运行eventmesh-operator) - [本地源码运行](#本地源码运行) -### 部署EventMesh Store -开始之前需要准备以下环境: -``` -建议使用64位操作系统,建议使用Linux/Unix; -64位JDK 1.8+; -Gradle至少为7.0, 推荐7.0.* -4g+可用磁盘用于eventmesh-store服务器 -eventmesh在非standalone模式下,依赖RocketMQ作为存储层;若采用standalone模式,则可跳过该步,直接进行runtime的部署 -``` -#### 本地部署EventMesh Store +### 部署EventMesh Store -##### 1) 下载 -从[RocketMQ官方网站](https://rocketmq.apache.org/download/)下载Binary代码(推荐使用4.9.*版本),这里以4.9.4为例: -``` -unzip rocketmq-all-4.9.4-bin-release.zip -cd rocketmq-all-4.9.4-bin-release/ -``` -##### 2) 启动 -1.启动Name Server: -``` -nohup sh bin/mqnamesrv & tail -f ~/logs/rocketmqlogs/namesrv.log -``` -如果在看到The Name Server boot success...,则说明Name Server启动成功。 - -2.启动Broker: -``` -nohup sh bin/mqbroker -n localhost:9876 & -tail -f ~/logs/rocketmqlogs/broker.log -``` -如果在看到The broker boot success...,则说明Broker启动成功 - -#### 使用Docker部署EventMesh Store - -##### 1) 拉取镜像 -在命令行输入如下命令直接从 docker hub 上获取 RocketMQ 镜像: -``` -sudo docker pull apache/rocketmq:4.9.4 -``` -您可以使用以下命令列出并查看本地已有的镜像: -``` -sudo docker images -``` -如果终端显示如下所示的镜像信息,则说明 RocketMQ 镜像已经成功下载到本地。 -``` -REPOSITORY TAG IMAGE ID CREATED SIZE -apache/rocketmq 4.9.4 a2a50ca263c3 13 months ago 548MB -``` - -##### 2) 运行容器 -1.运行namerv容器和broker容器: -``` -sudo docker run -d -p 9876:9876 \ - -v `pwd`/data/namesrv/logs:/root/logs \ - -v `pwd`/data/namesrv/store:/root/store \ - --name rmqnamesrv \ - apache/rocketmq:4.9.4 \ - sh mqnamesrv -``` - -2.运行broker容器: -``` -sudo docker run -d -p 10911:10911 -p 10909:10909 \ - -v `pwd`/data/broker/logs:/root/logs \ - -v `pwd`/data/broker/store:/root/store \ - --name rmqbroker \ - --link rmqnamesrv:namesrv \ - -e "NAMESRV_ADDR=namesrv:9876" \ - apache/rocketmq:4.9.4 \ - sh mqbroker -c ../conf/broker.conf -``` -请注意 **rocketmq-broker ip**是**pod ip**, 如果你想修改这个**ip**, 可以通过挂载容器中**broker.conf**文件的方式并修改文件中的**brokerIP1**配置项为自定义值。 +> EventMesh现在支持`standalone`、`RocketMQ`、`Kafka`等中间件作为存储 +> 如果是在非`standalone`模式下,需要先部署所需的`store`,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) ### 部署EventMesh Runtime EventMesh Runtime是EventMesh集群中有状态的Mesh节点,负责Source Connector与Sink Connector之间的事件传输,并可以使用EventMesh Storage作为事件的存储队列。 From c2927cf40ddec4b9495249d08d9b8388dc42aa97 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 3 Jan 2024 16:43:49 +0800 Subject: [PATCH 05/36] update README.zh-CN.md and add README.md --- README.md | 529 ++++++++++++++++++++++++++++++++++++++++++++++-- README.zh-CN.md | 117 +++++++---- 2 files changed, 591 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 6281fdf1ac..2691697721 100644 --- a/README.md +++ b/README.md @@ -59,25 +59,520 @@ Please go to the [roadmap](https://eventmesh.apache.org/docs/roadmap) to get the - [EventMesh-go](https://github.com/apache/eventmesh-go): A go implementation for EventMesh runtime. ## Quick start -Here are the guidelines: -[Step 1: Deploy eventmesh-store](https://eventmesh.apache.org/docs/instruction/store) +This section of the guide will walk you through the deployment steps for EventMesh: + +- [Deployment EventMesh Store](#deployment-eventmesh-store) +- [Deployment EventMesh Runtime](#deployment-eventmesh-runtime-) + - [Run on your local machine](#run-on-your-local-machine) + - [Run from source code](#1run-from-source-code) + - [Run form local binary](#2-run-form-local-binary) + - [Remote deployment](#remote-deployment) + - [EventMesh Runtime with Docker](#eventmesh-runtime-with-docker) +- [eventmesh-sdk-java demo](#eventmesh-sdk-java-demo) + - [TCP](#1tcp) + - [HTTP](#2http) + - [GRPC](#3grpc) + - [Run Demo with shell scripts](#4run-demo-with-shell-scripts-) +- [Run EventMesh-Operator](#run-eventmesh-operator) + - [Local source code run](#local-source-code-run) + +### Deployment EventMesh Store + +> EventMesh now supports `standalone`, `RocketMQ`, `Kafka` and other middleware as a storage. +> 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/). + +### Deployment EventMesh Runtime + +The EventMesh Runtime is a stateful mesh node in an EventMesh cluster that is responsible for event transfer between the Source Connector and the Sink Connector, and can use Event Store as a storage queue for events. -[Step 2: Start eventmesh-runtime](https://eventmesh.apache.org/docs/instruction/runtime) - -[Step 3: Run our demos](https://eventmesh.apache.org/docs/instruction/demo) - -[Step 4: EventMesh-Operator quick start](https://eventmesh.apache.org/docs/next/instruction/operator) - -Besides, we also provide the docker-version guidelines for you if you prefer Docker: - -[Step 1: Deploy eventmesh-store using docker](https://eventmesh.apache.org/docs/instruction/store-with-docker) - -[Step 2: Start eventmesh-runtime using docker](https://eventmesh.apache.org/docs/instruction/runtime-with-docker) - -[Step 3: Run our demos](https://eventmesh.apache.org/docs/instruction/demo) - -[Step 4: EventMesh-Operator quick start](https://eventmesh.apache.org/docs/next/instruction/operator) +#### Run on your local machine + +Dependencies: +- 64-bit OS, we recommend Linux/Unix. +- 64-bit JDK 1.8 or JDK 11 +- Gradle 7.0+, The recommended version can be found in the `gradle/wrapper/gradle-wrapper.properties` file. + +##### 1)Run from source code + +1.Download source code: +Download and extract the source code of the latest release from [EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0-source.tar.gz`. + +There are two ways to install the plugin: + +- classpath loading: Local developers can install the plugin by declaring it in the eventmesh-starter module build.gradle, e.g., declare that it uses the rocketmq plugin +``` +implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") +``` + +- File loading: By installing the plugin to the plugin directory, EventMesh will automatically load the plugins in the plugin directory according to the conditions at runtime, you can install the plugin by executing the following command +``` +./gradlew clean jar dist && ./gradlew installPlugin +``` + +3.Using Plugins + +EventMesh will load plugins in the `dist/plugin` directory by default, you can change the plugin directory with `-DeventMeshPluginDir=your_plugin_directory`. Examples of plugins to be used at runtime can be found in the `confPath` directory under `eventmesh.properties`. For example declare the use of the rocketmq plugin at runtime with the following settings. +``` +#connector plugin +eventMesh.connector.plugin.type=rocketmq +``` + +4.Configuring the VM startup parameters +``` +-Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml +-Deventmesh.log.home=eventmesh-runtime/logs +-Deventmesh.home=eventmesh-runtime +-DconfPath=eventmesh-runtime/conf +``` +> Note: If your operating system is Windows, you may need to replace the file separator with `'\'`. + +5.Getting up and running +``` +Run org.apache.eventmesh.starter. +``` + +##### 2) Run form local binary + +1.Download Source Code + +Download and extract the source code of the latest release from [EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get apache-eventmesh-1.10.0-source.tar.gz. +``` +tar -xvzf apache-eventmesh-1.10.0-source.tar.gz +cd apache-eventmesh-1.10.0-src/ +``` + +Build the source code with Gradle. +``` +gradle clean dist +``` + +Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. +``` +cd dist +vim conf/eventmesh.properties +``` + +2.Build and Load Plugins +Apache EventMesh introduces the SPI (Service Provider Interface) mechanism, which enables EventMesh to discover and load the plugins at runtime.The plugins could be installed with these methods: +- Gradle Dependencies: Declare the plugins as the build dependencies in `eventmesh-starter/build.gradle`. +``` +dependencies { + implementation project(":eventmesh-runtime") + + // Example: Load the RocketMQ plugin + implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") +} +``` + +- Plugin directory: EventMesh loads the plugins in the `dist/plugin` directory based on `eventmesh.properties`. The `installPlugin` task of Gradle builds and moves the plugins into the `dist/plugin` directory. +``` +gradle installPlugin +``` + +3.Start Runtime + +Execute the `start.sh` script to start the EventMesh Runtime server. +``` +bash bin/start.sh +``` + +View the output log: +``` +tail -f logs/eventmesh.out +``` + +#### Remote deployment + +1.Download: + +Download and extract the executable binaries of the latest release from[EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0.tar.gz`. +``` +tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz +cd apache-eventmesh-1.10.0 +``` + +2.Deploy + +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 +``` + +Execute the `start.sh` script to start the EventMesh Runtime server. +``` +bash bin/start.sh +``` +If you see `EventMeshTCPServer[port=10000] started....`, then the setup was successful. + +View the output log: +``` +cd /root/apache-eventmesh-1.10.0/logs +tail -f eventmesh.out +``` + +You can stop the run with the following command: +``` +bash bin/stop.sh +``` + +#### EventMesh Runtime with Docker + +Dependencies: +- 64-bit OS, we recommend Linux/Unix. +- 64-bit JDK 1.8 or JDK 11. +- Gradle 7.0+, The recommended version can be found in the `gradle/wrapper/gradle-wrapper.properties` file. + +1.Pull EventMesh Image +Download the pre-built image of [eventmesh](https://hub.docker.com/r/apache/eventmesh) from Docker Hub with docker pull: +``` +sudo docker pull apache/eventmesh:v1.10.0 +``` + +To verify that the apache/eventmesh image is successfully installed, list the downloaded images with docker images: +``` +$ sudo docker images +REPOSITORY TAG IMAGE ID CREATED SIZE +apache/eventmesh v1.10.0 6e2964599c78 10 days ago 937MB +``` + +2.Edit Configuration: +Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. To integrate RocketMQ as a connector, these two configuration files should be created: `eventmesh.properties` and `rocketmq-client.properties`. +``` +sudo mkdir -p /data/eventmesh/rocketmq/conf +cd /data/eventmesh/rocketmq/conf +sudo touch eventmesh.properties +sudo touch rocketmq-client.properties +``` + +3.Configure `eventmesh.properties` + +The `eventmesh.properties` file contains the properties of EventMesh Runtime environment and integrated plugins.Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties) for the available configuration keys. +``` +sudo vim eventmesh.properties +``` + +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` | + +4.Configure `rocketmq-client.properties` + +The `rocketmq-client.properties` file contains the properties of the Apache RocketMQ nameserver. + +``` +sudo vim eventmesh.properties +``` +Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties) and change the value of eventMesh.server.rocketmq.namesrvAddr to the nameserver address of RocketMQ. +> 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 + +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. +- +``` +sudo docker run -d \ + -p 10000:10000 -p 10105:10105 \ + -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ + -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ + apache/eventmesh:v1.10.0 +``` +If you see a new line of output after running the command, the container running the EventMesh image has started successfully. + +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 +5bb6b6092672 apache/eventmesh:v1.10.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll +``` + +6.Managing EventMesh Containers +After successfully running an EventMesh container, you can manage the container by entering it, viewing logs, deleting it, and so on. +To connect to the EventMesh container: +``` +sudo docker exec -it [your container id or name] /bin/bash +``` + +To read the log of the EventMesh container: +``` +cd ../logs +tail -f eventmesh.out +``` + +To stop or remove the container: +``` +sudo docker stop [container id or name] +sudo docker rm -f [container id or name] +``` + +### eventmesh-sdk-java demo + +> eventmesh-sdk-java acts as a client of EventMesh Runtime and communicates with it, to publish and subscribe the messages. +> +> The eventmesh-sdk-java supports ASYNC messages and BROADCAST messages. ASYNC messages indicate that producers only send messages and do not care about receiving reply messages. BROADCAST messages mean that producers send a message once, and all consumers subscribed to the broadcast topic will receive the message. +> +> eventmesh-sdk-java supports HTTP, TCP and gRPC protocols. + +The test demos of TCP, HTTP and GRPC are in the module `eventmesh-examples`. + +#### 1.TCP + +##### 1.1 ASYNC + +- Start consumer to subscribe the topic (we have created the `TEST-TOPIC-TCP-ASYNC` by default, you can also create other topic to test) +``` +Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe +``` + +- Start producer to publish async message +``` +Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish +``` + +##### 1.2 BROADCAST +- Start subscriber to subscribe the topic (we have created the `TEST-TOPIC-TCP-BROADCAST` by default, you can also create other topic to test) +``` +Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribeBroadcast +``` +- Start publisher to publish async message +```` +Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublishBroadcast +```` + +#### 2.HTTP +> For HTTP, the eventmesh-sdk-java implements sending and subscribing to asynchronous events. +> +> In the demo, the `content` field of the Java class `EventMeshMessage` represents a special protocol. Therefore, if you are using the eventmesh-sdk-java's http-client, you only need to design the content of the protocol and provide the consumer's application at the same time. + +##### 2.1 ASYNC +- The subscriber is a SpringBoot demo, so run this demo to start subscriber (we have created the topic `TEST-TOPIC-HTTP-ASYNC` by default, you can also create other topic to test) +``` +Run the main method of org.apache.eventmesh.http.demo.sub.SpringBootDemoApplication +``` + +> Start publisher to publish message +``` +Run the main method of org.apache.eventmesh.http.demo.pub.eventmeshmessage.AsyncPublishInstance +``` + +#### 3.GRPC + +> The eventmesh-sdk-java implements the gRPC protocol. It can asynchronously or synchronously send events to the EventMesh Runtime. +> +> It can subscribe to consume events through Webhook and event streaming, and also supports the CNCF CloudEvents protocol. + +##### 3.1 ASYNC Publish & Webhook Subscribe +> Producers can asynchronously send events to the EventMesh Runtime without waiting for the events to be stored in the Event Store. +> +> For Webhook consumers, events will be pushed to the consumer's HTTP Endpoint URL, i.e., the consumer's `subscribeUrl`. This method is similar to the previously mentioned Http EventMesh client. + +- Start publisher to publish message (we have created the topic `TEST-TOPIC-GRPC-ASYNC` by default, you can also create other topic to test) +``` +Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPublishInstance +``` + +- Start webhook subscriber +``` +Run the main method of org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication +``` + +##### 3.2 SYNC Publish & Stream Subscribe +> Producers synchronously send events to the EventMesh Runtime while waiting for the events to be stored in the Event Store. +> +> For event stream consumers, events are pushed in a streaming to the ReceiveMsgHook client. This method is similar to the EventMesh client. + +- Start Request-Reply publisher to publish message (we have created the topic `TEST-TOPIC-GRPC-RR` by default, you can also create other topic to test) +``` +Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestReplyInstance +``` + +- Start stream subscriber +``` +Run the main method of org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe +``` + +##### 3.3 Publish BATCH Message +> Asynchronously batch publish multiple events to the EventMesh Runtime. +- Start publisher to publish batch message (we have created the `TEST-TOPIC-GRPC-ASYNC` by default, you can also create other topic to test.) +``` +Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.BatchPublishInstance +``` + +#### 4.Run Demo with shell scripts + +Please refer to [Event Store](#deployment-eventmesh-store) and [EventMesh Runtime](#deployment-eventmesh-runtime-) to finish the necessary deployment before try our demo. + +After finishing the deployment of Store and Runtime, you can run our demos in module `eventmesh-examples`: + +gradle: +``` +cd apache-eventmesh-1.10.0-src/eventmesh-examples +gradle clean dist +cd ./dist/bin +``` + +##### 4.1 TCP + +TCP Sub +``` +bash tcp_eventmeshmessage_sub.sh +``` + +Open the corresponding log file to view the log: +``` +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_pub.out +``` + +TCP Pub +``` +bash tcp_pub_eventmeshmessage.sh +``` + +Open the corresponding log file to view the log: +``` +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_sub.out +``` + +##### 4.2 TCP Broadcast + +TCP Sub Broadcast +``` +sh tcp_sub_eventmeshmessage_broadcast.sh +``` + +Open the corresponding log file to view the log: +``` +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_sub_broadcast.out +``` + +TCP Pub Broadcast +``` +sh tcp_pub_eventmeshmessage_broadcast.sh +``` + +Open the corresponding log file to view the log: +``` +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs +tail -f demo_tcp_pub_broadcast.out +``` + +##### 4.3 HTTP + +HTTP Sub +``` +sh http_sub.sh +``` + +Open the corresponding log file to view the log: +``` +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs +tail -f demo_http_sub.out +``` + +HTTP Pub +``` +sh http_pub_eventmeshmessage.sh +``` + +Open the corresponding log file to view the log: +``` +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs +tail -f demo_http_pub.out +``` +You can see the run logs for the different modes under the `/logs` directory. + +### Run EventMesh-Operator + +Dependencies: +- docker +- golang (version 1.19) +- kubernetes (kubectl) +> There is some compatibility between kubernetes an docker, please check the version compatibility between them and download the corresponding version to ensure that they work properly together. + +#### Local source code run + +1.Start: + +Go to the eventmesh-operator directory. +``` +cd eventmesh-operator +``` + +Install CRD into the specified k8s cluster. +``` +make install + +# Uninstall CRDs from the K8s cluster +make uninstall +``` + +If you get error `eventmesh-operator/bin/controller-gen: No such file or directory` +Run the following command: +``` +# download controller-gen locally if necessary. +make controller-gen +# download kustomize locally if necessary. +make kustomize +``` + +View crds information: +``` +# run the following command to view crds information: +kubectl get crds +NAME CREATED AT +connectors.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z +runtimes.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z +``` + +run eventmesh-operator: +``` +# run controller +make run +``` + +2.Create and delete CRs: +Custom resource objects are located at: `/config/samples` +When deleting CR, simply replace `create` with `delete`. +``` +# Create CR for eventmesh-runtime、eventmesh-connector-rocketmq,Creating a clusterIP lets eventmesh-runtime communicate with other components. +make create + +#success: +configmap/runtime-config created +runtime.eventmesh-operator.eventmesh/eventmesh-runtime created +service/runtime-cluster-service created +configmap/connector-rocketmq-config created +connectors.eventmesh-operator.eventmesh/connector-rocketmq created + +# View the created Service. +kubectl get service +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +runtime-cluster-service ClusterIP 10.109.209.72 10000/TCP 17s + +# After the pods are successfully started, run the following command to view pods. +kubectl get pods +NAME READY STATUS RESTARTS AGE +connector-rocketmq-0 1/1 Running 0 12m +eventmesh-runtime-0-a-0 1/1 Running 0 12m + +# delete CR +make delete +``` ## Contributing diff --git a/README.zh-CN.md b/README.zh-CN.md index 01cb6eebc7..885205318d 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -63,13 +63,13 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ## 快速入门 本段指南将指导您完成EventMesh的部署步骤 -- [部署EventMesh Store](#部署eventmesh-store) +- [部署EventMesh Store](#部署eventmesh-store-) - [部署EventMesh Runtime](#部署eventmesh-runtime) - [本地构建运行](#本地构建运行) - [源码启动](#1源码启动-) - [本地二进制构建](#2-本地二进制构建) - [远程部署](#远程部署) - - [Docker部署EventMesh Runtime](#docker部署eventmesh-runtime以140版本为例) + - [Docker部署EventMesh Runtime](#docker部署eventmesh-runtime) - [eventmesh-sdk-java demo](#eventmesh-sdk-java-demo-) - [TCP](#1tcp-) - [HTTP](#2http) @@ -97,7 +97,7 @@ Gradle至少为7.0, 推荐 7.0.* ##### 1)源码启动 1.下载源码: -从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。比如目前最新版,您将获得`apache-eventmesh-1.9.0-source.tar.gz`。 +从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。您将获得`apache-eventmesh-1.10.0-source.tar.gz`。 2.安装插件: @@ -114,7 +114,7 @@ implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") ``` 3.使用插件 -EventMesh 会默认加载 dist/plugin 目录下的插件,可以通过-DeventMeshPluginDir=your_plugin_directory来改变插件目录。运行时需要使用的插件实例可以在 confPath目录下面的eventmesh.properties中进行配置。例如通过以下设置声明在运行时使用rocketmq插件。 +EventMesh 会默认加载`dist/plugin`目录下的插件,可以通过`-DeventMeshPluginDir=your_plugin_directory`来改变插件目录。运行时需要使用的插件实例可以在`confPath`目录下面的`eventmesh.properties`中进行配置。例如通过以下设置声明在运行时使用rocketmq插件。 ``` #connector plugin eventMesh.connector.plugin.type=rocketmq @@ -127,7 +127,7 @@ eventMesh.connector.plugin.type=rocketmq -Deventmesh.home=eventmesh-runtime -DconfPath=eventmesh-runtime/conf ``` -> 注:如果操作系统为Windows, 可能需要将文件分隔符换成'\' +> 注:如果操作系统为Windows, 可能需要将文件分隔符换成`'\'` 5.启动运行 ``` @@ -140,8 +140,8 @@ eventMesh.connector.plugin.type=rocketmq 从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。比如目前最新版,您将获得`apache-eventmesh-1.9.0-source.tar.gz`。 ``` -tar -xvzf apache-eventmesh-1.9.0-source.tar.gz -cd apache-eventmesh-1.9.0-src/ +tar -xvzf apache-eventmesh-1.10.0-source.tar.gz +cd apache-eventmesh-1.10.0-src/ ``` 使用 Gradle 构建源代码。 @@ -186,12 +186,12 @@ tail -f logs/eventmesh.out #### 远程部署 -在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,以1.9.0版本为例,您将获得`apache-eventmesh-1.9.0-bin.tar.gz`。 +在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,您将获得`apache-eventmesh-1.10.0-bin.tar.gz`。 1.下载: ``` # 解压 -tar -xvzf apache-eventmesh-1.9.0-bin.tar.gz -cd apache-eventmesh-1.9.0 +tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz +cd apache-eventmesh-1.10.0 ``` 2.部署 @@ -205,11 +205,11 @@ vim conf/eventmesh.properties ``` bash bin/start.sh ``` -如果看到`EventMeshTCPServer[port=10000] started....` 则说明设置成功。 +如果看到`EventMeshTCPServer[port=10000] started....`, 则说明设置成功。 查看输出日志: ``` -cd /root/apache-eventmesh-1.9.0/logs +cd /root/apache-eventmesh-1.10.0/logs tail -f eventmesh.out ``` @@ -218,7 +218,7 @@ tail -f eventmesh.out bash bin/stop.sh ``` -#### Docker部署EventMesh Runtime(以1.4.0版本为例) +#### Docker部署EventMesh Runtime 准备: - 建议使用64位的linux系统。 @@ -227,9 +227,9 @@ bash bin/stop.sh - 若您选择非standalone模式,请确保[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/)已成功启动并且可以使用ip地址访问到;若您选择standalone模式,则无需启动RocketMQ 。 1.获取EventMesh镜像 -首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub]()中下载最新发布的[EventMesh]()。 +首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub](https://hub.docker.com)中下载最新发布的[EventMesh](https://hub.docker.com/r/apache/eventmesh)。 ``` -sudo docker pull eventmesh/eventmesh:v1.4.0 +sudo docker pull apache/eventmesh:v1.10.0 ``` 您可以使用以下命令列出并查看本地已有的镜像。 @@ -241,11 +241,11 @@ sudo docker images ``` $ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE -eventmesh/eventmesh v1.4.0 6e2964599c78 16 months ago 937MB +apache/eventmesh v1.10.0 6e2964599c78 16 months ago 937MB ``` 2.创建配置文件: -在根据EventMesh镜像运行对应容器之前,你需要创建两个配置文件,分别是:`eventMesh.properties`和`rocketmq-client.properties`。 +在根据EventMesh镜像运行对应容器之前,你需要创建两个配置文件,分别是:`eventmesh.properties`和`rocketmq-client.properties`。 首先,你需要使用下面的命令创建这两个文件。 ``` sudo mkdir -p /data/eventmesh/rocketmq/conf @@ -254,7 +254,8 @@ sudo touch eventmesh.properties sudo touch rocketmq-client.properties ``` -3.配置`eventMesh.properties` +3.配置`eventmesh.properties` + 这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 使用下面的`vim`命令编辑`eventmesh.properties`。 ``` @@ -264,11 +265,11 @@ sudo vim eventmesh.properties 请检查配置文件里的默认端口是否已被占用,如果被占用请修改成未被占用的端口: -| 属性 | 默认值 | 备注 | -|----------------------------|-------|----------------------------| -| 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.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` | 4.配置`rocketmq-client.properties` @@ -283,9 +284,9 @@ sudo vim eventmesh.properties 请检查配置文件里的默认namesrvAddr是否已被占用,如果被占用请修改成未被占用的地址: -| 属性 | 默认值 | 备注 | -|---------------------------------------|-------------------------------|----------------------------------| -| eventMesh.server.rocketmq.namesrvAddr | 127.0.0.1:9876;127.0.0.1:9876 | RocketMQ namesrv default address | +| 属性 | 默认值 | 备注 | +|-----------------------------------------|---------------------------------|------------------------------------| +| `eventMesh.server.rocketmq.namesrvAddr` | `127.0.0.1:9876;127.0.0.1:9876` | `RocketMQ namesrv default address` | 5.运行EventMesh 现在你就可以开始根据下载好的EventMesh镜像运行容器了。 @@ -299,7 +300,7 @@ sudo docker run -d \ -p 10000:10000 -p 10105:10105 \ -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ - eventmesh/eventmesh:v1.4.0 + apache/eventmesh:v1.10.0 ``` 如果运行命令之后看到新输出一行字符串,那么运行 EventMesh 镜像的容器就启动成功了。 @@ -311,7 +312,7 @@ sudo docker ps 如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。 ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -5bb6b6092672 eventmesh/eventmesh:v1.4.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll +5bb6b6092672 apache/eventmesh:v1.10.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll ``` 6.管理EventMesh容器 @@ -340,69 +341,92 @@ sudo docker rm -f [your container id or name] TCP, HTTP 和 GRPC 示例都在eventmesh-examples模块下 #### 1.TCP + ##### 1.1 异步消息 + - 创建主题`TEST-TOPIC-TCP-ASYNC`,可以通过`rocketmq-console`或者`rocketmq tools`命令 - 启动消费者,订阅上一步骤已经创建的Topic ``` 运行 org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe 的main方法 ``` + - 启动发送端,发送消息 ``` 运行 org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish 的main方法 ``` + ##### 1.2 广播消息 + - 创建主题`TEST-TOPIC-TCP-BROADCAST`,可以通过`rocketmq-console`或者`rocketmq tools`命令 - 启动消费端,订阅上一步骤已经创建的Topic ``` 运行 org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribeBroadcast 的main方法 ``` + - 启动发送端,发送广播消息 ```` 运行 org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublishBroadcast 的main方法 ```` #### 2.HTTP + > 对于HTTP,eventmesh-sdk-java对对于异步事件实现了发送与订阅 > 在演示中,Java类LiteMessage的content字段表示一个特殊的协议,因此,如果您要使用eventmesh-sdk-java的http-client,则只需设计协议的内容并在同一时间提供消费者的应用程序。 ##### 2.1 异步事件 + > 生产者将事件发送给下游即可,无需等待响应 + - 创建主题`TEST-TOPIC-HTTP-ASYNC`,可以通过`rocketmq-console`或者`rocketmq tools`命令 - 启动消费端,订阅Topic 异步事件消费端为spring boot demo,运行demo即可启动服务并完成Topic订阅 ``` 运行 org.apache.eventmesh.http.demo.sub.SpringBootDemoApplication 的main方法 ``` -> 启动发送端,发送消息 + +- 启动发送端,发送消息 ``` 运行 org.apache.eventmesh.http.demo.pub.eventmeshmessage.AsyncPublishInstance 的main方法 ``` + #### 3.GRPC + > eventmesh-sdk-java 实现了 gRPC 协议. 它能异步和同步发送事件到 eventmesh-runtime. 它可以通过webhook和事件流方式订阅消费事件, 同时也支持 CNCF CloudEvents 协议. + ##### 3.1 异步事件发送 和 webhook订阅 + > `Async生产者`异步发送事件到`eventmesh-runtime`, 不需要等待事件储存到`event-store`在`webhook`消费者, 事件推送到消费者的`http endpoint url`。这个URL在消费者的`Subscription`模型定于. 这方法跟前面的`Http eventmsh client`类似。 + - 在rocketmq 创建主题`TEST-TOPIC-GRPC-ASYNC` - 启动 publisher 发送事件 ``` 运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPublishInstance 的main方法 ``` + - 启动webhook消费者 ``` 运行 org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication 的main方法 ``` + ##### 3.2 同步事件发送和事件流订阅 -> `同步生产者`发送事件到`eventmesh-runtime`, 同时等待事件储存到`event-store`在事件流消费者,事件以流的形式推送到`ReceiveMsgHook`客户端。 这方法类似`eventmesh client`. + +> `同步生产者`发送事件到`eventmesh-runtime`, 同时等待事件储存到`event-store`在事件流消费者,事件以流的形式推送到`ReceiveMsgHook`客户端。 这方法类似`eventmesh client`. + - 在rocketmq 创建主题`TEST-TOPIC-GRPC-RR` - 启动`Request-Reply publisher`发送事件 ``` 运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestReplyInstance 的main方法 ``` + - 启动`stream subscriber` ``` 运行 org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe 的main方法 ``` -##### 3.3 批量事件发布 + +##### 3.3 批量事件发布 + > 批量发布多个事件到 eventmesh-runtime. 这是异步操作 + - 在rocketmq创建主题`TEST-TOPIC-GRPC-ASYNC` - 启动 publisher 来批量发布事件 ``` @@ -415,69 +439,83 @@ TCP, HTTP 和 GRPC 示例都在eventmesh-examples模块下 gradle编译: ``` -cd apache-eventmesh-1.9.0-src/eventmesh-examples +cd apache-eventmesh-1.10.0-src/eventmesh-examples gradle clean dist cd ./dist/bin ``` ##### 4.1 TCP + TCP Sub ``` bash tcp_eventmeshmessage_sub.sh ``` + 打开对应log文件查看日志: ``` -cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs tail -f demo_tcp_pub.out ``` + TCP Pub ``` bash tcp_pub_eventmeshmessage.sh ``` + 打开对应log文件查看日志: ``` -cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs tail -f demo_tcp_sub.out ``` + ##### 4.2 TCP Broadcast + TCP Sub Broadcast ``` sh tcp_sub_eventmeshmessage_broadcast.sh ``` + 打开对应log文件查看日志: ``` -cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs tail -f demo_tcp_sub_broadcast.out ``` + TCP Pub Broadcast ``` sh tcp_pub_eventmeshmessage_broadcast.sh ``` + 打开对应log文件查看日志: ``` -cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs tail -f demo_tcp_pub_broadcast.out ``` ##### 4.3 HTTP + HTTP Sub ``` sh http_sub.sh ``` + 打开对应log文件查看日志: ``` -cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs tail -f demo_http_sub.out ``` + HTTP Pub ``` sh http_pub_eventmeshmessage.sh ``` + 打开对应log文件查看日志: ``` -cd /root/apache-eventmesh-1.9.0-src/eventmesh-examples/dist/logs +cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs tail -f demo_http_pub.out ``` + 你可以在`/logs`目录下面看到不同模式的运行日志。 ### 运行EventMesh-Operator @@ -493,10 +531,12 @@ kubernetes和docker之间有一定的兼容性,请检查它们之间的版本 #### 本地源码运行 1.启动: + 进入eventmesh-operator目录。 ``` cd eventmesh-operator ``` + 将CRD安装到k8s集群。 ``` make install @@ -513,6 +553,7 @@ make controller-gen # 如有必要,在本地下载kustomize. make kustomize ``` + 查看crds信息: ``` # 运行以下命令查看 crds 信息: From b005ad8f61d88e5ba492d525f95181a9d25d8384 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 3 Jan 2024 16:46:18 +0800 Subject: [PATCH 06/36] update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2691697721..c5cadc60a0 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ Please check if the `default namesrvAddr` in the configuration file is occupied, 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. -- + ``` sudo docker run -d \ -p 10000:10000 -p 10105:10105 \ From 77a3e6b2e834e824b42f52bde12931a3a089a631 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 3 Jan 2024 16:56:45 +0800 Subject: [PATCH 07/36] update README.zh-CN.md --- README.zh-CN.md | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 885205318d..3886d102aa 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -89,11 +89,11 @@ EventMesh Runtime是EventMesh集群中有状态的Mesh节点,负责Source Conn #### 本地构建运行 依赖准备: -``` -建议使用64位操作系统,建议使用Linux / Unix; -64位JDK 1.8+; -Gradle至少为7.0, 推荐 7.0.* -``` + +- 建议使用64位操作系统,建议使用Linux / Unix; +- 64位JDK 1.8+; +- Gradle至少为7.0, 推荐 7.0.* + ##### 1)源码启动 1.下载源码: @@ -241,7 +241,7 @@ sudo docker images ``` $ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE -apache/eventmesh v1.10.0 6e2964599c78 16 months ago 937MB +apache/eventmesh v1.10.0 6e2964599c78 10 days ago 937MB ``` 2.创建配置文件: @@ -521,12 +521,11 @@ tail -f demo_http_pub.out ### 运行EventMesh-Operator 准备: -``` -docker -golang (version 1.19) -kubernetes (kubectl) -kubernetes和docker之间有一定的兼容性,请检查它们之间的版本兼容性,并下载相应的版本,以确保它们能一起正常工作。 -``` + +- docker +- golang (version 1.19) +- kubernetes (kubectl) +> kubernetes和docker之间有一定的兼容性,请检查它们之间的版本兼容性,并下载相应的版本,以确保它们能一起正常工作。 #### 本地源码运行 @@ -567,12 +566,6 @@ runtimes.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z ``` # run controller make run - -# 成功启动pod后,运行以下命令查看pod。 -kubectl get pods -NAME READY STATUS RESTARTS AGE -connector-rocketmq-0 1/1 Running 0 12m -eventmesh-runtime-0-a-0 1/1 Running 0 12m ``` 2.创建和删除CRs: From 0106cf36b0dc957881ce9f87e38baa9b1b9aed9d Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 3 Jan 2024 17:18:02 +0800 Subject: [PATCH 08/36] update --- README.md | 20 ++++++++++---------- README.zh-CN.md | 18 +++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index c5cadc60a0..a2bfee4d0c 100644 --- a/README.md +++ b/README.md @@ -502,7 +502,7 @@ Dependencies: - docker - golang (version 1.19) - kubernetes (kubectl) -> There is some compatibility between kubernetes an docker, please check the version compatibility between them and download the corresponding version to ensure that they work properly together. +> There is some compatibility between kubernetes a docker, please check the version compatibility between them and download the corresponding version to ensure that they work properly together. #### Local source code run @@ -605,9 +605,9 @@ Apache EventMesh is licensed under the [Apache License, Version 2.0](http://www. ## Community -|WeChat Assistant|WeChat Public Account|Slack| -|-|-|-| -|||[Join Slack Chat](https://join.slack.com/t/the-asf/shared_invite/zt-1y375qcox-UW1898e4kZE_pqrNsrBM2g)(Please open an issue if this link is expired)| +| WeChat Assistant | WeChat Public Account | Slack | +|---------------------------------------------------------|--------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| | | [Join Slack Chat](https://join.slack.com/t/the-asf/shared_invite/zt-1y375qcox-UW1898e4kZE_pqrNsrBM2g)(Please open an issue if this link is expired) | Bi-weekly meeting : [#Tencent meeting](https://meeting.tencent.com/dm/wes6Erb9ioVV) : 346-6926-0133 @@ -615,9 +615,9 @@ Bi-weekly meeting record : [bilibili](https://space.bilibili.com/1057662180) ### Mailing List -|Name|Description|Subscribe|Unsubscribe|Archive -|-|-|-|-|-| -|Users|User discussion|[Subscribe](mailto:users-subscribe@eventmesh.apache.org)|[Unsubscribe](mailto:users-unsubscribe@eventmesh.apache.org)|[Mail Archives](https://lists.apache.org/list.html?users@eventmesh.apache.org)| -|Development|Development discussion (Design Documents, Issues, etc.)|[Subscribe](mailto:dev-subscribe@eventmesh.apache.org)|[Unsubscribe](mailto:dev-unsubscribe@eventmesh.apache.org)|[Mail Archives](https://lists.apache.org/list.html?dev@eventmesh.apache.org)| -|Commits|Commits to related repositories| [Subscribe](mailto:commits-subscribe@eventmesh.apache.org) |[Unsubscribe](mailto:commits-unsubscribe@eventmesh.apache.org) |[Mail Archives](https://lists.apache.org/list.html?commits@eventmesh.apache.org)| -|Issues|Issues or PRs comments and reviews| [Subscribe](mailto:issues-subscribe@eventmesh.apache.org) |[Unsubscribe](mailto:issues-unsubscribe@eventmesh.apache.org) |[Mail Archives](https://lists.apache.org/list.html?issues@eventmesh.apache.org)| +| Name | Description | Subscribe | Unsubscribe | Archive | +|-------------|---------------------------------------------------------|------------------------------------------------------------|----------------------------------------------------------------|----------------------------------------------------------------------------------| +| Users | User discussion | [Subscribe](mailto:users-subscribe@eventmesh.apache.org) | [Unsubscribe](mailto:users-unsubscribe@eventmesh.apache.org) | [Mail Archives](https://lists.apache.org/list.html?users@eventmesh.apache.org) | +| Development | Development discussion (Design Documents, Issues, etc.) | [Subscribe](mailto:dev-subscribe@eventmesh.apache.org) | [Unsubscribe](mailto:dev-unsubscribe@eventmesh.apache.org) | [Mail Archives](https://lists.apache.org/list.html?dev@eventmesh.apache.org) | +| Commits | Commits to related repositories | [Subscribe](mailto:commits-subscribe@eventmesh.apache.org) | [Unsubscribe](mailto:commits-unsubscribe@eventmesh.apache.org) | [Mail Archives](https://lists.apache.org/list.html?commits@eventmesh.apache.org) | +| Issues | Issues or PRs comments and reviews | [Subscribe](mailto:issues-subscribe@eventmesh.apache.org) | [Unsubscribe](mailto:issues-unsubscribe@eventmesh.apache.org) | [Mail Archives](https://lists.apache.org/list.html?issues@eventmesh.apache.org) | diff --git a/README.zh-CN.md b/README.zh-CN.md index 3886d102aa..bef6f8956d 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -435,7 +435,7 @@ TCP, HTTP 和 GRPC 示例都在eventmesh-examples模块下 #### 4.测试 -完成[store](#部署eventmesh-store)和[runtime](#部署eventmesh-runtime)的部署后,就可以在`eventmesh-examples`模块下运行我们的`demo`来体验`eventmesh`了! +完成[store](#部署eventmesh-store-)和[runtime](#部署eventmesh-runtime)的部署后,就可以在`eventmesh-examples`模块下运行我们的`demo`来体验`eventmesh`了! gradle编译: ``` @@ -628,8 +628,8 @@ Apache EventMesh 的开源协议遵循 [Apache License, Version 2.0](http://www. ## Community -| 微信小助手 | 微信公众号 | Slack | -| ------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------ | +| 微信小助手 | 微信公众号 | Slack | +|---------------------------------------------------------|--------------------------------------------------------|---------------------------------------------------------------------------------------------------------| | | | [加入 Slack ](https://join.slack.com/t/apacheeventmesh/shared_invite/zt-1t1816dli-I0t3OE~IpdYWrZbIWhMbXg) | 双周会议 : [#Tencent meeting](https://meeting.tencent.com/dm/wes6Erb9ioVV) : 346-6926-0133 @@ -638,10 +638,10 @@ Apache EventMesh 的开源协议遵循 [Apache License, Version 2.0](http://www. ### 邮件名单 -| 名称 | 描述 | 订阅 | 取消订阅 | 邮件列表存档 | -| ------- | --------------------------------- | ----------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ | -| 用户 | 用户支持与用户问题 | [订阅](mailto:users-subscribe@eventmesh.apache.org) | [取消订阅](mailto:users-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?users@eventmesh.apache.org) | -| 开发 | 开发相关 (设计文档, Issues等等.) | [订阅](mailto:dev-subscribe@eventmesh.apache.org) | [取消订阅](mailto:dev-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?dev@eventmesh.apache.org) | -| Commits | 所有与仓库相关的 commits 信息通知 | [订阅](mailto:commits-subscribe@eventmesh.apache.org) | [取消订阅](mailto:commits-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?commits@eventmesh.apache.org) | -| Issues | Issues 或者 PR 提交和代码Review | [订阅](mailto:issues-subscribe@eventmesh.apache.org) | [取消订阅](mailto:issues-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?issues@eventmesh.apache.org) | +| 名称 | 描述 | 订阅 | 取消订阅 | 邮件列表存档 | +|---------|--------------------------|-----------------------------------------------------|---------------------------------------------------------|-------------------------------------------------------------------------| +| 用户 | 用户支持与用户问题 | [订阅](mailto:users-subscribe@eventmesh.apache.org) | [取消订阅](mailto:users-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?users@eventmesh.apache.org) | +| 开发 | 开发相关 (设计文档, Issues等等.) | [订阅](mailto:dev-subscribe@eventmesh.apache.org) | [取消订阅](mailto:dev-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?dev@eventmesh.apache.org) | +| Commits | 所有与仓库相关的 commits 信息通知 | [订阅](mailto:commits-subscribe@eventmesh.apache.org) | [取消订阅](mailto:commits-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?commits@eventmesh.apache.org) | +| Issues | Issues 或者 PR 提交和代码Review | [订阅](mailto:issues-subscribe@eventmesh.apache.org) | [取消订阅](mailto:issues-unsubscribe@eventmesh.apache.org) | [邮件存档](https://lists.apache.org/list.html?issues@eventmesh.apache.org) | From 66afdb109d3cb0059566e693ce5c8b06c1b6f122 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Fri, 5 Jan 2024 15:13:09 +0800 Subject: [PATCH 09/36] add deploy operator on k8s --- README.md | 28 ++++++++++++++++++++++++++++ README.zh-CN.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/README.md b/README.md index a2bfee4d0c..48af915f15 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ This section of the guide will walk you through the deployment steps for EventMe - [Run Demo with shell scripts](#4run-demo-with-shell-scripts-) - [Run EventMesh-Operator](#run-eventmesh-operator) - [Local source code run](#local-source-code-run) + - [Deploy Operator on k8s](#deploy-operator-on-k8s) ### Deployment EventMesh Store @@ -574,6 +575,33 @@ eventmesh-runtime-0-a-0 1/1 Running 0 12m make delete ``` +#### Deploy Operator on k8s + +1.Deploy operator +Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`): +``` +make deploy +``` + +Run `kubectl get pods` to see the status of the deployed eventmesh-operator. +``` +NAME READY STATUS RESTARTS AGE +eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 20s +``` + +2.Execute the following command to deploy runtime, connector(To delete, simply replace `create` with `delete`.). +``` +make create +``` + +Run `kubectl get pods` to see if the deployment was successful. +``` +NAME READY STATUS RESTARTS AGE +connector-rocketmq-0 1/1 Running 0 9s +eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 3m12s +eventmesh-runtime-0-a-0 1/1 Running 0 15s +``` + ## Contributing Each contributor has played an important role in promoting the robust development of Apache EventMesh. We sincerely appreciate all contributors who have contributed code and documents. diff --git a/README.zh-CN.md b/README.zh-CN.md index bef6f8956d..68ae57d62b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -77,6 +77,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 - [测试](#4测试-) - [运行EventMesh-Operator](#运行eventmesh-operator) - [本地源码运行](#本地源码运行) + - [部署operator到k8s](#部署operator到k8s) ### 部署EventMesh Store @@ -597,6 +598,33 @@ eventmesh-runtime-0-a-0 1/1 Running 0 12m make delete ``` +#### 部署operator到k8s + +1.部署operator +运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy`即可): +``` +make deploy +``` + +运行 `kubectl get pods` 查看部署的eventmesh-operator状态. +``` +NAME READY STATUS RESTARTS AGE +eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 20s +``` + +2.运行以下命令部署runtime、connector(删除部署, 只需将`create` 替换为 `delete`即可). +``` +make create +``` + +运行 `kubectl get pods` 查看部署是否成功. +``` +NAME READY STATUS RESTARTS AGE +connector-rocketmq-0 1/1 Running 0 9s +eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 3m12s +eventmesh-runtime-0-a-0 1/1 Running 0 15s +``` + ## 贡献 每个贡献者在推动 Apache EventMesh 的健康发展中都发挥了重要作用。我们真诚感谢所有为代码和文档作出贡献的贡献者。 From 342600c76cd666a461bae1590669f71b21a8fd1b Mon Sep 17 00:00:00 2001 From: Alonexc Date: Tue, 9 Jan 2024 16:44:43 +0800 Subject: [PATCH 10/36] update --- README.md | 53 +++++++++++++++++++++++++++++++++---------------- README.zh-CN.md | 36 ++++++++++++++++++++++----------- 2 files changed, 60 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 48af915f15..2b69efbe54 100644 --- a/README.md +++ b/README.md @@ -89,14 +89,16 @@ The EventMesh Runtime is a stateful mesh node in an EventMesh cluster that is re #### Run on your local machine -Dependencies: +Dependencies: + - 64-bit OS, we recommend Linux/Unix. - 64-bit JDK 1.8 or JDK 11 - Gradle 7.0+, The recommended version can be found in the `gradle/wrapper/gradle-wrapper.properties` file. ##### 1)Run from source code -1.Download source code: +1.Download source code: + Download and extract the source code of the latest release from [EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0-source.tar.gz`. There are two ways to install the plugin: @@ -119,7 +121,7 @@ EventMesh will load plugins in the `dist/plugin` directory by default, you can c eventMesh.connector.plugin.type=rocketmq ``` -4.Configuring the VM startup parameters +4.Configuring the VM startup parameters ``` -Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml -Deventmesh.log.home=eventmesh-runtime/logs @@ -155,6 +157,7 @@ vim conf/eventmesh.properties ``` 2.Build and Load Plugins + Apache EventMesh introduces the SPI (Service Provider Interface) mechanism, which enables EventMesh to discover and load the plugins at runtime.The plugins could be installed with these methods: - Gradle Dependencies: Declare the plugins as the build dependencies in `eventmesh-starter/build.gradle`. ``` @@ -219,12 +222,14 @@ bash bin/stop.sh #### EventMesh Runtime with Docker -Dependencies: +Dependencies: + - 64-bit OS, we recommend Linux/Unix. - 64-bit JDK 1.8 or JDK 11. - Gradle 7.0+, The recommended version can be found in the `gradle/wrapper/gradle-wrapper.properties` file. -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: ``` sudo docker pull apache/eventmesh:v1.10.0 @@ -237,7 +242,8 @@ REPOSITORY TAG IMAGE ID CREATED SIZE apache/eventmesh v1.10.0 6e2964599c78 10 days ago 937MB ``` -2.Edit Configuration: +2.Edit Configuration: + Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. To integrate RocketMQ as a connector, these two configuration files should be created: `eventmesh.properties` and `rocketmq-client.properties`. ``` sudo mkdir -p /data/eventmesh/rocketmq/conf @@ -299,8 +305,10 @@ CONTAINER ID IMAGE COMMAND CREATED 5bb6b6092672 apache/eventmesh:v1.10.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll ``` -6.Managing EventMesh Containers +6.Managing EventMesh Containers + After successfully running an EventMesh container, you can manage the container by entering it, viewing logs, deleting it, and so on. + To connect to the EventMesh container: ``` sudo docker exec -it [your container id or name] /bin/bash @@ -342,7 +350,8 @@ Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncS Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish ``` -##### 1.2 BROADCAST +##### 1.2 BROADCAST + - Start subscriber to subscribe the topic (we have created the `TEST-TOPIC-TCP-BROADCAST` by default, you can also create other topic to test) ``` Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribeBroadcast @@ -352,12 +361,14 @@ Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncS Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublishBroadcast ```` -#### 2.HTTP +#### 2.HTTP + > For HTTP, the eventmesh-sdk-java implements sending and subscribing to asynchronous events. > > In the demo, the `content` field of the Java class `EventMeshMessage` represents a special protocol. Therefore, if you are using the eventmesh-sdk-java's http-client, you only need to design the content of the protocol and provide the consumer's application at the same time. -##### 2.1 ASYNC +##### 2.1 ASYNC + - The subscriber is a SpringBoot demo, so run this demo to start subscriber (we have created the topic `TEST-TOPIC-HTTP-ASYNC` by default, you can also create other topic to test) ``` Run the main method of org.apache.eventmesh.http.demo.sub.SpringBootDemoApplication @@ -374,7 +385,8 @@ Run the main method of org.apache.eventmesh.http.demo.pub.eventmeshmessage.Async > > It can subscribe to consume events through Webhook and event streaming, and also supports the CNCF CloudEvents protocol. -##### 3.1 ASYNC Publish & Webhook Subscribe +##### 3.1 ASYNC Publish & Webhook Subscribe + > Producers can asynchronously send events to the EventMesh Runtime without waiting for the events to be stored in the Event Store. > > For Webhook consumers, events will be pushed to the consumer's HTTP Endpoint URL, i.e., the consumer's `subscribeUrl`. This method is similar to the previously mentioned Http EventMesh client. @@ -389,7 +401,8 @@ Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPubli Run the main method of org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication ``` -##### 3.2 SYNC Publish & Stream Subscribe +##### 3.2 SYNC Publish & Stream Subscribe + > Producers synchronously send events to the EventMesh Runtime while waiting for the events to be stored in the Event Store. > > For event stream consumers, events are pushed in a streaming to the ReceiveMsgHook client. This method is similar to the EventMesh client. @@ -404,7 +417,8 @@ Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestRep Run the main method of org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe ``` -##### 3.3 Publish BATCH Message +##### 3.3 Publish BATCH Message + > Asynchronously batch publish multiple events to the EventMesh Runtime. - Start publisher to publish batch message (we have created the `TEST-TOPIC-GRPC-ASYNC` by default, you can also create other topic to test.) ``` @@ -499,7 +513,8 @@ You can see the run logs for the different modes under the `/logs` directory. ### Run EventMesh-Operator -Dependencies: +Dependencies: + - docker - golang (version 1.19) - kubernetes (kubectl) @@ -522,7 +537,8 @@ make install make uninstall ``` -If you get error `eventmesh-operator/bin/controller-gen: No such file or directory` +If you get error `eventmesh-operator/bin/controller-gen: No such file or directory` + Run the following command: ``` # download controller-gen locally if necessary. @@ -546,8 +562,10 @@ run eventmesh-operator: make run ``` -2.Create and delete CRs: -Custom resource objects are located at: `/config/samples` +2.Create and delete CRs: + +Custom resource objects are located at: `/config/samples` + When deleting CR, simply replace `create` with `delete`. ``` # Create CR for eventmesh-runtime、eventmesh-connector-rocketmq,Creating a clusterIP lets eventmesh-runtime communicate with other components. @@ -578,6 +596,7 @@ make delete #### Deploy Operator on k8s 1.Deploy operator + Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`): ``` make deploy diff --git a/README.zh-CN.md b/README.zh-CN.md index 68ae57d62b..83a68893fd 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -61,8 +61,10 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 - [EventMesh-catalog](https://github.com/apache/eventmesh-catalog): 使用 AsyncAPI 进行事件模式管理的目录服务。 - [EventMesh-go](https://github.com/apache/eventmesh-go): EventMesh 运行时的 Go 语言实现。 -## 快速入门 +## 快速入门 + 本段指南将指导您完成EventMesh的部署步骤 + - [部署EventMesh Store](#部署eventmesh-store-) - [部署EventMesh Runtime](#部署eventmesh-runtime) - [本地构建运行](#本地构建运行) @@ -84,7 +86,8 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 > EventMesh现在支持`standalone`、`RocketMQ`、`Kafka`等中间件作为存储 > 如果是在非`standalone`模式下,需要先部署所需的`store`,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) -### 部署EventMesh Runtime +### 部署EventMesh Runtime + EventMesh Runtime是EventMesh集群中有状态的Mesh节点,负责Source Connector与Sink Connector之间的事件传输,并可以使用EventMesh Storage作为事件的存储队列。 #### 本地构建运行 @@ -156,7 +159,8 @@ cd dist vim conf/eventmesh.properties ``` -2.构建并加载插件 +2.构建并加载插件 + Apache EventMesh引入了 SPI 机制,使 EventMesh 能够在运行时发现并加载插件。有两种方式安装插件: - Gradle依赖项: 在`eventmesh-starter/build.gradle`中将插件声明为构建依赖项。 ``` @@ -187,7 +191,8 @@ tail -f logs/eventmesh.out #### 远程部署 -在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,您将获得`apache-eventmesh-1.10.0-bin.tar.gz`。 +在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,您将获得`apache-eventmesh-1.10.0-bin.tar.gz`。 + 1.下载: ``` # 解压 @@ -222,12 +227,14 @@ bash bin/stop.sh #### Docker部署EventMesh Runtime 准备: + - 建议使用64位的linux系统。 - 请预先安装Docker Engine。Docker的安装过程可以参考[docker官方文档](https://docs.docker.com/engine/install/)。 - 建议掌握基础的docker概念和命令行,例如注册中心、挂载等等。不过这不是必须的,因为本次操作所需的命令都已为您列出。 - 若您选择非standalone模式,请确保[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/)已成功启动并且可以使用ip地址访问到;若您选择standalone模式,则无需启动RocketMQ 。 -1.获取EventMesh镜像 +1.获取EventMesh镜像 + 首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub](https://hub.docker.com)中下载最新发布的[EventMesh](https://hub.docker.com/r/apache/eventmesh)。 ``` sudo docker pull apache/eventmesh:v1.10.0 @@ -245,7 +252,8 @@ REPOSITORY TAG IMAGE ID CREATED SIZE apache/eventmesh v1.10.0 6e2964599c78 10 days ago 937MB ``` -2.创建配置文件: +2.创建配置文件: + 在根据EventMesh镜像运行对应容器之前,你需要创建两个配置文件,分别是:`eventmesh.properties`和`rocketmq-client.properties`。 首先,你需要使用下面的命令创建这两个文件。 ``` @@ -289,8 +297,10 @@ sudo vim eventmesh.properties |-----------------------------------------|---------------------------------|------------------------------------| | `eventMesh.server.rocketmq.namesrvAddr` | `127.0.0.1:9876;127.0.0.1:9876` | `RocketMQ namesrv default address` | -5.运行EventMesh +5.运行EventMesh + 现在你就可以开始根据下载好的EventMesh镜像运行容器了。 + 使用到的命令是`docker run`,有以下两点内容需要格外注意。 - 绑定容器端口和宿主机端口: 使用`docker run`的`-p`选项。 - 将宿主机中的两份配置文件挂在到容器中: 使用`docker run`的`-v`选项。 @@ -316,7 +326,8 @@ CONTAINER ID IMAGE COMMAND CREATED 5bb6b6092672 apache/eventmesh:v1.10.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll ``` -6.管理EventMesh容器 +6.管理EventMesh容器 + 在成功的运行了 EventMesh 容器后,你可以通过进入容器、查看日志、删除容器等方式管理容器。 **进入容器**命令示例: ``` @@ -545,7 +556,7 @@ make install make uninstall ``` -如果出现错误`eventmesh-operator/bin/controller-gen: No such file or directory` +如果出现错误`eventmesh-operator/bin/controller-gen: No such file or directory` 运行以下命令: ``` # 如有必要,在本地下载controller-gen. @@ -569,9 +580,9 @@ runtimes.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z make run ``` -2.创建和删除CRs: -自定义资源对象位于: `/config/samples` -删除CR,只需将`create`替换为`delete`即可。 +2.创建和删除CRs: + +自定义资源对象位于: `/config/samples`,删除CR,只需将`create`替换为`delete`即可。 ``` # 为eventmesh-runtime、eventmesh-connector-rocketmq创建CR,创建clusterIP可让eventmesh-runtime与其他组件通信。 make create @@ -601,6 +612,7 @@ make delete #### 部署operator到k8s 1.部署operator + 运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy`即可): ``` make deploy From 97d385f0f5dd5fb6e56d99dd9267296d0bbb14da Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 16:26:52 +0800 Subject: [PATCH 11/36] update --- README.md | 486 +++++---------------------------------------- README.zh-CN.md | 509 ++++++------------------------------------------ 2 files changed, 107 insertions(+), 888 deletions(-) diff --git a/README.md b/README.md index 2b69efbe54..b8eb8d198e 100644 --- a/README.md +++ b/README.md @@ -60,143 +60,32 @@ Please go to the [roadmap](https://eventmesh.apache.org/docs/roadmap) to get the ## Quick start -This section of the guide will walk you through the deployment steps for EventMesh: - -- [Deployment EventMesh Store](#deployment-eventmesh-store) -- [Deployment EventMesh Runtime](#deployment-eventmesh-runtime-) - - [Run on your local machine](#run-on-your-local-machine) - - [Run from source code](#1run-from-source-code) - - [Run form local binary](#2-run-form-local-binary) - - [Remote deployment](#remote-deployment) - - [EventMesh Runtime with Docker](#eventmesh-runtime-with-docker) -- [eventmesh-sdk-java demo](#eventmesh-sdk-java-demo) - - [TCP](#1tcp) - - [HTTP](#2http) - - [GRPC](#3grpc) - - [Run Demo with shell scripts](#4run-demo-with-shell-scripts-) -- [Run EventMesh-Operator](#run-eventmesh-operator) - - [Local source code run](#local-source-code-run) - - [Deploy Operator on k8s](#deploy-operator-on-k8s) +This section of the guide will show you the steps to deploy EventMesh from [local](#run-eventmesh-runtime-locally), [docker](#run-eventmesh-runtime-in-docker), [k8s](#run-eventmesh-runtime-in-kubernetes). + +This section guide is just to help you quickly get started with EventMesh deployment. Start EventMesh according to the default configuration. If you need more detailed EventMesh deployment steps, please visit the [EventMesh official document](https://eventmesh.apache.org/docs/next/introduction). ### Deployment EventMesh Store > EventMesh now supports `standalone`, `RocketMQ`, `Kafka` and other middleware as a storage. > 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/). -### Deployment EventMesh Runtime - -The EventMesh Runtime is a stateful mesh node in an EventMesh cluster that is responsible for event transfer between the Source Connector and the Sink Connector, and can use Event Store as a storage queue for events. - -#### Run on your local machine - -Dependencies: - -- 64-bit OS, we recommend Linux/Unix. -- 64-bit JDK 1.8 or JDK 11 -- Gradle 7.0+, The recommended version can be found in the `gradle/wrapper/gradle-wrapper.properties` file. - -##### 1)Run from source code - -1.Download source code: - -Download and extract the source code of the latest release from [EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0-source.tar.gz`. - -There are two ways to install the plugin: - -- classpath loading: Local developers can install the plugin by declaring it in the eventmesh-starter module build.gradle, e.g., declare that it uses the rocketmq plugin -``` -implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") -``` - -- File loading: By installing the plugin to the plugin directory, EventMesh will automatically load the plugins in the plugin directory according to the conditions at runtime, you can install the plugin by executing the following command -``` -./gradlew clean jar dist && ./gradlew installPlugin -``` - -3.Using Plugins - -EventMesh will load plugins in the `dist/plugin` directory by default, you can change the plugin directory with `-DeventMeshPluginDir=your_plugin_directory`. Examples of plugins to be used at runtime can be found in the `confPath` directory under `eventmesh.properties`. For example declare the use of the rocketmq plugin at runtime with the following settings. -``` -#connector plugin -eventMesh.connector.plugin.type=rocketmq -``` - -4.Configuring the VM startup parameters -``` --Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml --Deventmesh.log.home=eventmesh-runtime/logs --Deventmesh.home=eventmesh-runtime --DconfPath=eventmesh-runtime/conf -``` -> Note: If your operating system is Windows, you may need to replace the file separator with `'\'`. - -5.Getting up and running -``` -Run org.apache.eventmesh.starter. -``` - -##### 2) Run form local binary - -1.Download Source Code - -Download and extract the source code of the latest release from [EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get apache-eventmesh-1.10.0-source.tar.gz. -``` -tar -xvzf apache-eventmesh-1.10.0-source.tar.gz -cd apache-eventmesh-1.10.0-src/ -``` - -Build the source code with Gradle. -``` -gradle clean dist -``` - -Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. -``` -cd dist -vim conf/eventmesh.properties -``` - -2.Build and Load Plugins - -Apache EventMesh introduces the SPI (Service Provider Interface) mechanism, which enables EventMesh to discover and load the plugins at runtime.The plugins could be installed with these methods: -- Gradle Dependencies: Declare the plugins as the build dependencies in `eventmesh-starter/build.gradle`. -``` -dependencies { - implementation project(":eventmesh-runtime") - - // Example: Load the RocketMQ plugin - implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") -} -``` - -- Plugin directory: EventMesh loads the plugins in the `dist/plugin` directory based on `eventmesh.properties`. The `installPlugin` task of Gradle builds and moves the plugins into the `dist/plugin` directory. -``` -gradle installPlugin -``` - -3.Start Runtime - -Execute the `start.sh` script to start the EventMesh Runtime server. -``` -bash bin/start.sh -``` +### Run EventMesh Runtime locally -View the output log: +Please check the JKD version before you start, you need to install Java 8. ``` -tail -f logs/eventmesh.out +$ java -version +java version "1.8.0_311" ``` -#### Remote deployment - -1.Download: +#### 1.Download: -Download and extract the executable binaries of the latest release from[EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0.tar.gz`. +Download and extract the executable binaries of the latest release from[EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0.tar.gz`. ``` tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` -2.Deploy +#### 2.Deploy 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. ``` @@ -215,34 +104,28 @@ cd /root/apache-eventmesh-1.10.0/logs tail -f eventmesh.out ``` -You can stop the run with the following command: +You can stop the run with the following command: ``` bash bin/stop.sh ``` -#### EventMesh Runtime with Docker - -Dependencies: +### Run EventMesh Runtime in Docker -- 64-bit OS, we recommend Linux/Unix. -- 64-bit JDK 1.8 or JDK 11. -- Gradle 7.0+, The recommended version can be found in the `gradle/wrapper/gradle-wrapper.properties` file. - -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: ``` -sudo docker pull apache/eventmesh:v1.10.0 +sudo docker pull apache/eventmesh:latest ``` -To verify that the apache/eventmesh image is successfully installed, list the downloaded images with docker images: +To verify that the apache/eventmesh image is successfully installed, list the downloaded images with docker images: ``` $ sudo docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -apache/eventmesh v1.10.0 6e2964599c78 10 days ago 937MB +REPOSITORY TAG IMAGE ID CREATED SIZE +apache/eventmesh latest f32f9e5e4694 2 days ago 917MB ``` -2.Edit Configuration: +#### 2.Edit Configuration: Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. To integrate RocketMQ as a connector, these two configuration files should be created: `eventmesh.properties` and `rocketmq-client.properties`. ``` @@ -252,22 +135,23 @@ sudo touch eventmesh.properties sudo touch rocketmq-client.properties ``` -3.Configure `eventmesh.properties` +#### 3.Configure `eventmesh.properties` -The `eventmesh.properties` file contains the properties of EventMesh Runtime environment and integrated plugins.Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties) for the available configuration keys. +The `eventmesh.properties` file contains the properties of EventMesh Runtime environment and integrated plugins.Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties) for the available configuration keys. ``` sudo vim eventmesh.properties ``` 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` | +| 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` +#### 4.Configure `rocketmq-client.properties` The `rocketmq-client.properties` file contains the properties of the Apache RocketMQ nameserver. @@ -283,35 +167,25 @@ Please check if the `default namesrvAddr` in the configuration file is occupied, |-----------------------------------------|---------------------------------|------------------------------------| | `eventMesh.server.rocketmq.namesrvAddr` | `127.0.0.1:9876;127.0.0.1:9876` | `RocketMQ namesrv default address` | -5.Run and Manage EventMesh Container +#### 5.Run and Manage EventMesh Container -Run an EventMesh container from the `apache/eventmesh` image with the `docker run` command. +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. +- The `-v` option of the command mounts the configuration files from files in the host machine. ``` -sudo docker run -d \ - -p 10000:10000 -p 10105:10105 \ +sudo docker run -d --name eventmesh \ + -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 \ -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ - apache/eventmesh:v1.10.0 + apache/eventmesh:latest ``` -If you see a new line of output after running the command, the container running the EventMesh image has started successfully. 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 -5bb6b6092672 apache/eventmesh:v1.10.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll -``` - -6.Managing EventMesh Containers - -After successfully running an EventMesh container, you can manage the container by entering it, viewing logs, deleting it, and so on. - -To connect to the EventMesh container: -``` -sudo docker exec -it [your container id or name] /bin/bash +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 ``` To read the log of the EventMesh container: @@ -320,295 +194,33 @@ cd ../logs tail -f eventmesh.out ``` -To stop or remove the container: -``` -sudo docker stop [container id or name] -sudo docker rm -f [container id or name] -``` - -### eventmesh-sdk-java demo - -> eventmesh-sdk-java acts as a client of EventMesh Runtime and communicates with it, to publish and subscribe the messages. -> -> The eventmesh-sdk-java supports ASYNC messages and BROADCAST messages. ASYNC messages indicate that producers only send messages and do not care about receiving reply messages. BROADCAST messages mean that producers send a message once, and all consumers subscribed to the broadcast topic will receive the message. -> -> eventmesh-sdk-java supports HTTP, TCP and gRPC protocols. - -The test demos of TCP, HTTP and GRPC are in the module `eventmesh-examples`. - -#### 1.TCP +### Run EventMesh Runtime in Kubernetes -##### 1.1 ASYNC +#### 1.Deploy operator -- Start consumer to subscribe the topic (we have created the `TEST-TOPIC-TCP-ASYNC` by default, you can also create other topic to test) +Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`): ``` -Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe -``` - -- Start producer to publish async message -``` -Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish -``` - -##### 1.2 BROADCAST - -- Start subscriber to subscribe the topic (we have created the `TEST-TOPIC-TCP-BROADCAST` by default, you can also create other topic to test) -``` -Run the main method of org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribeBroadcast -``` -- Start publisher to publish async message -```` -Run the main method of org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublishBroadcast -```` - -#### 2.HTTP - -> For HTTP, the eventmesh-sdk-java implements sending and subscribing to asynchronous events. -> -> In the demo, the `content` field of the Java class `EventMeshMessage` represents a special protocol. Therefore, if you are using the eventmesh-sdk-java's http-client, you only need to design the content of the protocol and provide the consumer's application at the same time. - -##### 2.1 ASYNC - -- The subscriber is a SpringBoot demo, so run this demo to start subscriber (we have created the topic `TEST-TOPIC-HTTP-ASYNC` by default, you can also create other topic to test) -``` -Run the main method of org.apache.eventmesh.http.demo.sub.SpringBootDemoApplication -``` - -> Start publisher to publish message -``` -Run the main method of org.apache.eventmesh.http.demo.pub.eventmeshmessage.AsyncPublishInstance -``` - -#### 3.GRPC - -> The eventmesh-sdk-java implements the gRPC protocol. It can asynchronously or synchronously send events to the EventMesh Runtime. -> -> It can subscribe to consume events through Webhook and event streaming, and also supports the CNCF CloudEvents protocol. - -##### 3.1 ASYNC Publish & Webhook Subscribe - -> Producers can asynchronously send events to the EventMesh Runtime without waiting for the events to be stored in the Event Store. -> -> For Webhook consumers, events will be pushed to the consumer's HTTP Endpoint URL, i.e., the consumer's `subscribeUrl`. This method is similar to the previously mentioned Http EventMesh client. - -- Start publisher to publish message (we have created the topic `TEST-TOPIC-GRPC-ASYNC` by default, you can also create other topic to test) -``` -Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPublishInstance -``` - -- Start webhook subscriber -``` -Run the main method of org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication -``` - -##### 3.2 SYNC Publish & Stream Subscribe - -> Producers synchronously send events to the EventMesh Runtime while waiting for the events to be stored in the Event Store. -> -> For event stream consumers, events are pushed in a streaming to the ReceiveMsgHook client. This method is similar to the EventMesh client. - -- Start Request-Reply publisher to publish message (we have created the topic `TEST-TOPIC-GRPC-RR` by default, you can also create other topic to test) -``` -Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestReplyInstance -``` - -- Start stream subscriber -``` -Run the main method of org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe -``` - -##### 3.3 Publish BATCH Message - -> Asynchronously batch publish multiple events to the EventMesh Runtime. -- Start publisher to publish batch message (we have created the `TEST-TOPIC-GRPC-ASYNC` by default, you can also create other topic to test.) -``` -Run the main method of org.apache.eventmesh.grpc.pub.eventmeshmessage.BatchPublishInstance -``` - -#### 4.Run Demo with shell scripts - -Please refer to [Event Store](#deployment-eventmesh-store) and [EventMesh Runtime](#deployment-eventmesh-runtime-) to finish the necessary deployment before try our demo. - -After finishing the deployment of Store and Runtime, you can run our demos in module `eventmesh-examples`: - -gradle: -``` -cd apache-eventmesh-1.10.0-src/eventmesh-examples -gradle clean dist -cd ./dist/bin -``` - -##### 4.1 TCP - -TCP Sub -``` -bash tcp_eventmeshmessage_sub.sh -``` - -Open the corresponding log file to view the log: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_pub.out -``` - -TCP Pub -``` -bash tcp_pub_eventmeshmessage.sh -``` - -Open the corresponding log file to view the log: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_sub.out -``` - -##### 4.2 TCP Broadcast - -TCP Sub Broadcast -``` -sh tcp_sub_eventmeshmessage_broadcast.sh -``` - -Open the corresponding log file to view the log: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_sub_broadcast.out -``` - -TCP Pub Broadcast -``` -sh tcp_pub_eventmeshmessage_broadcast.sh -``` - -Open the corresponding log file to view the log: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_pub_broadcast.out -``` - -##### 4.3 HTTP - -HTTP Sub -``` -sh http_sub.sh -``` - -Open the corresponding log file to view the log: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_http_sub.out -``` - -HTTP Pub -``` -sh http_pub_eventmeshmessage.sh -``` - -Open the corresponding log file to view the log: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_http_pub.out -``` -You can see the run logs for the different modes under the `/logs` directory. - -### Run EventMesh-Operator - -Dependencies: - -- docker -- golang (version 1.19) -- kubernetes (kubectl) -> There is some compatibility between kubernetes a docker, please check the version compatibility between them and download the corresponding version to ensure that they work properly together. - -#### Local source code run - -1.Start: - -Go to the eventmesh-operator directory. -``` -cd eventmesh-operator -``` - -Install CRD into the specified k8s cluster. -``` -make install - -# Uninstall CRDs from the K8s cluster -make uninstall -``` - -If you get error `eventmesh-operator/bin/controller-gen: No such file or directory` - -Run the following command: -``` -# download controller-gen locally if necessary. -make controller-gen -# download kustomize locally if necessary. -make kustomize -``` - -View crds information: -``` -# run the following command to view crds information: -kubectl get crds -NAME CREATED AT -connectors.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z -runtimes.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z -``` - -run eventmesh-operator: -``` -# run controller -make run +make deploy ``` - -2.Create and delete CRs: - -Custom resource objects are located at: `/config/samples` - -When deleting CR, simply replace `create` with `delete`. ``` -# Create CR for eventmesh-runtime、eventmesh-connector-rocketmq,Creating a clusterIP lets eventmesh-runtime communicate with other components. -make create - -#success: -configmap/runtime-config created -runtime.eventmesh-operator.eventmesh/eventmesh-runtime created -service/runtime-cluster-service created -configmap/connector-rocketmq-config created -connectors.eventmesh-operator.eventmesh/connector-rocketmq created - -# View the created Service. -kubectl get service -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -runtime-cluster-service ClusterIP 10.109.209.72 10000/TCP 17s - -# After the pods are successfully started, run the following command to view pods. -kubectl get pods -NAME READY STATUS RESTARTS AGE -connector-rocketmq-0 1/1 Running 0 12m -eventmesh-runtime-0-a-0 1/1 Running 0 12m - -# delete CR -make delete +tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz +cd apache-eventmesh-1.10.0 ``` -#### Deploy Operator on k8s - -1.Deploy operator -Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`): -``` -make deploy -``` - -Run `kubectl get pods` to see the status of the deployed eventmesh-operator. +Run `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh`to see the status of the deployed eventmesh-operator. ``` +$ kubectl get pods NAME READY STATUS RESTARTS AGE eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 20s + +$ kubectl get crd | grep eventmesh-operator.eventmesh +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 ``` diff --git a/README.zh-CN.md b/README.zh-CN.md index 83a68893fd..dcf80e3093 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -63,199 +63,77 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ## 快速入门 -本段指南将指导您完成EventMesh的部署步骤 - -- [部署EventMesh Store](#部署eventmesh-store-) -- [部署EventMesh Runtime](#部署eventmesh-runtime) - - [本地构建运行](#本地构建运行) - - [源码启动](#1源码启动-) - - [本地二进制构建](#2-本地二进制构建) - - [远程部署](#远程部署) - - [Docker部署EventMesh Runtime](#docker部署eventmesh-runtime) -- [eventmesh-sdk-java demo](#eventmesh-sdk-java-demo-) - - [TCP](#1tcp-) - - [HTTP](#2http) - - [GRPC](#3grpc) - - [测试](#4测试-) -- [运行EventMesh-Operator](#运行eventmesh-operator) - - [本地源码运行](#本地源码运行) - - [部署operator到k8s](#部署operator到k8s) - -### 部署EventMesh Store +本节指南将指导您分别从[本地](#在本地运行-eventmesh-runtime)、[docker](#在-docker-中运行-eventmesh-runtime-)、[k8s](#在-kubernetes-中运行-eventmesh-runtime-)部署EventMesh的步骤: -> EventMesh现在支持`standalone`、`RocketMQ`、`Kafka`等中间件作为存储 -> 如果是在非`standalone`模式下,需要先部署所需的`store`,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) - -### 部署EventMesh Runtime - -EventMesh Runtime是EventMesh集群中有状态的Mesh节点,负责Source Connector与Sink Connector之间的事件传输,并可以使用EventMesh Storage作为事件的存储队列。 - -#### 本地构建运行 - -依赖准备: - -- 建议使用64位操作系统,建议使用Linux / Unix; -- 64位JDK 1.8+; -- Gradle至少为7.0, 推荐 7.0.* - -##### 1)源码启动 - -1.下载源码: -从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。您将获得`apache-eventmesh-1.10.0-source.tar.gz`。 - -2.安装插件: - -有两种方式安装插件: - -- classpath加载: 本地开发可以通过在 eventmesh-starter 模块 build.gradle 中进行声明,例如声明使用 rocketmq 插件 -``` -implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") -``` - -- 文件加载: 通过将插件安装到插件目录,EventMesh在运行时会根据条件自动加载插件目录下的插件,可以通过执行以下命令安装插件 -``` -./gradlew clean jar dist && ./gradlew installPlugin -``` - -3.使用插件 -EventMesh 会默认加载`dist/plugin`目录下的插件,可以通过`-DeventMeshPluginDir=your_plugin_directory`来改变插件目录。运行时需要使用的插件实例可以在`confPath`目录下面的`eventmesh.properties`中进行配置。例如通过以下设置声明在运行时使用rocketmq插件。 -``` -#connector plugin -eventMesh.connector.plugin.type=rocketmq -``` - -4.配置VM启动参数 -``` --Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml --Deventmesh.log.home=eventmesh-runtime/logs --Deventmesh.home=eventmesh-runtime --DconfPath=eventmesh-runtime/conf -``` -> 注:如果操作系统为Windows, 可能需要将文件分隔符换成`'\'` - -5.启动运行 -``` -运行org.apache.eventmesh.starter.StartUp的主要方法 -``` - -##### 2) 本地二进制构建 - -1.下载源码 - -从[EventMesh download](https://eventmesh.apache.org/download/)下载并提取最新版本的源代码。比如目前最新版,您将获得`apache-eventmesh-1.9.0-source.tar.gz`。 -``` -tar -xvzf apache-eventmesh-1.10.0-source.tar.gz -cd apache-eventmesh-1.10.0-src/ -``` - -使用 Gradle 构建源代码。 -``` -gradle clean dist -``` - -编辑`eventmesh.properties`以更改EventMesh Runtime的配置(如 TCP 端口、客户端黑名单)。 -``` -cd dist -vim conf/eventmesh.properties -``` +本节指南只是帮助你快速入门EventMesh部署,按照默认配置启动EventMesh,如果您需要更加详细的EventMesh部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。 -2.构建并加载插件 +### 部署 EventMesh Store -Apache EventMesh引入了 SPI 机制,使 EventMesh 能够在运行时发现并加载插件。有两种方式安装插件: -- Gradle依赖项: 在`eventmesh-starter/build.gradle`中将插件声明为构建依赖项。 -``` -dependencies { - implementation project(":eventmesh-runtime") +> EventMesh现在支持`standalone`、`RocketMQ`、`Kafka`等中间件作为存储 +> 如果是在非`standalone`模式下,需要先部署所需的`store`,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) - // 示例: 加载 RocketMQ 插件 - implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq") -} -``` +### 在本地运行 EventMesh Runtime -- 插件目录: EventMesh会根据`eventmesh.properties`加载`dist/plugin`目录中的插件。Gradle的`installPlugin`任务会构建插件并将其移动到`dist/plugin`目录中。 +请在开始之前检查JKD版本,需要下载Java 8. ``` -gradle installPlugin +$ java -version +java version "1.8.0_311" ``` -3.启动Runtime - -执行`start.sh`脚本启动EventMesh Runtime服务器。 -``` -bash bin/start.sh -``` +#### 1.下载 -查看输出日志: +在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,您将获得`apache-eventmesh-1.10.0-bin.tar.gz`。 ``` -tail -f logs/eventmesh.out -``` - -#### 远程部署 - -在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,您将获得`apache-eventmesh-1.10.0-bin.tar.gz`。 - -1.下载: -``` -# 解压 tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` -2.部署 +#### 2. 运行 编辑`eventmesh.properties`以更改EventMesh Runtime的配置(如 TCP 端口、客户端黑名单)。 ``` vim conf/eventmesh.properties ``` -执行`start.sh`脚本启动EventMesh Runtime服务器。 +执行`start.sh`脚本启动EventMesh Runtime服务器。 ``` bash bin/start.sh ``` -如果看到`EventMeshTCPServer[port=10000] started....`, 则说明设置成功。 +如果看到`EventMeshTCPServer[port=10000] started....`, 则说明设置成功。 -查看输出日志: +查看输出日志: ``` cd /root/apache-eventmesh-1.10.0/logs tail -f eventmesh.out ``` -停止: +停止: ``` bash bin/stop.sh ``` -#### Docker部署EventMesh Runtime +### 在 Docker 中运行 EventMesh Runtime -准备: +#### Docker部署EventMesh Runtime -- 建议使用64位的linux系统。 -- 请预先安装Docker Engine。Docker的安装过程可以参考[docker官方文档](https://docs.docker.com/engine/install/)。 -- 建议掌握基础的docker概念和命令行,例如注册中心、挂载等等。不过这不是必须的,因为本次操作所需的命令都已为您列出。 -- 若您选择非standalone模式,请确保[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/)已成功启动并且可以使用ip地址访问到;若您选择standalone模式,则无需启动RocketMQ 。 +#### 1.获取EventMesh镜像 -1.获取EventMesh镜像 - -首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub](https://hub.docker.com)中下载最新发布的[EventMesh](https://hub.docker.com/r/apache/eventmesh)。 +首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub](https://hub.docker.com)中下载最新发布的[EventMesh](https://hub.docker.com/r/apache/eventmesh)。 ``` sudo docker pull apache/eventmesh:v1.10.0 ``` 您可以使用以下命令列出并查看本地已有的镜像。 ``` -sudo docker images -``` - -如果终端显示如下所示的镜像信息,则说明 EventMesh 镜像已经成功下载到本地。 -``` $ sudo docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -apache/eventmesh v1.10.0 6e2964599c78 10 days ago 937MB +REPOSITORY TAG IMAGE ID CREATED SIZE +apache/eventmesh latest f32f9e5e4694 2 days ago 917MB ``` -2.创建配置文件: +#### 2.创建配置文件: 在根据EventMesh镜像运行对应容器之前,你需要创建两个配置文件,分别是:`eventmesh.properties`和`rocketmq-client.properties`。 -首先,你需要使用下面的命令创建这两个文件。 +首先,你需要使用下面的命令创建这两个文件。 ``` sudo mkdir -p /data/eventmesh/rocketmq/conf cd /data/eventmesh/rocketmq/conf @@ -263,24 +141,25 @@ sudo touch eventmesh.properties sudo touch rocketmq-client.properties ``` -3.配置`eventmesh.properties` +#### 3.配置`eventmesh.properties` 这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 -使用下面的`vim`命令编辑`eventmesh.properties`。 +使用下面的`vim`命令编辑`eventmesh.properties`。 ``` sudo vim eventmesh.properties ``` -你可以直接将 GitHub 仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties)中的内容复制过来。 +你可以直接将 GitHub 仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties)中的内容复制过来。 -请检查配置文件里的默认端口是否已被占用,如果被占用请修改成未被占用的端口: +请检查配置文件里的默认端口是否已被占用,如果被占用请修改成未被占用的端口: -| 属性 | 默认值 | 备注 | -|------------------------------|---------|------------------------------| -| `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.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` +#### 4.配置`rocketmq-client.properties` 这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 @@ -288,7 +167,7 @@ sudo vim eventmesh.properties ``` sudo vim eventmesh.properties ``` -你可以直接将GitHub仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties)中的内容复制过来 +你可以直接将GitHub仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties)中的内容复制过来 > 请注意,如果您正在运行的 namesetver 地址不是配置文件中的默认值,请将其修改为实际正在运行的nameserver地址。 请检查配置文件里的默认namesrvAddr是否已被占用,如果被占用请修改成未被占用的地址: @@ -297,331 +176,59 @@ sudo vim eventmesh.properties |-----------------------------------------|---------------------------------|------------------------------------| | `eventMesh.server.rocketmq.namesrvAddr` | `127.0.0.1:9876;127.0.0.1:9876` | `RocketMQ namesrv default address` | -5.运行EventMesh +#### 5.运行EventMesh -现在你就可以开始根据下载好的EventMesh镜像运行容器了。 +现在你就可以开始根据下载好的EventMesh镜像运行容器了。 -使用到的命令是`docker run`,有以下两点内容需要格外注意。 +使用到的命令是`docker run`,有以下两点内容需要格外注意。 - 绑定容器端口和宿主机端口: 使用`docker run`的`-p`选项。 -- 将宿主机中的两份配置文件挂在到容器中: 使用`docker run`的`-v`选项。 +- 将宿主机中的两份配置文件挂在到容器中: 使用`docker run`的`-v`选项。 -综合一下,对应的启动命令为: +综合一下,对应的启动命令为: ``` -sudo docker run -d \ - -p 10000:10000 -p 10105:10105 \ +sudo docker run -d --name eventmesh \ + -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 \ -v /data/eventmesh/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ - apache/eventmesh:v1.10.0 + apache/eventmesh:latest ``` -如果运行命令之后看到新输出一行字符串,那么运行 EventMesh 镜像的容器就启动成功了。 -接下来,你可以使用下面的命令查看容器的状态。 +接下来,你可以使用下面的命令查看容器的状态。 ``` sudo docker ps ``` -如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。 -``` -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -5bb6b6092672 apache/eventmesh:v1.10.0 "/bin/sh -c 'sh star…" 5 seconds ago Up 3 seconds 0.0.0.0:10000->10000/tcp, :::10000->10000/tcp, 0.0.0.0:10105->10105/tcp, :::10105->10105/tcp eager_driscoll -``` - -6.管理EventMesh容器 - -在成功的运行了 EventMesh 容器后,你可以通过进入容器、查看日志、删除容器等方式管理容器。 -**进入容器**命令示例: +如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。 ``` -sudo docker exec -it [your container id or name] /bin/bash +$ 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 ``` -在容器中**查看日志**命令示例: +读取 EventMesh 容器的日志: ``` cd ../logs tail -f eventmesh.out ``` -**删除容器**命令示例: -``` -sudo docker rm -f [your container id or name] -``` - -### eventmesh-sdk-java demo -> EventMesh-sdk-java作为客户端,与eventmesh-runtime通信,用于完成消息的发送和接收。 -> EventMesh-sdk-java支持异步消息和广播消息。异步消息表示生产者只发送消息,不关心回复消息。广播消息表示生产者发送一次消息,所有订阅广播主题的消费者都将收到消息 -> EventMesh-sdk-java支持HTTP,TCP 和 GRPC 协议。 - -TCP, HTTP 和 GRPC 示例都在eventmesh-examples模块下 - -#### 1.TCP - -##### 1.1 异步消息 - -- 创建主题`TEST-TOPIC-TCP-ASYNC`,可以通过`rocketmq-console`或者`rocketmq tools`命令 -- 启动消费者,订阅上一步骤已经创建的Topic -``` -运行 org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribe 的main方法 -``` - -- 启动发送端,发送消息 -``` -运行 org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublish 的main方法 -``` - -##### 1.2 广播消息 - -- 创建主题`TEST-TOPIC-TCP-BROADCAST`,可以通过`rocketmq-console`或者`rocketmq tools`命令 -- 启动消费端,订阅上一步骤已经创建的Topic -``` -运行 org.apache.eventmesh.tcp.demo.sub.eventmeshmessage.AsyncSubscribeBroadcast 的main方法 -``` - -- 启动发送端,发送广播消息 -```` -运行 org.apache.eventmesh.tcp.demo.pub.eventmeshmessage.AsyncPublishBroadcast 的main方法 -```` - -#### 2.HTTP - -> 对于HTTP,eventmesh-sdk-java对对于异步事件实现了发送与订阅 -> 在演示中,Java类LiteMessage的content字段表示一个特殊的协议,因此,如果您要使用eventmesh-sdk-java的http-client,则只需设计协议的内容并在同一时间提供消费者的应用程序。 - -##### 2.1 异步事件 - -> 生产者将事件发送给下游即可,无需等待响应 - -- 创建主题`TEST-TOPIC-HTTP-ASYNC`,可以通过`rocketmq-console`或者`rocketmq tools`命令 -- 启动消费端,订阅Topic - 异步事件消费端为spring boot demo,运行demo即可启动服务并完成Topic订阅 -``` -运行 org.apache.eventmesh.http.demo.sub.SpringBootDemoApplication 的main方法 -``` - -- 启动发送端,发送消息 -``` -运行 org.apache.eventmesh.http.demo.pub.eventmeshmessage.AsyncPublishInstance 的main方法 -``` - -#### 3.GRPC - -> eventmesh-sdk-java 实现了 gRPC 协议. 它能异步和同步发送事件到 eventmesh-runtime. 它可以通过webhook和事件流方式订阅消费事件, 同时也支持 CNCF CloudEvents 协议. - -##### 3.1 异步事件发送 和 webhook订阅 - -> `Async生产者`异步发送事件到`eventmesh-runtime`, 不需要等待事件储存到`event-store`在`webhook`消费者, 事件推送到消费者的`http endpoint url`。这个URL在消费者的`Subscription`模型定于. 这方法跟前面的`Http eventmsh client`类似。 - -- 在rocketmq 创建主题`TEST-TOPIC-GRPC-ASYNC` -- 启动 publisher 发送事件 -``` -运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPublishInstance 的main方法 -``` - -- 启动webhook消费者 -``` -运行 org.apache.eventmesh.grpc.sub.app.SpringBootDemoApplication 的main方法 -``` - -##### 3.2 同步事件发送和事件流订阅 - -> `同步生产者`发送事件到`eventmesh-runtime`, 同时等待事件储存到`event-store`在事件流消费者,事件以流的形式推送到`ReceiveMsgHook`客户端。 这方法类似`eventmesh client`. - -- 在rocketmq 创建主题`TEST-TOPIC-GRPC-RR` -- 启动`Request-Reply publisher`发送事件 -``` -运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.RequestReplyInstance 的main方法 -``` - -- 启动`stream subscriber` -``` -运行 org.apache.eventmesh.grpc.sub.EventmeshAsyncSubscribe 的main方法 -``` - -##### 3.3 批量事件发布 - -> 批量发布多个事件到 eventmesh-runtime. 这是异步操作 - -- 在rocketmq创建主题`TEST-TOPIC-GRPC-ASYNC` -- 启动 publisher 来批量发布事件 -``` -运行 org.apache.eventmesh.grpc.pub.eventmeshmessage.BatchPublishInstance 的main方法 -``` - -#### 4.测试 - -完成[store](#部署eventmesh-store-)和[runtime](#部署eventmesh-runtime)的部署后,就可以在`eventmesh-examples`模块下运行我们的`demo`来体验`eventmesh`了! - -gradle编译: -``` -cd apache-eventmesh-1.10.0-src/eventmesh-examples -gradle clean dist -cd ./dist/bin -``` - -##### 4.1 TCP +### 在 Kubernetes 中运行 EventMesh Runtime -TCP Sub -``` -bash tcp_eventmeshmessage_sub.sh -``` - -打开对应log文件查看日志: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_pub.out -``` - -TCP Pub -``` -bash tcp_pub_eventmeshmessage.sh -``` - -打开对应log文件查看日志: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_sub.out -``` - -##### 4.2 TCP Broadcast - -TCP Sub Broadcast -``` -sh tcp_sub_eventmeshmessage_broadcast.sh -``` - -打开对应log文件查看日志: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_sub_broadcast.out -``` - -TCP Pub Broadcast -``` -sh tcp_pub_eventmeshmessage_broadcast.sh -``` - -打开对应log文件查看日志: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_tcp_pub_broadcast.out -``` - -##### 4.3 HTTP - -HTTP Sub -``` -sh http_sub.sh -``` - -打开对应log文件查看日志: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_http_sub.out -``` - -HTTP Pub -``` -sh http_pub_eventmeshmessage.sh -``` - -打开对应log文件查看日志: -``` -cd /root/apache-eventmesh-1.10.0-src/eventmesh-examples/dist/logs -tail -f demo_http_pub.out -``` - -你可以在`/logs`目录下面看到不同模式的运行日志。 - -### 运行EventMesh-Operator - -准备: - -- docker -- golang (version 1.19) -- kubernetes (kubectl) -> kubernetes和docker之间有一定的兼容性,请检查它们之间的版本兼容性,并下载相应的版本,以确保它们能一起正常工作。 - -#### 本地源码运行 - -1.启动: - -进入eventmesh-operator目录。 -``` -cd eventmesh-operator -``` - -将CRD安装到k8s集群。 -``` -make install - -# Uninstall CRDs from the K8s cluster -make uninstall -``` - -如果出现错误`eventmesh-operator/bin/controller-gen: No such file or directory` -运行以下命令: -``` -# 如有必要,在本地下载controller-gen. -make controller-gen -# 如有必要,在本地下载kustomize. -make kustomize -``` - -查看crds信息: -``` -# 运行以下命令查看 crds 信息: -kubectl get crds -NAME CREATED AT -connectors.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z -runtimes.eventmesh-operator.eventmesh 2023-11-28T01:35:21Z -``` - -运行eventmesh-operator: -``` -# run controller -make run -``` - -2.创建和删除CRs: - -自定义资源对象位于: `/config/samples`,删除CR,只需将`create`替换为`delete`即可。 -``` -# 为eventmesh-runtime、eventmesh-connector-rocketmq创建CR,创建clusterIP可让eventmesh-runtime与其他组件通信。 -make create - -#success: -configmap/runtime-config created -runtime.eventmesh-operator.eventmesh/eventmesh-runtime created -service/runtime-cluster-service created -configmap/connector-rocketmq-config created -connectors.eventmesh-operator.eventmesh/connector-rocketmq created - -# 查看创建的service. -kubectl get service -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -runtime-cluster-service ClusterIP 10.109.209.72 10000/TCP 17s - -# 运行以下命令查看pod. -kubectl get pods -NAME READY STATUS RESTARTS AGE -connector-rocketmq-0 1/1 Running 0 12m -eventmesh-runtime-0-a-0 1/1 Running 0 12m - -# 删除CR -make delete -``` - -#### 部署operator到k8s - -1.部署operator +1.部署 Operator 运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy`即可): ``` make deploy ``` -运行 `kubectl get pods` 查看部署的eventmesh-operator状态. +运行 `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh`查看部署的 EventMesh-Operator状态以及CRD信息. ``` +$ kubectl get pods NAME READY STATUS RESTARTS AGE eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 20s + +$ kubectl get crd | grep eventmesh-operator.eventmesh +connectors.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z +runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z ``` 2.运行以下命令部署runtime、connector(删除部署, 只需将`create` 替换为 `delete`即可). From b9141516c2608f0cfbb25e80fadb65e9cc67a42a Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 16:42:07 +0800 Subject: [PATCH 12/36] update --- README.md | 14 +++++++++++++- README.zh-CN.md | 22 ++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b8eb8d198e..5aff99644c 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,12 @@ Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, clie vim conf/eventmesh.properties ``` +Specify RocketMQ as Event Store(The default is standalone.): +``` +# storage plugin +eventMesh.storage.plugin.type=rocketmq +``` + Execute the `start.sh` script to start the EventMesh Runtime server. ``` bash bin/start.sh @@ -142,6 +148,12 @@ The `eventmesh.properties` file contains the properties of EventMesh Runtime env 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 | @@ -156,7 +168,7 @@ Please check if the default port in the configuration file is occupied, if it is The `rocketmq-client.properties` file contains the properties of the Apache RocketMQ nameserver. ``` -sudo vim eventmesh.properties +sudo vim rocketmq-client.properties ``` Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties) and change the value of eventMesh.server.rocketmq.namesrvAddr to the nameserver address of RocketMQ. > 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. diff --git a/README.zh-CN.md b/README.zh-CN.md index dcf80e3093..e92389e5d8 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -65,7 +65,7 @@ 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部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。 ### 部署 EventMesh Store @@ -95,6 +95,12 @@ cd apache-eventmesh-1.10.0 vim conf/eventmesh.properties ``` +指定事件存储为 RocketMQ(默认为standalone): +``` +# storage plugin +eventMesh.storage.plugin.type=rocketmq +``` + 执行`start.sh`脚本启动EventMesh Runtime服务器。 ``` bash bin/start.sh @@ -114,8 +120,6 @@ bash bin/stop.sh ### 在 Docker 中运行 EventMesh Runtime -#### Docker部署EventMesh Runtime - #### 1.获取EventMesh镜像 首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub](https://hub.docker.com)中下载最新发布的[EventMesh](https://hub.docker.com/r/apache/eventmesh)。 @@ -148,7 +152,13 @@ sudo touch rocketmq-client.properties ``` sudo vim eventmesh.properties ``` -你可以直接将 GitHub 仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties)中的内容复制过来。 +你可以直接将 GitHub 仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties)中的内容复制过来。 + +指定事件存储为 RocketMQ(默认为standalone): +``` +# storage plugin +eventMesh.storage.plugin.type=rocketmq +``` 请检查配置文件里的默认端口是否已被占用,如果被占用请修改成未被占用的端口: @@ -163,9 +173,9 @@ sudo vim eventmesh.properties 这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 -使用下面的`vim`命令编辑`eventmesh.properties`。 +使用下面的`vim`命令编辑`rocketmq-client.properties`。 ``` -sudo vim eventmesh.properties +sudo vim rocketmq-client.properties ``` 你可以直接将GitHub仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties)中的内容复制过来 > 请注意,如果您正在运行的 namesetver 地址不是配置文件中的默认值,请将其修改为实际正在运行的nameserver地址。 From 449818eab29ce022ae84aaec17763ce3038b6037 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 16:51:52 +0800 Subject: [PATCH 13/36] update --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 5aff99644c..8a7bcc45e5 100644 --- a/README.md +++ b/README.md @@ -214,11 +214,6 @@ Run the following commands(To delete a deployment, simply replace `deploy` with ``` make deploy ``` -``` -tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz -cd apache-eventmesh-1.10.0 -``` - Run `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh`to see the status of the deployed eventmesh-operator. ``` From a4cfc05bd371829b2ae076ecc18ea1caeea15df8 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 16:54:56 +0800 Subject: [PATCH 14/36] update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a7bcc45e5..af21fa5036 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ The `eventmesh.properties` file contains the properties of EventMesh Runtime env sudo vim eventmesh.properties ``` -Specify RocketMQ as Event Store(The default is standalone.): +Specify RocketMQ as Event Store(The default is standalone): ``` # storage plugin eventMesh.storage.plugin.type=rocketmq @@ -226,7 +226,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 From b91df33a40fa1bdc6af2efe079d96552f2f2cf20 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 16:56:35 +0800 Subject: [PATCH 15/36] update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af21fa5036..9a474f35cc 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ $ java -version java version "1.8.0_311" ``` -#### 1.Download: +#### 1.Download EventMesh: Download and extract the executable binaries of the latest release from[EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0.tar.gz`. ``` @@ -85,7 +85,7 @@ tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` -#### 2.Deploy +#### 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. ``` From 55c093aecc2da5a1ca0af40c46d2d3a45c118400 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 23:30:17 +0800 Subject: [PATCH 16/36] update --- README.md | 75 ++++++++++++++++++++----------------- README.zh-CN.md | 98 +++++++++++++++++++++++++------------------------ 2 files changed, 92 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 9a474f35cc..c602c4a3c8 100644 --- a/README.md +++ b/README.md @@ -60,27 +60,22 @@ Please go to the [roadmap](https://eventmesh.apache.org/docs/roadmap) to get the ## Quick start -This section of the guide will show you the steps to deploy EventMesh from [local](#run-eventmesh-runtime-locally), [docker](#run-eventmesh-runtime-in-docker), [k8s](#run-eventmesh-runtime-in-kubernetes). +This section of the guide will show you the steps to deploy EventMesh from [Local](#run-eventmesh-runtime-locally), [Docker](#run-eventmesh-runtime-in-docker), [K8s](#run-eventmesh-runtime-in-kubernetes). This section guide is just to help you quickly get started with EventMesh deployment. Start EventMesh according to the default configuration. If you need more detailed EventMesh deployment steps, please visit the [EventMesh official document](https://eventmesh.apache.org/docs/next/introduction). -### Deployment EventMesh Store +### Deployment Event Store -> EventMesh now supports `standalone`, `RocketMQ`, `Kafka` and other middleware as a storage. +> 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/). ### Run EventMesh Runtime locally -Please check the JKD version before you start, you need to install Java 8. -``` -$ java -version -java version "1.8.0_311" -``` - #### 1.Download EventMesh: -Download and extract the executable binaries of the latest release from[EventMesh download](https://eventmesh.apache.org/download/).For example, with the current latest version, you will get `apache-eventmesh-1.10.0.tar.gz`. +Download the latest version of the Binary Distribution from the [EventMesh Download](https://eventmesh.apache.org/download/) page and extract it: ``` +wget https://dlcdn.apache.org/eventmesh/1.10.0/apache-eventmesh-1.10.0-bin.tar.gz tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` @@ -102,24 +97,26 @@ Execute the `start.sh` script to start the EventMesh Runtime server. ``` bash bin/start.sh ``` -If you see `EventMeshTCPServer[port=10000] started....`, then the setup was successful. View the output log: ``` -cd /root/apache-eventmesh-1.10.0/logs -tail -f eventmesh.out +tail -n 50 -f logs/eventmesh.out ``` +When the log output shows server `state:RUNNING`, it means EventMesh Runtime has started successfully. + You can stop the run with the following command: ``` bash bin/stop.sh ``` +When the script prints `shutdown server ok!`, it means EventMesh Runtime has stopped. + ### 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: +Download the pre-built image of [EventMesh](https://hub.docker.com/r/apache/eventmesh) from Docker Hub with docker pull: ``` sudo docker pull apache/eventmesh:latest ``` @@ -131,19 +128,27 @@ REPOSITORY TAG IMAGE ID CREATED SIZE apache/eventmesh latest f32f9e5e4694 2 days ago 917MB ``` -#### 2.Edit Configuration: +#### 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. -Edit the `eventmesh.properties` to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. To integrate RocketMQ as a connector, these two configuration files should be created: `eventmesh.properties` and `rocketmq-client.properties`. +First, create the EventMesh configuration file directory on the host machine. This directory can be freely specified: ``` -sudo mkdir -p /data/eventmesh/rocketmq/conf -cd /data/eventmesh/rocketmq/conf -sudo touch eventmesh.properties -sudo touch rocketmq-client.properties +sudo mkdir -p /data/eventmesh/conf +cd /data/eventmesh/conf ``` #### 3.Configure `eventmesh.properties` -The `eventmesh.properties` file contains the properties of EventMesh Runtime environment and integrated plugins.Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties) for the available configuration keys. +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 ``` @@ -165,12 +170,18 @@ Please check if the default port in the configuration file is occupied, if it is #### 4.Configure `rocketmq-client.properties` -The `rocketmq-client.properties` file contains the properties of the Apache RocketMQ nameserver. +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 ``` -Please refer to the [default configuration file](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties) and change the value of eventMesh.server.rocketmq.namesrvAddr to the nameserver address of RocketMQ. + > 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: @@ -182,28 +193,26 @@ Please check if the `default namesrvAddr` in the configuration file is occupied, #### 5.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/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ - -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ - apache/eventmesh:latest +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 ``` 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 -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 +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 ``` To read the log of the EventMesh container: ``` -cd ../logs -tail -f eventmesh.out +cd logs +tail -n 50 -f eventmesh.out ``` ### Run EventMesh Runtime in Kubernetes diff --git a/README.zh-CN.md b/README.zh-CN.md index e92389e5d8..ac09034df9 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -61,36 +61,31 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 - [EventMesh-catalog](https://github.com/apache/eventmesh-catalog): 使用 AsyncAPI 进行事件模式管理的目录服务。 - [EventMesh-go](https://github.com/apache/eventmesh-go): EventMesh 运行时的 Go 语言实现。 -## 快速入门 +## 快速入门 -本节指南将指导您分别从[本地](#在本地运行-eventmesh-runtime)、[docker](#在-docker-中运行-eventmesh-runtime-)、[k8s](#在-kubernetes-中运行-eventmesh-runtime-)部署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 部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。 -### 部署 EventMesh Store +### 部署 Event Store -> EventMesh现在支持`standalone`、`RocketMQ`、`Kafka`等中间件作为存储 +> 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 -请在开始之前检查JKD版本,需要下载Java 8. -``` -$ java -version -java version "1.8.0_311" -``` - #### 1.下载 -在[EventMesh download](https://eventmesh.apache.org/download/)页面选择所需要版本的Binary Distribution进行下载,您将获得`apache-eventmesh-1.10.0-bin.tar.gz`。 +从 [EventMesh Download](https://eventmesh.apache.org/download/) 页面下载最新版本的 Binary Distribution 发行版并解压: ``` +wget https://dlcdn.apache.org/eventmesh/1.10.0/apache-eventmesh-1.10.0-bin.tar.gz tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` #### 2. 运行 -编辑`eventmesh.properties`以更改EventMesh Runtime的配置(如 TCP 端口、客户端黑名单)。 +编辑`eventmesh.properties`以更改 EventMesh Runtime 的配置(如 TCP 端口、客户端黑名单)。 ``` vim conf/eventmesh.properties ``` @@ -101,30 +96,32 @@ vim conf/eventmesh.properties eventMesh.storage.plugin.type=rocketmq ``` -执行`start.sh`脚本启动EventMesh Runtime服务器。 +执行 `start.sh` 脚本启动 EventMesh Runtime 服务器。 ``` bash bin/start.sh ``` -如果看到`EventMeshTCPServer[port=10000] started....`, 则说明设置成功。 查看输出日志: ``` -cd /root/apache-eventmesh-1.10.0/logs -tail -f eventmesh.out +tail -n 50 -f logs/eventmesh.out ``` +当日志输出 `server state:RUNNING`,则代表 EventMesh Runtime 启动成功了。 + 停止: ``` bash bin/stop.sh ``` +脚本打印 `shutdown server ok!` 时,代表 EventMesh Runtime 已停止。 + ### 在 Docker 中运行 EventMesh Runtime -#### 1.获取EventMesh镜像 +#### 1.获取 EventMesh 镜像 -首先,你可以打开一个命令行,并且使用下面的`pull`命令从[Docker Hub](https://hub.docker.com)中下载最新发布的[EventMesh](https://hub.docker.com/r/apache/eventmesh)。 +首先,你可以打开一个命令行,并且使用下面的 `pull` 命令从 [Docker Hub](https://hub.docker.com) 中下载最新发布的 [EventMesh](https://hub.docker.com/r/apache/eventmesh)。 ``` -sudo docker pull apache/eventmesh:v1.10.0 +sudo docker pull apache/eventmesh:latest ``` 您可以使用以下命令列出并查看本地已有的镜像。 @@ -136,25 +133,29 @@ apache/eventmesh latest f32f9e5e4694 2 days ago 917MB #### 2.创建配置文件: -在根据EventMesh镜像运行对应容器之前,你需要创建两个配置文件,分别是:`eventmesh.properties`和`rocketmq-client.properties`。 -首先,你需要使用下面的命令创建这两个文件。 +如果您使用 standalone 模式启动 EventMesh Runtime,并且没有自定义配置,可以跳转至下一步骤。 + +首先,在宿主机上创建 EventMesh 的配置文件目录。此目录可以自由指定: ``` -sudo mkdir -p /data/eventmesh/rocketmq/conf -cd /data/eventmesh/rocketmq/conf -sudo touch eventmesh.properties -sudo touch rocketmq-client.properties +sudo mkdir -p /data/eventmesh/conf +cd /data/eventmesh/conf ``` -#### 3.配置`eventmesh.properties` +#### 3.配置 `eventmesh.properties` -这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 -使用下面的`vim`命令编辑`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 ``` -你可以直接将 GitHub 仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-runtime/conf/eventmesh.properties)中的内容复制过来。 -指定事件存储为 RocketMQ(默认为standalone): +指定事件存储为 RocketMQ (默认为 standalone): ``` # storage plugin eventMesh.storage.plugin.type=rocketmq @@ -169,16 +170,21 @@ eventMesh.storage.plugin.type=rocketmq | `eventMesh.server.grpc.port` | `10205` | `EventMesh grpc server port` | | `eventMesh.server.admin.http.port` | `10106` | `HTTP management port` | -#### 4.配置`rocketmq-client.properties` +#### 4.配置 `rocketmq-client.properties` 这个配置文件中包含 EventMesh 运行时环境和集成进来的其他插件所需的参数。 -使用下面的`vim`命令编辑`rocketmq-client.properties`。 +下载配置文件(替换下载链接中的 `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 ``` -你可以直接将GitHub仓库中的对应[配置文件](https://github.com/apache/eventmesh/blob/1.10.0-prepare/eventmesh-storage-plugin/eventmesh-storage-rocketmq/src/main/resources/rocketmq-client.properties)中的内容复制过来 -> 请注意,如果您正在运行的 namesetver 地址不是配置文件中的默认值,请将其修改为实际正在运行的nameserver地址。 + +> 请注意,如果您正在运行的 namesrv 地址不是配置文件中的默认值,请将其修改为实际正在运行的 namesrv 地址。 请检查配置文件里的默认namesrvAddr是否已被占用,如果被占用请修改成未被占用的地址: @@ -190,17 +196,13 @@ sudo vim rocketmq-client.properties 现在你就可以开始根据下载好的EventMesh镜像运行容器了。 -使用到的命令是`docker run`,有以下两点内容需要格外注意。 -- 绑定容器端口和宿主机端口: 使用`docker run`的`-p`选项。 -- 将宿主机中的两份配置文件挂在到容器中: 使用`docker run`的`-v`选项。 +使用到的命令是 `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/rocketmq/conf/eventMesh.properties:/data/app/eventmesh/conf/eventMesh.properties \ - -v /data/eventmesh/rocketmq/conf/rocketmq-client.properties:/data/app/eventmesh/conf/rocketmq-client.properties \ - apache/eventmesh:latest +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 ``` 接下来,你可以使用下面的命令查看容器的状态。 @@ -217,20 +219,20 @@ CONTAINER ID IMAGE COMMAND CREATED 读取 EventMesh 容器的日志: ``` -cd ../logs -tail -f eventmesh.out +cd logs +tail -n 50 -f eventmesh.out ``` ### 在 Kubernetes 中运行 EventMesh Runtime 1.部署 Operator -运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy`即可): +运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy` 即可): ``` make deploy ``` -运行 `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh`查看部署的 EventMesh-Operator状态以及CRD信息. +运行 `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh` 查看部署的 EventMesh-Operator 状态以及 CRD 信息. ``` $ kubectl get pods NAME READY STATUS RESTARTS AGE @@ -241,7 +243,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 ``` From b5dee019ebdfc5cdbb7fddd3e8d30ef55e76853c Mon Sep 17 00:00:00 2001 From: Alonexc Date: Wed, 10 Jan 2024 23:41:10 +0800 Subject: [PATCH 17/36] update --- README.zh-CN.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index ac09034df9..72e93f2bfc 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -63,11 +63,11 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ## 快速入门 -本节指南将指导您分别从[本地](#在本地运行-eventmesh-runtime)、[Docker](#在-docker-中运行-eventmesh-runtime-)、[K8s](#在-kubernetes-中运行-eventmesh-runtime-)部署EventMesh的步骤: +本节指南将指导您分别从[本地](#在本地运行-eventmesh-runtime)、[Docker](#在-docker-中运行-eventmesh-runtime)、[K8s](#在-kubernetes-中运行-eventmesh-runtime)部署EventMesh的步骤: 本节指南只是帮助您快速入门 EventMesh 部署,按照默认配置启动 EventMesh,如果您需要更加详细的 EventMesh 部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。 -### 部署 Event Store +### 部署 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/) @@ -83,7 +83,7 @@ tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` -#### 2. 运行 +#### 2. 运行 编辑`eventmesh.properties`以更改 EventMesh Runtime 的配置(如 TCP 端口、客户端黑名单)。 ``` @@ -115,7 +115,7 @@ bash bin/stop.sh 脚本打印 `shutdown server ok!` 时,代表 EventMesh Runtime 已停止。 -### 在 Docker 中运行 EventMesh Runtime +### 在 Docker 中运行 EventMesh Runtime #### 1.获取 EventMesh 镜像 @@ -131,7 +131,7 @@ REPOSITORY TAG IMAGE ID CREATED SIZE apache/eventmesh latest f32f9e5e4694 2 days ago 917MB ``` -#### 2.创建配置文件: +#### 2.创建配置文件 如果您使用 standalone 模式启动 EventMesh Runtime,并且没有自定义配置,可以跳转至下一步骤。 @@ -223,7 +223,7 @@ cd logs tail -n 50 -f eventmesh.out ``` -### 在 Kubernetes 中运行 EventMesh Runtime +### 在 Kubernetes 中运行 EventMesh Runtime 1.部署 Operator From 6880516b66d490bf4a8cf4189e9c918a9232f7d4 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 10:30:24 +0800 Subject: [PATCH 18/36] update --- README.md | 97 ++++++------------------------------------- README.zh-CN.md | 107 ++++++------------------------------------------ 2 files changed, 24 insertions(+), 180 deletions(-) diff --git a/README.md b/README.md index c602c4a3c8..661a43dedb 100644 --- a/README.md +++ b/README.md @@ -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: ``` @@ -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. ``` @@ -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: ``` @@ -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: @@ -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`): ``` @@ -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 diff --git a/README.zh-CN.md b/README.zh-CN.md index 72e93f2bfc..a885810213 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -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 发行版并解压: ``` @@ -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 @@ -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 容器的日志: @@ -225,7 +142,7 @@ tail -n 50 -f eventmesh.out ### 在 Kubernetes 中运行 EventMesh Runtime -1.部署 Operator +#### 1. 部署 Operator 运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy` 即可): ``` @@ -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 ``` From 41462e9e0400a097bebf082638948b0056904420 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 14:29:36 +0800 Subject: [PATCH 19/36] update --- README.md | 52 +++++++++++++++++++++++++++++++++---------------- README.zh-CN.md | 50 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 69 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 661a43dedb..5679a572d9 100644 --- a/README.md +++ b/README.md @@ -68,14 +68,15 @@ This section guide is just to help you quickly get started with EventMesh deploy > 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 a non ' standalone ' mode, you need to deploy the required Event Store first. using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/). ### Run EventMesh Runtime locally #### 1. Download EventMesh: Download the latest version of the Binary Distribution from the [EventMesh Download](https://eventmesh.apache.org/download/) page and extract it: -``` + +```shell wget https://dlcdn.apache.org/eventmesh/1.10.0/apache-eventmesh-1.10.0-bin.tar.gz tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 @@ -84,19 +85,22 @@ cd apache-eventmesh-1.10.0 #### 2. Run EventMesh: Execute the `start.sh` script to start the EventMesh Runtime server. -``` + +```shell bash bin/start.sh ``` View the output log: -``` + +```shell tail -n 50 -f logs/eventmesh.out ``` When the log output shows server `state:RUNNING`, it means EventMesh Runtime has started successfully. You can stop the run with the following command: -``` + +```shell bash bin/stop.sh ``` @@ -106,13 +110,15 @@ When the script prints `shutdown server ok!`, it means EventMesh Runtime has sto #### 1. Pull EventMesh Image -Download the pre-built image of [EventMesh](https://hub.docker.com/r/apache/eventmesh) from Docker Hub with docker pull: -``` +Use the following command line to download the latest version of [EventMesh](https://hub.docker.com/r/apache/eventmesh). + +```shell sudo docker pull apache/eventmesh:latest ``` To verify that the apache/eventmesh image is successfully installed, list the downloaded images with docker images: -``` + +```shell $ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE apache/eventmesh latest f32f9e5e4694 2 days ago 917MB @@ -125,19 +131,28 @@ Run an EventMesh container from the `apache/eventmesh` image with the `docker ru - The `-p` option of the command binds the container port with the host machine port. Use the following command to start the EventMesh container: -``` + +```shell 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. -``` + +```shell $ sudo docker ps 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: +Enter the container (replace `eventmesh` with the container name or ID you specified): + +```shell +sudo docker exec -it eventmesh /bin/bash ``` + +To read the log of the EventMesh container: + +```shell cd logs tail -n 50 -f eventmesh.out ``` @@ -147,12 +162,14 @@ tail -n 50 -f eventmesh.out #### 1. Deploy operator Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`): -``` -make deploy + +```shell +$ make deploy ``` Run `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh`to see the status of the deployed eventmesh-operator. -``` + +```shell $ kubectl get pods NAME READY STATUS RESTARTS AGE eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 20s @@ -164,12 +181,13 @@ 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`). -``` -make create +```shell +$ make create ``` Run `kubectl get pods` to see if the deployment was successful. -``` + +```shell NAME READY STATUS RESTARTS AGE connector-rocketmq-0 1/1 Running 0 9s eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 3m12s diff --git a/README.zh-CN.md b/README.zh-CN.md index a885810213..eca4207448 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -71,14 +71,15 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 > EventMesh 现在支持多个[事件存储](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status),默认存储模式为 `standalone` > -> 如果是在非`standalone`模式下,需要先部署所需的`store`,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) +> 如果是在非`standalone`模式下,需要先部署所需的事件存储,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) ### 在本地运行 EventMesh Runtime #### 1. 下载 从 [EventMesh Download](https://eventmesh.apache.org/download/) 页面下载最新版本的 Binary Distribution 发行版并解压: -``` + +```shell wget https://dlcdn.apache.org/eventmesh/1.10.0/apache-eventmesh-1.10.0-bin.tar.gz tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 @@ -87,19 +88,22 @@ cd apache-eventmesh-1.10.0 #### 2. 运行 执行 `start.sh` 脚本启动 EventMesh Runtime 服务器。 -``` + +```shell bash bin/start.sh ``` 查看输出日志: -``` + +```shell tail -n 50 -f logs/eventmesh.out ``` 当日志输出 `server state:RUNNING`,则代表 EventMesh Runtime 启动成功了。 停止: -``` + +```shell bash bin/stop.sh ``` @@ -109,8 +113,9 @@ bash bin/stop.sh #### 1. 获取 EventMesh 镜像 -首先,你可以打开一个命令行,并且使用下面的 `pull` 命令从 [Docker Hub](https://hub.docker.com) 中下载最新发布的 [EventMesh](https://hub.docker.com/r/apache/eventmesh)。 -``` +使用下面的命令行下载最新版本的 [EventMesh](https://hub.docker.com/r/apache/eventmesh)。 + +```shell sudo docker pull apache/eventmesh:latest ``` @@ -123,19 +128,28 @@ sudo docker pull apache/eventmesh:latest - 绑定容器端口和宿主机端口: 使用 `docker run` 的 `-p` 选项。 综合一下,对应的启动命令为: -``` + +```shell sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -t apache/eventmesh:latest ``` 如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。 -``` + +```shell $ sudo docker ps 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 容器的日志: +进入容器(将eventmesh替换为您指定的容器名称或 ID): + +```shell +sudo docker exec -it eventmesh /bin/bash ``` + +读取 EventMesh 容器的日志: + +```shell cd logs tail -n 50 -f eventmesh.out ``` @@ -145,12 +159,14 @@ tail -n 50 -f eventmesh.out #### 1. 部署 Operator 运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy` 即可): -``` -make deploy + +```shell +$ make deploy ``` 运行 `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh` 查看部署的 EventMesh-Operator 状态以及 CRD 信息. -``` + +```shell $ kubectl get pods NAME READY STATUS RESTARTS AGE eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 20s @@ -161,12 +177,14 @@ runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z ``` #### 2. 运行以下命令部署 runtime、connector (删除部署, 只需将 `create` 替换为 `delete` 即可). -``` -make create + +```shell +$ make create ``` 运行 `kubectl get pods` 查看部署是否成功. -``` + +```shell NAME READY STATUS RESTARTS AGE connector-rocketmq-0 1/1 Running 0 9s eventmesh-operator-59c59f4f7b-nmmlm 1/1 Running 0 3m12s From d87cecf0e7eec3d2b6c8dfbde4d3ecad21549de2 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 14:41:05 +0800 Subject: [PATCH 20/36] update --- README.md | 4 ++-- README.zh-CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5679a572d9..82f586f952 100644 --- a/README.md +++ b/README.md @@ -140,8 +140,8 @@ The `docker ps` command lists the details (id, name, status, etc.) of the runnin ```shell $ sudo docker ps -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 +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 ``` Enter the container (replace `eventmesh` with the container name or ID you specified): diff --git a/README.zh-CN.md b/README.zh-CN.md index eca4207448..6bae9f894c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -137,8 +137,8 @@ sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 ```shell $ sudo docker ps -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 +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替换为您指定的容器名称或 ID): From 59c3e01bc6bc3b0aa81d1532ee020b59274dc760 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 14:46:11 +0800 Subject: [PATCH 21/36] update --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index 82f586f952..157163deb6 100644 --- a/README.md +++ b/README.md @@ -116,14 +116,6 @@ Use the following command line to download the latest version of [EventMesh](htt sudo docker pull apache/eventmesh:latest ``` -To verify that the apache/eventmesh image is successfully installed, list the downloaded images with docker images: - -```shell -$ sudo docker images -REPOSITORY TAG IMAGE ID CREATED SIZE -apache/eventmesh latest f32f9e5e4694 2 days ago 917MB -``` - #### 2. Run and Manage EventMesh Container Run an EventMesh container from the `apache/eventmesh` image with the `docker run` command. From 38ea174ba7a7d73faa10de11fc26ff46acc2981a Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 14:54:16 +0800 Subject: [PATCH 22/36] update --- README.md | 4 +++- README.zh-CN.md | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 157163deb6..9d345f6088 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,9 @@ 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. Deploy EventMesh Runtime + +Execute the following command to deploy runtime, connector-rocketmq (To delete, simply replace `create` with `delete`). ```shell $ make create diff --git a/README.zh-CN.md b/README.zh-CN.md index 6bae9f894c..596fab30eb 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -141,7 +141,7 @@ CONTAINER ID IMAGE COMMAND CREATED 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替换为您指定的容器名称或 ID): +进入容器(将 `eventmesh` 替换为您指定的容器名称或 ID): ```shell sudo docker exec -it eventmesh /bin/bash @@ -176,7 +176,9 @@ connectors.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z ``` -#### 2. 运行以下命令部署 runtime、connector (删除部署, 只需将 `create` 替换为 `delete` 即可). +#### 2. 部署 EventMesh Runtime + +运行以下命令部署 runtime、connector-rocketmq (删除部署, 只需将 `create` 替换为 `delete` 即可). ```shell $ make create From 47f64da4a02718017de52aa0a62c1c8daec5041c Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 14:57:32 +0800 Subject: [PATCH 23/36] update --- README.zh-CN.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 596fab30eb..14a093b632 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -75,7 +75,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ### 在本地运行 EventMesh Runtime -#### 1. 下载 +#### 1. 下载 EventMesh 从 [EventMesh Download](https://eventmesh.apache.org/download/) 页面下载最新版本的 Binary Distribution 发行版并解压: @@ -85,7 +85,7 @@ tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` -#### 2. 运行 +#### 2. 运行 EventMesh 执行 `start.sh` 脚本启动 EventMesh Runtime 服务器。 @@ -119,7 +119,7 @@ bash bin/stop.sh sudo docker pull apache/eventmesh:latest ``` -#### 2. 运行EventMesh +#### 2. 运行 EventMesh 现在你就可以开始根据下载好的EventMesh镜像运行容器了。 From a2eb7c37faa2f20c8f1a27539d832d591703256c Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 15:13:27 +0800 Subject: [PATCH 24/36] update --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9d345f6088..d8d5bbc71f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ ![EventMesh Architecture](resources/eventmesh-architecture-4.png) ### EventMesh Dashboard + ![EventMesh Dashboard](resources/dashboard.png) ## Features @@ -49,9 +50,11 @@ Apache EventMesh has a vast amount of features to help users achieve their goals - Easy Function develop and framework integration. ## Roadmap + Please go to the [roadmap](https://eventmesh.apache.org/docs/roadmap) to get the release history and new features of Apache EventMesh. ## Subprojects + - [EventMesh-site](https://github.com/apache/eventmesh-site): Apache official website resources for EventMesh. - [EventMesh-workflow](https://github.com/apache/eventmesh-workflow): Serverless workflow runtime for event Orchestration on EventMesh. - [EventMesh-dashboard](https://github.com/apache/eventmesh-dashboard): Operation and maintenance console of EventMesh. From da8e60d9382e0decfea97049a666ee7d19671c17 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 15:20:34 +0800 Subject: [PATCH 25/36] update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d8d5bbc71f..03cc99e5f2 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ Please go to the [roadmap](https://eventmesh.apache.org/docs/roadmap) to get the This section of the guide will show you the steps to deploy EventMesh from [Local](#run-eventmesh-runtime-locally), [Docker](#run-eventmesh-runtime-in-docker), [K8s](#run-eventmesh-runtime-in-kubernetes). -This section guide is just to help you quickly get started with EventMesh deployment. Start EventMesh according to the default configuration. If you need more detailed EventMesh deployment steps, please visit the [EventMesh official document](https://eventmesh.apache.org/docs/next/introduction). +This section guide is just to help you quickly get started with EventMesh deployment, start EventMesh according to the default configuration, if you need more detailed EventMesh deployment steps, please visit the [EventMesh official document](https://eventmesh.apache.org/docs/next/introduction). ### 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 a non ' standalone ' mode, you need to deploy the required Event Store first. using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/). +> If you are in a non ' standalone ' mode, you need to deploy the required Event Store first, using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/). ### Run EventMesh Runtime locally From cf9113fa755ffb7c8d52d1f3f385609b52e1a56d Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 15:34:38 +0800 Subject: [PATCH 26/36] update --- README.md | 8 ++++---- README.zh-CN.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 03cc99e5f2..3fba31b387 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ This section guide is just to help you quickly get started with EventMesh deploy ### 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: @@ -85,7 +85,7 @@ tar -xvzf apache-eventmesh-1.10.0-bin.tar.gz cd apache-eventmesh-1.10.0 ``` -#### 2. Run EventMesh: +#### 2. Run EventMesh Execute the `start.sh` script to start the EventMesh Runtime server. @@ -113,7 +113,7 @@ When the script prints `shutdown server ok!`, it means EventMesh Runtime has sto #### 1. Pull EventMesh Image -Use the following command line to download the latest version of [EventMesh](https://hub.docker.com/r/apache/eventmesh). +Use the following command line to download the latest version of [EventMesh](https://hub.docker.com/r/apache/eventmesh): ```shell sudo docker pull apache/eventmesh:latest @@ -176,7 +176,7 @@ runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z #### 2. Deploy EventMesh Runtime -Execute the following command to deploy runtime, connector-rocketmq (To delete, simply replace `create` with `delete`). +Execute the following command to deploy runtime, connector-rocketmq (To delete, simply replace `create` with `delete`): ```shell $ make create diff --git a/README.zh-CN.md b/README.zh-CN.md index 14a093b632..daa11c2541 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -113,7 +113,7 @@ bash bin/stop.sh #### 1. 获取 EventMesh 镜像 -使用下面的命令行下载最新版本的 [EventMesh](https://hub.docker.com/r/apache/eventmesh)。 +使用下面的命令行下载最新版本的 [EventMesh](https://hub.docker.com/r/apache/eventmesh): ```shell sudo docker pull apache/eventmesh:latest @@ -127,7 +127,7 @@ sudo docker pull apache/eventmesh:latest - 绑定容器端口和宿主机端口: 使用 `docker run` 的 `-p` 选项。 -综合一下,对应的启动命令为: +启动命令为: ```shell sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -t apache/eventmesh:latest @@ -178,7 +178,7 @@ runtimes.eventmesh-operator.eventmesh 2024-01-10T02:40:27Z #### 2. 部署 EventMesh Runtime -运行以下命令部署 runtime、connector-rocketmq (删除部署, 只需将 `create` 替换为 `delete` 即可). +运行以下命令部署 runtime、connector-rocketmq (删除部署, 只需将 `create` 替换为 `delete` 即可): ```shell $ make create From 2b2057076cd70173e48c1edcd3fa68510bda8a59 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 17:24:41 +0800 Subject: [PATCH 27/36] update --- README.md | 8 ++++---- README.zh-CN.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3fba31b387..c2abcf7024 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ 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`. +> EventMesh supports [multiple Event Stores](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status), the default storage mode is ' standalone ', and does not rely on other event stores as layers. > > If you are in a non ' standalone ' mode, you need to deploy the required Event Store first, using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/). @@ -135,8 +135,8 @@ The `docker ps` command lists the details (id, name, status, etc.) of the runnin ```shell $ sudo docker ps -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 +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 ``` Enter the container (replace `eventmesh` with the container name or ID you specified): @@ -145,7 +145,7 @@ Enter the container (replace `eventmesh` with the container name or ID you speci sudo docker exec -it eventmesh /bin/bash ``` -To read the log of the EventMesh container: +To view the log of the EventMesh container: ```shell cd logs diff --git a/README.zh-CN.md b/README.zh-CN.md index daa11c2541..ffbd76404a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -69,7 +69,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ### 部署 Event Store -> EventMesh 现在支持多个[事件存储](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status),默认存储模式为 `standalone` +> EventMesh 支持[多种事件存储](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status),默认存储模式为 `standalone`,不依赖其他事件存储作为层。 > > 如果是在非`standalone`模式下,需要先部署所需的事件存储,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) @@ -137,8 +137,8 @@ sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 ```shell $ sudo docker ps -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 +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` 替换为您指定的容器名称或 ID): @@ -147,7 +147,7 @@ CONTAINER ID IMAGE COMMAND CREATED sudo docker exec -it eventmesh /bin/bash ``` -读取 EventMesh 容器的日志: +查看 EventMesh 容器的日志: ```shell cd logs From e9bda7a6a52958ef1a4f5a01d793a206814e781b Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 17:33:03 +0800 Subject: [PATCH 28/36] update --- README.md | 2 +- README.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2abcf7024..7066c3d12c 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ tail -n 50 -f eventmesh.out Run the following commands(To delete a deployment, simply replace `deploy` with `undeploy`): ```shell -$ make deploy +$ cd eventmesh-operator && make deploy ``` Run `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh`to see the status of the deployed eventmesh-operator. diff --git a/README.zh-CN.md b/README.zh-CN.md index ffbd76404a..fb3fc6b4a0 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -161,7 +161,7 @@ tail -n 50 -f eventmesh.out 运行以下命令部署(删除部署, 只需将 `deploy` 替换为 `undeploy` 即可): ```shell -$ make deploy +$ cd eventmesh-operator && make deploy ``` 运行 `kubectl get pods` 、`kubectl get crd | grep eventmesh-operator.eventmesh` 查看部署的 EventMesh-Operator 状态以及 CRD 信息. From 93e4661ae12a970c3f911d97ab4e2dc5dffa8d51 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Thu, 11 Jan 2024 21:14:36 +0800 Subject: [PATCH 29/36] update --- README.md | 2 -- README.zh-CN.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/README.md b/README.md index 7066c3d12c..5a46fdebaa 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,6 @@ This section guide is just to help you quickly get started with EventMesh deploy ### Deployment Event Store > EventMesh supports [multiple Event Stores](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status), the default storage mode is ' standalone ', and does not rely on other event stores as layers. -> -> If you are in a non ' standalone ' mode, you need to deploy the required Event Store first, using `rocketmq` mode as an example: Deploy [RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/). ### Run EventMesh Runtime locally diff --git a/README.zh-CN.md b/README.zh-CN.md index fb3fc6b4a0..ed7c7a58bf 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -70,8 +70,6 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 ### 部署 Event Store > EventMesh 支持[多种事件存储](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status),默认存储模式为 `standalone`,不依赖其他事件存储作为层。 -> -> 如果是在非`standalone`模式下,需要先部署所需的事件存储,以`rocketmq`模式为例: 部署[RocketMQ](https://rocketmq.apache.org/docs/quickStart/01quickstart/) ### 在本地运行 EventMesh Runtime From 7ff378acde1b9d7ea46e63f6cb01acf1c538b92e Mon Sep 17 00:00:00 2001 From: Alonexc Date: Fri, 12 Jan 2024 17:29:24 +0800 Subject: [PATCH 30/36] update --- README.zh-CN.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index ed7c7a58bf..09b59e82a7 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -119,8 +119,6 @@ sudo docker pull apache/eventmesh:latest #### 2. 运行 EventMesh -现在你就可以开始根据下载好的EventMesh镜像运行容器了。 - 使用到的命令是 `docker run`。 - 绑定容器端口和宿主机端口: 使用 `docker run` 的 `-p` 选项。 From 841592f61299d8d4bafa47e17a64df2d7ea8619d Mon Sep 17 00:00:00 2001 From: Alonexc Date: Fri, 12 Jan 2024 17:33:29 +0800 Subject: [PATCH 31/36] update --- README.md | 11 ----------- README.zh-CN.md | 14 +------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/README.md b/README.md index 5a46fdebaa..6c42d0fadd 100644 --- a/README.md +++ b/README.md @@ -119,23 +119,12 @@ sudo docker pull apache/eventmesh:latest #### 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. - Use the following command to start the EventMesh container: ```shell 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. - -```shell -$ sudo docker ps -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 -``` Enter the container (replace `eventmesh` with the container name or ID you specified): diff --git a/README.zh-CN.md b/README.zh-CN.md index 09b59e82a7..84a68f572b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -119,24 +119,12 @@ sudo docker pull apache/eventmesh:latest #### 2. 运行 EventMesh -使用到的命令是 `docker run`。 - -- 绑定容器端口和宿主机端口: 使用 `docker run` 的 `-p` 选项。 - -启动命令为: +使用一下命令启动 EventMesh 容器: ```shell sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -t apache/eventmesh:latest ``` -如果成功的话,你会看到终端打印出了如下所示容器的信息,其中就有运行 EventMesh 镜像的容器。 - -```shell -$ sudo docker ps -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` 替换为您指定的容器名称或 ID): ```shell From 01ec8283a588ce5366b5b5eb1bca5b8d1b75e788 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Fri, 12 Jan 2024 17:36:25 +0800 Subject: [PATCH 32/36] update --- README.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 84a68f572b..2b047a2c67 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -119,7 +119,7 @@ sudo docker pull apache/eventmesh:latest #### 2. 运行 EventMesh -使用一下命令启动 EventMesh 容器: +使用以下命令启动 EventMesh 容器: ```shell sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -t apache/eventmesh:latest From 9da571663a0ee06548a5291c7b2bfe2f6e9c9c82 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Fri, 12 Jan 2024 21:50:41 +0800 Subject: [PATCH 33/36] update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c42d0fadd..993ecfe59f 100644 --- a/README.md +++ b/README.md @@ -126,13 +126,13 @@ sudo docker run -d --name eventmesh -p 10000:10000 -p 10105:10105 -p 10205:10205 ``` -Enter the container (replace `eventmesh` with the container name or ID you specified): +Enter the container: ```shell sudo docker exec -it eventmesh /bin/bash ``` -To view the log of the EventMesh container: +view the log: ```shell cd logs From f56674adf86a9ae96c16c5bbb37144ebdaf59ec3 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Fri, 12 Jan 2024 21:50:53 +0800 Subject: [PATCH 34/36] update --- README.zh-CN.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.zh-CN.md b/README.zh-CN.md index 2b047a2c67..9d04228146 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -125,13 +125,13 @@ sudo docker pull 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 ``` -进入容器(将 `eventmesh` 替换为您指定的容器名称或 ID): +进入容器: ```shell sudo docker exec -it eventmesh /bin/bash ``` -查看 EventMesh 容器的日志: +查看日志: ```shell cd logs From de2e66c934a351dc81b48f9a7434a58dee0d275d Mon Sep 17 00:00:00 2001 From: Alonexc Date: Sat, 13 Jan 2024 13:57:55 +0800 Subject: [PATCH 35/36] update --- README.md | 2 +- README.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 993ecfe59f..27f51f406e 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Please go to the [roadmap](https://eventmesh.apache.org/docs/roadmap) to get the This section of the guide will show you the steps to deploy EventMesh from [Local](#run-eventmesh-runtime-locally), [Docker](#run-eventmesh-runtime-in-docker), [K8s](#run-eventmesh-runtime-in-kubernetes). -This section guide is just to help you quickly get started with EventMesh deployment, start EventMesh according to the default configuration, if you need more detailed EventMesh deployment steps, please visit the [EventMesh official document](https://eventmesh.apache.org/docs/next/introduction). +This section guides the launch of EventMesh according to the default configuration, if you need more detailed EventMesh deployment steps, please visit the [EventMesh official document](https://eventmesh.apache.org/docs/introduction). ### Deployment Event Store diff --git a/README.zh-CN.md b/README.zh-CN.md index 9d04228146..a134536b1a 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -65,7 +65,7 @@ Apache EventMesh提供了许多功能来帮助用户实现他们的目标,以 本节指南将指导您分别从[本地](#在本地运行-eventmesh-runtime)、[Docker](#在-docker-中运行-eventmesh-runtime)、[K8s](#在-kubernetes-中运行-eventmesh-runtime)部署EventMesh的步骤: -本节指南按照默认配置启动 EventMesh,如果您需要更加详细的 EventMesh 部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/next/introduction)。 +本节指南按照默认配置启动 EventMesh,如果您需要更加详细的 EventMesh 部署步骤,请访问[EventMesh官方文档](https://eventmesh.apache.org/docs/introduction)。 ### 部署 Event Store From 107c512089f0390f926bb1b7483b047f5c845150 Mon Sep 17 00:00:00 2001 From: Alonexc Date: Sat, 13 Jan 2024 14:02:05 +0800 Subject: [PATCH 36/36] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27f51f406e..6e6f695f64 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ This section guides the launch of EventMesh according to the default configurati ### Deployment Event Store -> EventMesh supports [multiple Event Stores](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status), the default storage mode is ' standalone ', and does not rely on other event stores as layers. +> EventMesh supports [multiple Event Stores](https://eventmesh.apache.org/docs/roadmap#event-store-implementation-status), the default storage mode is `standalone`, and does not rely on other event stores as layers. ### Run EventMesh Runtime locally