From 60ecd837d980f71b65b6284ecf3f6102ca1b2ce0 Mon Sep 17 00:00:00 2001 From: santong Date: Wed, 30 Jun 2021 17:54:06 +0800 Subject: [PATCH] docs: add user guide Signed-off-by: santong --- docs/en/cli-reference/cdn.md | 2 +- docs/en/cli-reference/dfget.md | 4 +- docs/en/cli-reference/manager.md | 10 +- docs/en/cli-reference/scheduler.md | 2 +- docs/en/user-guide/install/README.md | 7 +- docs/en/user-guide/install/install-cdn.md | 12 +- docs/en/user-guide/install/install-client.md | 136 ------------------ docs/en/user-guide/install/install-manager.md | 84 +++-------- .../user-guide/install/install-scheduler.md | 19 +-- docs/en/user-guide/quick-start.md | 115 +-------------- docs/zh-CN/cli-reference/cdn.md | 35 +---- docs/zh-CN/cli-reference/manager.md | 20 +++ docs/zh-CN/cli-reference/scheduler.md | 37 +---- 13 files changed, 76 insertions(+), 407 deletions(-) delete mode 100644 docs/en/user-guide/install/install-client.md create mode 100644 docs/zh-CN/cli-reference/manager.md diff --git a/docs/en/cli-reference/cdn.md b/docs/en/cli-reference/cdn.md index 6e2a9d8b514..a7f006cd4c7 100644 --- a/docs/en/cli-reference/cdn.md +++ b/docs/en/cli-reference/cdn.md @@ -7,7 +7,7 @@ CDN is a long-running process which caches downloaded data from source to avoid go run cmd/cdnsystem/main.go [Option] ``` ## Log configuration -set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Terminal +set environment variable console=true if you want to print logs to Terminal ## Runtime metrics monitoring ``` diff --git a/docs/en/cli-reference/dfget.md b/docs/en/cli-reference/dfget.md index a42e30798ea..c66b04f2b69 100644 --- a/docs/en/cli-reference/dfget.md +++ b/docs/en/cli-reference/dfget.md @@ -21,7 +21,7 @@ dfget --schedulers 127.0.0.1:8002 -o /path/to/output -u "http://example.com/obje ## Log configuration -set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Terminal +set environment variable console=true if you want to print logs to Terminal ### Options @@ -64,7 +64,7 @@ set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Te ## Log configuration -set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Terminal +set environment variable console=true if you want to print logs to Terminal ### Options diff --git a/docs/en/cli-reference/manager.md b/docs/en/cli-reference/manager.md index b6edfda6dd2..5163eff078c 100644 --- a/docs/en/cli-reference/manager.md +++ b/docs/en/cli-reference/manager.md @@ -1,13 +1,15 @@ ## Manager -Scheduler is a long-running process which receives and manages download tasks from the client, notify the CDN to return to the source, -generate and maintain a P2P network during the download process, and push suitable download nodes to the client +Manager is a process that runs in the background and plays the role of the brain of each subsystem cluster in Dragonfly. It is used to manage the dynamic +configuration of each system module and provide functions such as heartbeat keeping alive, monitoring the market, and product functions. + ## Try it ``` -go run cmd/scheduler/main.go [Option] +go run cmd/manager/main.go [Option] ``` + ## Log configuration -set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Terminal +set environment variable console=local if you want to print logs to Terminal ## Runtime metrics monitoring ``` diff --git a/docs/en/cli-reference/scheduler.md b/docs/en/cli-reference/scheduler.md index 885cad11bb5..7ee366cd17b 100644 --- a/docs/en/cli-reference/scheduler.md +++ b/docs/en/cli-reference/scheduler.md @@ -7,7 +7,7 @@ generate and maintain a P2P network during the download process, and push suitab go run cmd/scheduler/main.go [Option] ``` ## Log configuration -set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Terminal +set environment variable console=true if you want to print logs to Terminal ## Runtime metrics monitoring ``` diff --git a/docs/en/user-guide/install/README.md b/docs/en/user-guide/install/README.md index 48ca323e049..77ed3e9f891 100644 --- a/docs/en/user-guide/install/README.md +++ b/docs/en/user-guide/install/README.md @@ -1,4 +1,5 @@ -[install-client]() is the installation instructions of client -[install-cdn]() is the installation instructions of CDN -[install-cdn]() is the installation instructions of CDN +[install-client](./install-client.md) is the installation instructions of client +[install-manager](./install-manager.md) is the installation instructions of manager +[install-scheduler](./install-scheduler.md) is the installation instructions of scheduler +[install-cdn](./install-cdn.md) is the installation instructions of CDN diff --git a/docs/en/user-guide/install/install-cdn.md b/docs/en/user-guide/install/install-cdn.md index 4960e1da22d..4ff61df83c4 100644 --- a/docs/en/user-guide/install/install-cdn.md +++ b/docs/en/user-guide/install/install-cdn.md @@ -1,6 +1,6 @@ # Installing Dragonfly CDN Server -This topic explains how to install the Dragonfly cdn server. +This topic explains how to install the Dragonfly CDN server. ## Context @@ -70,7 +70,7 @@ Or you can build your own cdn image. **NOTE:** Replace ${cdnDockerImageId} with the ID obtained at the previous step. ```sh -docker run -d --name cdn --restart=always -p 8001:8001 -p 8003:8003 -v /home/admin/cdn:/home/admin/cdn ${cdnDockerImageId} +docker run -d --name cdn --restart=always -p 8001:8001 -p 8003:8003 -v /home/admin/ftp:/home/admin/ftp ${cdnDockerImageId} --download-port=8001 ``` @@ -127,7 +127,7 @@ cdn --home-dir=$cdnHomeDir --port=8003 --download-port=$cdnDownloadPort You can start a file server in any way. However, the following conditions must be met: -- It must be rooted at `${cdnHomeDir}/repo` which is defined in the previous step. +- It must be rooted at `${cdnHomeDir}/ftp` which is defined in the previous step. - It must listen on the port `cdnDownloadPort` which is defined in the previous step. Let's take nginx as an example. @@ -159,9 +159,3 @@ Let's take nginx as an example. telnet 127.0.0.1 8001 telnet 127.0.0.1 8003 ``` - -- [Install the Dragonfly client](install-client.md) and test if the downloading works. - - ```sh - dfget --url "http://${resourceUrl}" --output ./resource.png --supernode "127.0.0.1:8002=1" - ``` diff --git a/docs/en/user-guide/install/install-client.md b/docs/en/user-guide/install/install-client.md deleted file mode 100644 index 93582eb48fc..00000000000 --- a/docs/en/user-guide/install/install-client.md +++ /dev/null @@ -1,136 +0,0 @@ -# Installing Dragonfly Client - -This topic explains how to install the Dragonfly `dfclient`. - -## Context - -Install the `dfclient` in one of the following ways: - -- Deploying with Docker. -- Deploying with physical machines. - -## Prerequisites - -When deploying with Docker, the following conditions must be met. - -Required Software | Version Limit ----|--- -Git|1.9.1+ -Docker|1.12.0+ - -When deploying with physical machines, the following conditions must be met. - -Required Software | Version Limit ----|--- -Git|1.9.1+ -Golang|1.12.x - -## Procedure - When Deploying with Docker - -### Get dfclient image - -You can get it from [DockerHub](https://hub.docker.com/) directly. - -1. Obtain the latest Docker image ID of the SuperNode. - - ```sh - docker pull dragonflyoss/dfclient:1.0.0 - ``` - -Or you can build your own dfclient image. - -1. Obtain the source code of Dragonfly. - - ```sh - git clone https://github.com/dragonflyoss/Dragonfly.git - ``` - -2. Enter the project directory. - - ```sh - cd Dragonfly - ``` - -3. Build the Docker image. - - ```sh - TAG="1.0.0" - make docker-build-client DF_VERSION=$TAG - ``` - -4. Obtain the latest Docker image ID of the `dfclient`. - - ```sh - docker image ls | grep 'dfclient' | awk '{print $3}' | head -n1 - ``` - -### Start the dfdaemon - -**NOTE:** You should prepare the [config files](../../config) which should locate under `/etc/dragonfly` by default. - -```sh -version=1.0.0 -# Replace ${supernode} with your own supernode node with format `ip:port=weight`. -SUPERNODE=$supernode -docker run -d --name dfclient --restart=always -p 65001:65001 -v $HOME/.small-dragonfly:/root/.small-dragonfly -v /etc/dragonfly:/etc/dragonfly dragonflyoss/dfclient:$version --node $SUPERNODE -``` - -## Procedure - When Deploying with Physical Machines - -### Get dfclient executable file - -1. Download a binary package of the SuperNode. You can download one of the latest builds for Dragonfly on the [github releases page](https://github.com/dragonflyoss/Dragonfly/releases). - - ```sh - version=1.0.0 - wget https://github.com/dragonflyoss/Dragonfly/releases/download/v$version/Dragonfly_$version_linux_amd64.tar.gz - ``` - -2. Unzip the package. - - ```bash - # Replace `xxx` with the installation directory. - tar -zxf Dragonfly_1.0.0_linux_amd64.tar.gz -C xxx - ``` - -3. Move the `dfget` and `dfdaemon` to your `PATH` environment variable to make sure you can directly use `dfget` and `dfdaemon` command. - -Or you can build your own dfclient executable files. - -1. Obtain the source code of Dragonfly. - - ```sh - git clone https://github.com/dragonflyoss/Dragonfly.git - ``` - -2. Enter the project directory. - - ```sh - cd Dragonfly - ``` - -3. Build `dfdaemon` and `dfget`. - - ```sh - make build-client && make install-client - ``` - -### Start the dfdaemon - -**NOTE:** You can ignore this step when using only dfget for file distribution . - -```sh -# Replace ${supernode} with your own supernode node with format `ip:port=weight`. -SUPERNODE=$supernode -dfdaemon --node $SUPERNODE -``` - -## After this Task - -Test if the downloading works. - -```sh -dfget --url "http://${resourceUrl}" --output ./resource.png --node "127.0.0.1:8002" -``` - -And test dfdaemon by [pulling an image](../download-files.md). diff --git a/docs/en/user-guide/install/install-manager.md b/docs/en/user-guide/install/install-manager.md index 4960e1da22d..620d5784ef5 100644 --- a/docs/en/user-guide/install/install-manager.md +++ b/docs/en/user-guide/install/install-manager.md @@ -1,13 +1,13 @@ -# Installing Dragonfly CDN Server +# Installing Dragonfly Manager Server -This topic explains how to install the Dragonfly cdn server. +This topic explains how to install the Dragonfly manager server. ## Context -Install CDN in one of the following ways: +Install manager in one of the following ways: -- Deploying with Docker. -- Deploying with physical machines: Recommended for production usage. +- Deploying with Docker: Recommended for production usage. +- Deploying with physical machines. ## Prerequisites @@ -28,17 +28,17 @@ Nginx|0.8+ ## Procedure - When Deploying with Docker -### Get cdn image +### Get manager image You can get it from [DockerHub](https://hub.docker.com/) directly. -1. Obtain the latest Docker image of the cdn. +1. Obtain the latest Docker image of the manager. ```sh - docker pull d7yio/cdn + docker pull d7yio/manager ``` -Or you can build your own cdn image. +Or you can build your own manager image. 1. Obtain the source code of Dragonfly. @@ -56,29 +56,28 @@ Or you can build your own cdn image. ```sh TAG="1.0.0" - make docker-build-cdn D7Y_VERSION=$TAG + make docker-build-manager D7Y_VERSION=$TAG ``` -4. Obtain the latest Docker image ID of the cdn. +4. Obtain the latest Docker image ID of the manager. ```sh - docker image ls | grep 'cdn' | awk '{print $3}' | head -n1 + docker image ls | grep 'manager' | awk '{print $3}' | head -n1 ``` -### Start cdn +### Start manager -**NOTE:** Replace ${cdnDockerImageId} with the ID obtained at the previous step. +**NOTE:** Replace ${managerDockerImageId} with the ID obtained at the previous step. ```sh -docker run -d --name cdn --restart=always -p 8001:8001 -p 8003:8003 -v /home/admin/cdn:/home/admin/cdn ${cdnDockerImageId} ---download-port=8001 +docker run -d --name manager --restart=always -p 8004:8004 ${managerDockerImageId} ``` ## Procedure - When Deploying with Physical Machines ### Get cdn executable file -1. Download a binary package of the cdn. You can download one of the latest builds for Dragonfly on the [github releases page](https://github. +1. Download a binary package of the manager. You can download one of the latest builds for Dragonfly on the [github releases page](https://github. com/dragonflyoss/Dragonfly2/releases). ```sh @@ -93,9 +92,9 @@ docker run -d --name cdn --restart=always -p 8001:8001 -p 8003:8003 -v /home/adm tar -zxf Dragonfly2_1.0.0_linux_amd64.tar.gz -C xxx ``` -3. Move the `cdn` to your `PATH` environment variable to make sure you can directly use `cdn` command. +3. Move the `manager` to your `PATH` environment variable to make sure you can directly use `manager` command. -Or you can build your own cdn executable file. +Or you can build your own manager executable file. 1. Obtain the source code of Dragonfly. @@ -112,56 +111,19 @@ Or you can build your own cdn executable file. 3. Compile the source code. ```sh - make build-cdn && make install-cdn + make build-manaager && make install-manager ``` -### Start cdn +### Start manager ```sh -cdnHomeDir=/home/admin/cdn -cdnDownloadPort=8001 -cdn --home-dir=$cdnHomeDir --port=8003 --download-port=$cdnDownloadPort +manager --options ``` -### Start file server - -You can start a file server in any way. However, the following conditions must be met: - -- It must be rooted at `${cdnHomeDir}/repo` which is defined in the previous step. -- It must listen on the port `cdnDownloadPort` which is defined in the previous step. - -Let's take nginx as an example. - -1. Add the following configuration items to the Nginx configuration file. - - ```conf - server { - # Must be ${cdnDownloadPort} - listen 8001; - location / { - # Must be ${cdnHomeDir}/repo - root /home/admin/cdn/repo; - } - } - ``` - -2. Start Nginx. - - ```sh - sudo nginx - ``` - ## After this Task -- After cdn is installed, run the following commands to verify if Nginx and **cdn** are started, and if Port `8001` and `8003` are available. - - ```sh - telnet 127.0.0.1 8001 - telnet 127.0.0.1 8003 - ``` - -- [Install the Dragonfly client](install-client.md) and test if the downloading works. +- After manager is installed, run the following commands to verify if **manager** is started, and if Port `8004` and `8003` is available. ```sh - dfget --url "http://${resourceUrl}" --output ./resource.png --supernode "127.0.0.1:8002=1" + telnet 127.0.0.1 8004 ``` diff --git a/docs/en/user-guide/install/install-scheduler.md b/docs/en/user-guide/install/install-scheduler.md index d9e5c7adb34..c005b3da394 100644 --- a/docs/en/user-guide/install/install-scheduler.md +++ b/docs/en/user-guide/install/install-scheduler.md @@ -6,7 +6,7 @@ This topic explains how to install the Dragonfly scheduler server. Install scheduler in one of the following ways: -- Deploying with Docker. +- Deploying with Docker: Recommended for production usage. - Deploying with physical machines. ## Prerequisites @@ -70,8 +70,7 @@ Or you can build your own scheduler image. **NOTE:** Replace ${schedulerDockerImageId} with the ID obtained at the previous step. ```sh -docker run -d --name scheduler --restart=always -p 8002 -v /home/admin/scheduler:/home/admin/scheduler ${schedulerDockerImageId} ---download-port=8001 +docker run -d --name scheduler --restart=always -p 8002 ${schedulerDockerImageId} ``` ## Procedure - When Deploying with Physical Machines @@ -118,20 +117,12 @@ Or you can build your own scheduler executable file. ### Start scheduler ```sh -schedulerHomeDir=/home/admin/scheduler -cdn --home-dir=$cdnHomeDir --port=8003 --download-port=$cdnDownloadPort +scheduler --options ``` ## After this Task -- After cdn is installed, run the following commands to verify if Nginx and **cdn** are started, and if Port `8001` and `8003` are available. +- After scheduler is installed, run the following commands to verify if **scheduler** is started, and if Port `8002` is available. ```sh - telnet 127.0.0.1 8001 - telnet 127.0.0.1 8003 - ``` - -- [Install the Dragonfly client](install-client.md) and test if the downloading works. - - ```sh - dfget --url "http://${resourceUrl}" --output ./resource.png --supernode "127.0.0.1:8002=1" + telnet 127.0.0.1 8002 ``` diff --git a/docs/en/user-guide/quick-start.md b/docs/en/user-guide/quick-start.md index 284953ed329..c7d0da439d8 100644 --- a/docs/en/user-guide/quick-start.md +++ b/docs/en/user-guide/quick-start.md @@ -9,120 +9,13 @@ This table describes some container runtimes version and documents. | Runtime | Version | Document | CRI Support | Pull Command | | --- | --- | --- | --- | --- | -| Docker | All | [Link](./proxy/docker.md) | No | docker pull docker.io/library/alpine | | Containerd without CRI | All | [Link](./proxy/containerd.md) | No | ctr image pull docker.io/library/alpine | -| Containerd with CRI | v1.1.0+ | [Link](registry-mirror/cri-containerd.md) | Yes | crictl pull docker.io/library/alpine:latest | +| Containerd with CRI | v1.1.0+ | [Link](./registry-mirror/cri-containerd.md) | Yes | crictl pull docker.io/library/alpine:latest | | CRI-O | All | [Link](./registry-mirror/cri-o.md) | Yes | crictl pull docker.io/library/alpine:latest | When using Dragonfly in Kubernetes, we recommend to use `Containerd with CRI` and `CRI-O`, deploying document can be found in [Kubernetes-with-Dragonfly](../ecosystem/Kubernetes-with-Dragonfly.md). - -# Dragonfly Quick Start - -Dragonfly Quick Start document aims to help you to quick start Dragonfly journey. This experiment is quite easy and simplified. - -If you are using Dragonfly in your **production environment** to handle production image distribution, please refer to supernode and dfget's detailed production parameter configuration. - -## Prerequisites - -All steps in this document is doing on the same machine using the docker container, so make sure the docker container engine installed and started on your machine. You can also refer to the documentation: [multi-machine deployment](../user_guide/multi_machines_deployment.md) to experience Dragonfly. - -## Step 1: Deploy Dragonfly Manager Server - -```bash -docker run -d --name supernode \ - --restart=always \ - -p 8001:8001 \ - -p 8002:8002 \ - -v /home/admin/supernode:/home/admin/supernode \ - dragonflyoss/supernode:1.0.2 -``` - -## Step 2: Deploy Dragonfly CDN Server - -```bash -docker run -d --name supernode \ - --restart=always \ - -p 8001:8001 \ - -p 8002:8002 \ - -v /home/admin/supernode:/home/admin/supernode \ - dragonflyoss/supernode:1.0.2 -``` - -## Step 3: Deploy Dragonfly Scheduler Server - -```bash -docker run -d --name supernode \ - --restart=always \ - -p 8001:8001 \ - -p 8002:8002 \ - -v /home/admin/supernode:/home/admin/supernode \ - dragonflyoss/supernode:1.0.2 -``` - -## Step 2: Deploy Dragonfly Client - -```bash -SUPERNODE_IP=`docker inspect supernode -f '{{.NetworkSettings.Networks.bridge.IPAddress}}'` -docker run -d --name dfclient \ - --restart=always \ - -p 65001:65001 \ - -v $HOME/.small-dragonfly:/root/.small-dragonfly \ - dragonflyoss/dfclient:1.0.2 --registry https://index.docker.io --node $SUPERNODE_IP -``` - -**NOTE**: - -- The `--registry` parameter specifies the mirrored image registry address, and `https://index.docker.io` is the address of official image registry, you can also set it to the other **non-https image registries**. -- The `--node` parameter specifies the supernode's address in the format of **HOST:IP**. And the default value `8002` will be used if the port is not specified. Here we use `docker inspect` to get the ip of supernode container as the host value. Since the supernode container exposes its ports, you can specify this parameter to node ip address as well. - -## Step 3. Configure Docker Daemon - -We need to modify the Docker Daemon configuration to use the Dragonfly as a pull through registry. - -1. Add or update the configuration item `registry-mirrors` in the configuration file`/etc/docker/daemon.json`. - -```json -{ - "registry-mirrors": ["http://127.0.0.1:65001"] -} -``` - -**Tip:** For more information on `/etc/docker/daemon.json`, see [Docker documentation](https://docs.docker.com/registry/recipes/mirror/#configure-the-cache). - -2. Restart Docker Daemon. - -```bash -systemctl restart docker -``` - -## Step 4: Pull images with Dragonfly - -Through the above steps, we can start to validate if Dragonfly works as expected. - -And you can pull the image as usual, for example: - -```bash -docker pull nginx:latest -``` - -## Step 5: Validate Dragonfly - -You can execute the following command to check if the nginx image is distributed via Dragonfly. - -```bash -docker exec dfclient grep 'downloading piece' /root/.small-dragonfly/logs/dfclient.log -``` - -If the output of command above has content like - -``` -2019-03-29 15:49:53.913 INFO sign:96027-1553845785.119 : downloading piece:{"taskID":"00a0503ea12457638ebbef5d0bfae51f9e8e0a0a349312c211f26f53beb93cdc","superNode":"127.0.0.1","dstCid":"127.0.0.1-95953-1553845720.488","range":"67108864-71303167","result":503,"status":701,"pieceSize":4194304,"pieceNum":16} -``` - -then Dragonfly works successfully. - ## SEE ALSO - [multi machines deployment](../user-guide/multi-machines-deployment.md) - experience Dragonfly on multiple machines @@ -130,8 +23,8 @@ then Dragonfly works successfully. - [install cdn](../user-guide/install/install-cdn.md) - how to install the Dragonfly cdn - [install scheduler](../user-guide/install/install-scheduler.md) - how to install the Dragonfly scheduler - [install client](../user-guide/install/install-client.md) - how to install the Dragonfly client -- [proxy](../user_guide/proxy/docker.md) - make Dragonfly as an HTTP proxy for docker daemon +- [proxy](../user-guide/proxy/containerd.md) - make Dragonfly as an HTTP proxy for docker daemon - [download files](../user-guide/download-files.md) - download files with Dragonfly - Container Runtimes - - [cri-o mirror](../user_guide/registry/cri-o.md) - make Dragonfly as Registry Mirror for CRIO daemon - - [cri-containerd_mirror](../user_guide/registry/cri-containerd.md) - make Dragonfly as Registry Mirror for containerd daemon \ No newline at end of file + - [cri-o mirror](../user-guide/registry-mirror/cri-o.md) - make Dragonfly as Registry Mirror for CRIO daemon + - [cri-containerd_mirror](../user-guide/registry-mirror/cri-containerd.md) - make Dragonfly as Registry Mirror for containerd daemon \ No newline at end of file diff --git a/docs/zh-CN/cli-reference/cdn.md b/docs/zh-CN/cli-reference/cdn.md index 6eca49855a5..d59e1fc7c59 100644 --- a/docs/zh-CN/cli-reference/cdn.md +++ b/docs/zh-CN/cli-reference/cdn.md @@ -1,13 +1,13 @@ ## CDN -CDN is a long-running process which caches downloaded data from source to avoid downloading the same files from source repeatedly +CDN 是一个长时间运行的服务进程,它缓存从源下载的数据,以避免重复从源下载相同的文件 ## 用法 ``` go run cmd/cdnsystem/main.go [Option] ``` -## Log configuration -set environment variable DF_ACTIVE_PROFILE=local if you want to print logs to Terminal +## 输出日志配置 +如果你期望把系统执行日志输出到命令终端,设置环境变量 console=true ## Runtime metrics monitoring ``` @@ -23,31 +23,4 @@ go run cmd/cdnsystem/main.go --profiler --jaeger string jaeger endpoint url, like: http://localhost:14250/api/traces --pprof-port int listen port for pprof, 0 represents random port (default -1) --verbose whether logger use debug level -``` - -### 二进制命令使用示例 - -scheduler --config your-config-path/scheduler.yaml - -### 配置文件说明 - -``` -server: - port: 8001 rpc 端口 - -scheduler: - -worker: - worker-num: 5 工作线程数 - worker-job-pool-size: 10000 工作队列长度 - sender-num: 10 发送消息线程数 - sender-job-pool-size: 10000 发送消息队列长度 - -cdn: - list: CDN列表 - - - - cdn-name : "cdn" CDN服务器的HostName - ip: "127.0.0.1" CDN服务器的IP地址 - rpcPort: 8003 CDN的RPC端口 - download-port: 8002 CDN的下载端口 -``` +``` \ No newline at end of file diff --git a/docs/zh-CN/cli-reference/manager.md b/docs/zh-CN/cli-reference/manager.md new file mode 100644 index 00000000000..35357d6b574 --- /dev/null +++ b/docs/zh-CN/cli-reference/manager.md @@ -0,0 +1,20 @@ +## Scheduler + +Manager 是一个常驻后台运行的进程,它在蜻蜓中扮演各个子系统集群大脑的角色, 用于管理各个系统模块依赖的动态配置,以及提供心跳保活、监控大盘和产品化的功能。 + +### 用法 +``` +go run cmd/manager/main.go [Option] +``` + +### 可选参数 + +``` + --config string the path of scheduler's configuration file (default "conf/scheduler.yaml") + -h, --help help for scheduler + --port int port is the port that scheduler server listens on (default 8002) + --sender-job-pool-size int sender-job-pool-size is used for scheduler and do not change it (default 10000) + --sender-num int sender-num is used for scheduler and do not change it (default 50) + --worker-job-pool-size int worker-job-pool-size is used for scheduler and do not change it (default 10000) + --worker-num int worker-num is used for scheduler and do not change it (default 12) +``` \ No newline at end of file diff --git a/docs/zh-CN/cli-reference/scheduler.md b/docs/zh-CN/cli-reference/scheduler.md index 9b647c47da8..2d1f188f43b 100644 --- a/docs/zh-CN/cli-reference/scheduler.md +++ b/docs/zh-CN/cli-reference/scheduler.md @@ -1,14 +1,10 @@ -## Scheduler - -Scheduler 生成并维护下载过程中的P2P网络 - -### 说明 +## Scheduler Scheduler 是一个常驻后台运行的进程,用于接收和管理客户端的下载任务,通知CDN进行回源, 在下载过程中生成维护P2P网络,给客户端推送适合的下载节点 ### 用法 ``` -scheduler [flags] +go run cmd/scheduler/main.go [Option] ``` ### 可选参数 @@ -21,31 +17,4 @@ scheduler [flags] --sender-num int sender-num is used for scheduler and do not change it (default 50) --worker-job-pool-size int worker-job-pool-size is used for scheduler and do not change it (default 10000) --worker-num int worker-num is used for scheduler and do not change it (default 12) -``` - -### 二进制命令使用示例 - -scheduler --config your-config-path/scheduler.yaml - -### 配置文件说明 - -``` -server: - port: 8001 rpc 端口 - -scheduler: - -worker: - worker-num: 5 工作线程数 - worker-job-pool-size: 10000 工作队列长度 - sender-num: 10 发送消息线程数 - sender-job-pool-size: 10000 发送消息队列长度 - -cdn: - list: CDN列表 - - - - cdn-name : "cdn" CDN服务器的HostName - ip: "127.0.0.1" CDN服务器的IP地址 - rpcPort: 8003 CDN的RPC端口 - download-port: 8002 CDN的下载端口 -``` +``` \ No newline at end of file