From 52e5ced1f8157f447aa7655297e29849ab2bce31 Mon Sep 17 00:00:00 2001 From: pengweisong <90180021+pengweisong@users.noreply.github.com> Date: Tue, 15 Feb 2022 15:31:49 +0800 Subject: [PATCH 1/5] add more readme --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ee97599..cbdbbb4 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,77 @@ # Overview Nebula Agent is an daemon service in each machine of [nebula](https://github.com/vesoft-inc/nebula) cluster. It helps to keep track of nebula metad/storaged/graphd, start/stop them, call local rpc of them. +It is only used for [backup and restore](https://github.com/vesoft-inc/nebula-br) tools for now. # Features +Nebula Agent provide two type of services now: file management in nebula machines and agent service. + ## File Management -```proto -// UploadFile upload file from agent machine to external storage -rpc UploadFile(UploadFileRequest) returns (UploadFileResponse); -// DownloadFile download file from external storage to agent machine -rpc DownloadFile(DownloadFileRequest) returns (DownloadFileResponse); -// MoveDir rename dir in agent machine -rpc MoveDir(MoveDirRequest) returns (MoveDirResponse); -// RemoveDir delete dir in agent machine -rpc RemoveDir(RemoveDirRequest) returns (RemoveDirResponse); +```C++ + // UploadFile upload file from agent machine to external storage + rpc UploadFile(UploadFileRequest) returns (UploadFileResponse); + // DownloadFile download file from external storage to agent machine + rpc DownloadFile(DownloadFileRequest) returns (DownloadFileResponse); + + // MoveDir rename dir in agent machine + rpc MoveDir(MoveDirRequest) returns (MoveDirResponse); + // RemoveDir delete dir in agent machine + rpc RemoveDir(RemoveDirRequest) returns (RemoveDirResponse); + // ExistDir check if dir in agent machine exist + rpc ExistDir(ExistDirRequest) returns (ExistDirResponse); ``` ## Agent Service -```proto -// start/stop metad/storaged/graphd service +```C++ +// start/stop/get status of metad/storaged/graphd service rpc StartService(StartServiceRequest) returns (StartServiceResponse); rpc StopService(StopServiceRequest) returns (StopServiceResponse); +rpc ServiceStatus(ServiceStatusRequest) returns (ServiceStatusResponse); // ban read/write by call graphd's api rpc BanReadWrite(BanReadWriteRequest) returns (BanReadWriteResponse); rpc AllowReadWrite(AllowReadWriteRequest) returns (AllowReadWriteResponse); ``` -# Usage +# Quick Start -Agent will be started in each machine automatically, with it's listen address and metad's address given. +## Download directly +If you are in linux amd64 environment, you could download it directly. + +```bash +cd /your/path +wget https://github.com/vesoft-inc/nebula-agent/releases/download/v0.1.1/agent-v0.1.1 +mv agent-v0.1.1 agent +chmod +x agent ``` -Usage of bin/agent: + +## Download repo and build + +If you are in other environments, you should first install (golang)[https://go.dev/] 1.16+ and git. +Then you could download the repo and build agent binary yourself. + + +```bash +cd /your/path +git clone git@github.com:vesoft-inc/nebula-agent.git +cd nebula-agent +git checkout v0.1.1 +make +cd bin +chmod +x agent +``` + +## Usage + +If you want to use nebula-agent, you should start one and **only one** nebula-agent service in each nebula cluster machine which contains metad/storaged/metad services. +It should be given an agent daemon address and the metad address. If you have multi-metad in one nebula cluster, any address of them will be OK. + +```bash +Usage of agent: --agent string The agent server address --meta string @@ -45,4 +82,8 @@ Usage of bin/agent: Agent heartbeat interval to nebula meta, in seconds (default 60) ``` -An example: `agent --agent="127.0.0.1:8888" --meta="127.0.0.1:9559"` +An example: + +```bash +./agent --agent="127.0.0.1:8888" --meta="127.0.0.1:9559" +``` From 0ae463b43009938b5351a129dc56a70fca8ca18f Mon Sep 17 00:00:00 2001 From: pengweisong <90180021+pengweisong@users.noreply.github.com> Date: Tue, 15 Feb 2022 15:39:56 +0800 Subject: [PATCH 2/5] adjust quick start position --- README.md | 70 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index cbdbbb4..3607872 100644 --- a/README.md +++ b/README.md @@ -3,39 +3,6 @@ Nebula Agent is an daemon service in each machine of [nebula](https://github.com/vesoft-inc/nebula) cluster. It helps to keep track of nebula metad/storaged/graphd, start/stop them, call local rpc of them. It is only used for [backup and restore](https://github.com/vesoft-inc/nebula-br) tools for now. -# Features - -Nebula Agent provide two type of services now: file management in nebula machines and agent service. - -## File Management - -```C++ - // UploadFile upload file from agent machine to external storage - rpc UploadFile(UploadFileRequest) returns (UploadFileResponse); - // DownloadFile download file from external storage to agent machine - rpc DownloadFile(DownloadFileRequest) returns (DownloadFileResponse); - - // MoveDir rename dir in agent machine - rpc MoveDir(MoveDirRequest) returns (MoveDirResponse); - // RemoveDir delete dir in agent machine - rpc RemoveDir(RemoveDirRequest) returns (RemoveDirResponse); - // ExistDir check if dir in agent machine exist - rpc ExistDir(ExistDirRequest) returns (ExistDirResponse); -``` - -## Agent Service - -```C++ -// start/stop/get status of metad/storaged/graphd service -rpc StartService(StartServiceRequest) returns (StartServiceResponse); -rpc StopService(StopServiceRequest) returns (StopServiceResponse); -rpc ServiceStatus(ServiceStatusRequest) returns (ServiceStatusResponse); - -// ban read/write by call graphd's api -rpc BanReadWrite(BanReadWriteRequest) returns (BanReadWriteResponse); -rpc AllowReadWrite(AllowReadWriteRequest) returns (AllowReadWriteResponse); -``` - # Quick Start ## Download directly @@ -82,8 +49,43 @@ Usage of agent: Agent heartbeat interval to nebula meta, in seconds (default 60) ``` -An example: +An example: ```bash ./agent --agent="127.0.0.1:8888" --meta="127.0.0.1:9559" ``` + + +# Features + +Nebula Agent provide two type of services now: file management in nebula machines and agent service. + +## File Management + +```C++ +// UploadFile upload file from agent machine to external storage +rpc UploadFile(UploadFileRequest) returns (UploadFileResponse); +// DownloadFile download file from external storage to agent machine +rpc DownloadFile(DownloadFileRequest) returns (DownloadFileResponse); + +// MoveDir rename dir in agent machine +rpc MoveDir(MoveDirRequest) returns (MoveDirResponse); +// RemoveDir delete dir in agent machine +rpc RemoveDir(RemoveDirRequest) returns (RemoveDirResponse); +// ExistDir check if dir in agent machine exist +rpc ExistDir(ExistDirRequest) returns (ExistDirResponse); +``` + +## Agent Service + +```C++ +// start/stop/get status of metad/storaged/graphd service +rpc StartService(StartServiceRequest) returns (StartServiceResponse); +rpc StopService(StopServiceRequest) returns (StopServiceResponse); +rpc ServiceStatus(ServiceStatusRequest) returns (ServiceStatusResponse); + +// ban read/write by call graphd's api +rpc BanReadWrite(BanReadWriteRequest) returns (BanReadWriteResponse); +rpc AllowReadWrite(AllowReadWriteRequest) returns (AllowReadWriteResponse); +``` + From 5218295684a1e53ee135fa4f1517a8dade1610cb Mon Sep 17 00:00:00 2001 From: foesa <35463247+foesa-yang@users.noreply.github.com> Date: Tue, 15 Feb 2022 15:49:56 +0800 Subject: [PATCH 3/5] Update README.md --- README.md | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3607872..e883053 100644 --- a/README.md +++ b/README.md @@ -9,27 +9,42 @@ It is only used for [backup and restore](https://github.com/vesoft-inc/nebula-br If you are in linux amd64 environment, you could download it directly. -```bash -cd /your/path -wget https://github.com/vesoft-inc/nebula-agent/releases/download/v0.1.1/agent-v0.1.1 -mv agent-v0.1.1 agent -chmod +x agent -``` +1. Download the agent + ```bash + $ wget https://github.com/vesoft-inc/nebula-agent/releases/download/v0.1.1/agent-v0.1.1 + ``` +2. Change the agent name. + ```bash + $ mv agent-v0.1.1 agent + ``` +3. Add execute permission to agent. + ```bash + $ chmod +x agent + ``` ## Download repo and build If you are in other environments, you should first install (golang)[https://go.dev/] 1.16+ and git. Then you could download the repo and build agent binary yourself. +1. Clone repo. +```bash +$ git clone git@github.com:vesoft-inc/nebula-agent.git +``` +2.Change directory to nebula-agent. +```bash +$ cd nebula-agent +``` + +3. Compile with `make`. +```bash +$ make +``` +4. Add execute permission to agent. ```bash -cd /your/path -git clone git@github.com:vesoft-inc/nebula-agent.git -cd nebula-agent -git checkout v0.1.1 -make -cd bin -chmod +x agent +$ cd bin +$ chmod +x agent ``` ## Usage From 416a282e75b78ad783a7d7eed4298664395d2cc3 Mon Sep 17 00:00:00 2001 From: foesa <35463247+foesa-yang@users.noreply.github.com> Date: Tue, 15 Feb 2022 15:51:21 +0800 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e883053..9879e18 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It is only used for [backup and restore](https://github.com/vesoft-inc/nebula-br If you are in linux amd64 environment, you could download it directly. -1. Download the agent +1. Download the agent. ```bash $ wget https://github.com/vesoft-inc/nebula-agent/releases/download/v0.1.1/agent-v0.1.1 ``` From c3ea711c453e92050728c9cba40892d997590e71 Mon Sep 17 00:00:00 2001 From: pengweisong <90180021+pengweisong@users.noreply.github.com> Date: Tue, 15 Feb 2022 16:02:53 +0800 Subject: [PATCH 5/5] add a blank --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9879e18..6e67c32 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Then you could download the repo and build agent binary yourself. $ git clone git@github.com:vesoft-inc/nebula-agent.git ``` -2.Change directory to nebula-agent. +2. Change directory to nebula-agent. ```bash $ cd nebula-agent ```