diff --git a/docs/en/start/configuration/start.md b/docs/en/start/configuration/start.md index 1b187b7be8..94635d56c8 100644 --- a/docs/en/start/configuration/start.md +++ b/docs/en/start/configuration/start.md @@ -7,8 +7,22 @@ The architecture of this demo is shown in the figure below. The processes starte ![](https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*dzGaSb78UCoAAAAAAAAAAAAAARQnAQ) [Then config file](https://github.com/mosn/layotto/blob/main/configs/runtime_config.json) claims `etcd` in the `config_store` section, but users can change it to other configuration center they want (currently only support etcd and apollo). +### step 1. Deploy etcd and Layotto + +#### **with Docker Compose** +You can start etcd and Layotto with docker-compose -## Start etcd +```bash +cd docker/layotto-etcd +# Start etcd and layotto with docker-compose +docker-compose up -d +``` +#### **Compile locally (not for Windows)** +You can run etcd with Docker, then compile and run Layotto locally. + +> [!TIP|label: Not for Windows users] +> Layotto fails to compile under Windows. Windows users are recommended to deploy using docker-compose +#### step 1.1 Start etcd If you want to run this demo, you need to start a etcd server first. You can download etcd from `https://github.com/etcd-io/etcd/releases` (You can also use docker.) @@ -20,7 +34,7 @@ start it: Then you can access etcd with the address `localhost:2379`. -## Start Layotto +#### step 1.2 Start Layotto Build Layotto: ```shell @@ -35,8 +49,9 @@ Run it: ```shell @background ./layotto start -c ../../configs/runtime_config.json ``` + -## Start client APP +### step 2. Start client APP ```shell cd ${project_path}/demo/configuration/common diff --git a/docs/en/start/sequencer/start.md b/docs/en/start/sequencer/start.md index a6d2e6642b..43f3d77c97 100644 --- a/docs/en/start/sequencer/start.md +++ b/docs/en/start/sequencer/start.md @@ -11,8 +11,22 @@ This example shows how to call Etcd through Layotto to generate a distributed un The architecture of this example is shown in the figure below, and the processes started are: Etcd, Layotto, and client programs ![img.png](../../../img/sequencer/etcd/img.png) +### step 1. Deploy etcd and Layotto + +#### **with Docker Compose** +You can start etcd and Layotto with docker-compose -### Step 1: Deploy the storage system (Etcd) +```bash +cd docker/layotto-etcd +# Start etcd and layotto with docker-compose +docker-compose up -d +``` +#### **Compile locally (not for Windows)** +You can run etcd with Docker, then compile and run Layotto locally. + +> [!TIP|label: Not for Windows users] +> Layotto fails to compile under Windows. Windows users are recommended to deploy using docker-compose +#### step 1.1 Deploy the storage system (Etcd) For the deployment of etcd, please refer to etcd's [Official Document](https://etcd.io/docs/v3.5/quickstart/) @@ -27,7 +41,7 @@ Once the download is finished,execute the command to start: ``` The default listening address is `localhost:2379` -### Step 2: Run Layotto +#### step 1.2 Run Layotto After downloading the project code to the local, switch the code directory and compile: @@ -44,8 +58,9 @@ Once finished, the layotto file will be generated in the directory, run it: ```shell @background ./layotto start -c ../../configs/runtime_config.json ``` + -### Step 3: Run the client program and call Layotto to generate a unique id +### step 2. Run the client program and call Layotto to generate a unique id ```shell cd ${project_path}/demo/sequencer/common/ diff --git a/docs/zh/start/sequencer/start.md b/docs/zh/start/sequencer/start.md index 76c16f58ae..2f3ac0ecac 100644 --- a/docs/zh/start/sequencer/start.md +++ b/docs/zh/start/sequencer/start.md @@ -12,7 +12,22 @@ Sequencer API支持声明对自增的需求,包括趋势递增(WEAK)和严格 ![img.png](../../../img/sequencer/etcd/img.png) -### 第一步:部署存储系统(Etcd) +### step 1. 启动 etcd 和 Layotto + +#### **使用 Docker Compose** +您可以使用 docker-compose 启动 etcd 和 Layotto + +```bash +cd docker/layotto-etcd +# Start etcd and layotto with docker-compose +docker-compose up -d +``` + +#### **本地编译(不适合 Windows)** +您可以使用 Docker 运行 etcd,然后本地编译、运行 Layotto。 +> [!TIP|label: 不适合 Windows 用户] +> Layotto 在 Windows 下会编译失败。建议 Windows 用户使用 docker-compose 部署 +### step 1.1:部署存储系统(Etcd) etcd的启动方式可以参考etcd的[官方文档](https://etcd.io/docs/v3.5/quickstart/) @@ -28,7 +43,7 @@ etcd的启动方式可以参考etcd的[官方文档](https://etcd.io/docs/v3.5/q 默认监听地址为 `localhost:2379` -### 第二步:运行Layotto +### step 1.2:运行Layotto 将项目代码下载到本地后,切换代码目录: @@ -47,8 +62,9 @@ go build -o layotto ```shell @background ./layotto start -c ../../configs/runtime_config.json ``` + -### 第三步:运行客户端程序,调用Layotto生成唯一id +### step 2. 运行客户端程序,调用Layotto生成唯一id ```shell cd ${project_path}/demo/sequencer/common/