diff --git a/docs/getting-started/installation/binaries.md b/docs/getting-started/installation/binaries.md index 4e2670e9..05b1f8a6 100644 --- a/docs/getting-started/installation/binaries.md +++ b/docs/getting-started/installation/binaries.md @@ -10,12 +10,13 @@ This guide shows how to install the Dragonfly. Dragonfly can be installed either -| Name | Version | Document | -| ----------------- | ---------------------------- | ---------------------------------------------------------------------------- | -| Git | 1.9.1+ | [git-scm](https://git-scm.com/) | -| Golang | 1.16.x | [go.dev](https://go.dev/) | -| Database | Mysql 5.6+ OR PostgreSQL 12+ | [mysql](https://www.mysql.com/) OR [postgresql](https://www.postgresql.org/) | -| Redis | 3.0+ | [redis.io](https://redis.io/) | +| Name | Version | Document | +| -------- | ---------------------------- | ---------------------------------------------------------------------------- | +| Git | 1.9.1+ | [git-scm](https://git-scm.com/) | +| Golang | 1.16.x | [go.dev](https://go.dev/) | +| Rust | 1.2+ | [rustup.rs](https://rustup.rs/) | +| Database | Mysql 5.6+ OR PostgreSQL 12+ | [mysql](https://www.mysql.com/) OR [postgresql](https://www.postgresql.org/) | +| Redis | 3.0+ | [redis.io](https://redis.io/) | @@ -47,6 +48,35 @@ Untar the package: tar -zxf dragonfly_linux_amd64.tar.gz -C /path/to/dragonfly ``` +Every [release](https://github.com/dragonflyoss/client/releases) of +Clinet provides binary releases for a variety of OSes. +These binary versions can be manually downloaded and installed. + +Download the Client binaries: + +> Notice: your_client_version is recommended to use the latest version. + +```bash +VERSION= + +# Download the dfget binaries. +wget -O client_dfget_x86_64-unknown-linux-gnu.tar.gz https://github.com/dragonflyoss/client/releases/download/v${VERSION}/dfget-v${VERSION}-x86_64-unknown-linux-gnu.tar.gz + +# Download the dfdaemon binaries. +wget -O client_dfdaemon_x86_64-unknown-linux-gnu.tar.gz https://github.com/dragonflyoss/client/releases/download/v${VERSION}/dfdaemon-v${VERSION}-x86_64-unknown-linux-gnu.tar.gz +``` + +Untar the package: + +```bash +# Replace `/path/to/dragonfly` with the installation directory. +tar -zxf client_dfget_x86_64-unknown-linux-gnu.tar.gz -C /path/to/dragonfly + +tar -zxf client_dfdaemon_x86_64-unknown-linux-gnu.tar.gz -C /path/to/dragonfly +``` + + + Configuration environment: ```bash @@ -65,16 +95,30 @@ cd Dragonfly2 Compile the source code: ```bash -# At the same time to build scheduler, dfget and manager. -make build +# At the same time to build scheduler and manager. +make build-manager && make build-scheduler -# make build is equivalent to -make build-scheduler && make build-dfget && make build-manager - -# Install executable file to /opt/dragonfly/bin/{manager,scheduler,dfget}. +# Install executable file to /opt/dragonfly/bin/{manager,scheduler}. make install-manager make install-scheduler -make install-dfget +``` + +Clone the source code of Client: + +```bash +git clone https://github.com/dragonflyoss/client.git +cd client +``` + +Compile the source code: + +```bash +# At the same time to build dfdaemon and dfget. +cargo build --release --bins + +# Install executable file to /opt/dragonfly/bin/{dfget,dfdaemon}. +mv target/release/dfget /opt/dragonfly/bin/dfget +mv target/release/dfdaemon /opt/dragonfly/bin/dfdaemon ``` Configuration environment: @@ -197,26 +241,24 @@ telnet 127.0.0.1 8002 #### Startup Dfdaemon as Seed Peer {#startup-dfdaemon-as-seed-peer} -Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfget.yaml` in linux, -The default path in Darwin is `$HOME/.dragonfly/config/dfget.yaml`, +Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfdaemon.yaml` in linux, +The default path in Darwin is `$HOME/.dragonfly/config/dfdaemon.yaml`, refer to [Dfdaemon](../../reference/configuration/dfdaemon.md). Set the `scheduler.manager.netAddrs.addr` address in the configuration file to your actual address. Configuration content is as follows: +> Notice: manager.addrs must be a complete URL. + ```yaml # Seed Peer configuration. -scheduler: - manager: - enable: true - netAddrs: - - type: tcp - addr: dragonfly-manager:65003 - refreshInterval: 10m - seedPeer: - enable: true - type: super - clusterID: 1 +manager: + addrs: + - dragonfly-manager:65003 +seedPeer: + enable: true + type: super + clusterID: 1 ``` Run Dfdaemon as Seed Peer: @@ -225,42 +267,40 @@ Run Dfdaemon as Seed Peer: # View Dfget cli help docs. dfget --help -# View Dfget daemon cli help docs. -dfget daemon --help +# View Dfdaemon cli help docs. +dfdaemon --help -# Startup Dfget daemon mode. -dfget daemon +# Startup Dfdaemon mode. +dfdaemon ``` #### Verify {#verify-seed-peer} After the Seed Peer deployment is complete, run the following commands to verify if **Seed Peer** is started, -and if Port `65000`, `65001` and `65002` is available. +and if Port `4000`, `4001` and `4002` is available. ```bash -telnet 127.0.0.1 65000 -telnet 127.0.0.1 65001 -telnet 127.0.0.1 65002 +telnet 127.0.0.1 4000 +telnet 127.0.0.1 4001 +telnet 127.0.0.1 4002 ``` #### Startup Dfdaemon as Peer {#startup-dfdaemon-as-Peer} -Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfget.yaml` in linux, -The default path in Darwin is `$HOME/.dragonfly/config/dfget.yaml`, +Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfdaemon.yaml` in linux, +The default path in Darwin is `$HOME/.dragonfly/config/dfdaemon.yaml`, refer to [Dfdaemon](../../reference/configuration/dfdaemon.md). -Set the `scheduler.manager.netAddrs.addr` address in the configuration file to your actual address. +Set the `manager.addrs` address in the configuration file to your actual address. Configuration content is as follows: +> Notice: manager.addrs must be a complete URL. + ```yaml # Peer configuration. -scheduler: - manager: - enable: true - netAddrs: - - type: tcp - addr: dragonfly-manager:65003 - refreshInterval: 10m +manager: + addrs: + - dragonfly-manager:65003 ``` Run Dfdaemon as Peer: @@ -269,20 +309,20 @@ Run Dfdaemon as Peer: # View Dfget cli help docs. dfget --help -# View Dfget daemon cli help docs. -dfget daemon --help +# View Dfdaemon cli help docs. +dfdaemon --help -# Startup Dfget daemon mode. -dfget daemon +# Startup Dfdaemon mode. +dfdaemon ``` #### Verify {#verify-peer} After the Peer deployment is complete, run the following commands to verify if **Peer** is started, -and if Port `65000`, `65001` and `65002` is available. +and if Port `4000`, `4001` and `4002` is available. ```bash -telnet 127.0.0.1 65000 -telnet 127.0.0.1 65001 -telnet 127.0.0.1 65002 +telnet 127.0.0.1 4000 +telnet 127.0.0.1 4001 +telnet 127.0.0.1 4002 ``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/getting-started/installation/binaries.md b/i18n/zh/docusaurus-plugin-content-docs/current/getting-started/installation/binaries.md index d9cfcdc6..114a4235 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/getting-started/installation/binaries.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/getting-started/installation/binaries.md @@ -10,10 +10,11 @@ slug: /getting-started/installation/binaries/ -| 所需软件 | 版本要求 | 文档 | -| -------- | ---------------------------- | --------------------------------------------------------------------------- | +| 所需软件 | 版本要求 | 文档 | +| -------- | ---------------------------- | ---------------------------------------------------------------------------- | | Git | 1.9.1+ | [git-scm](https://git-scm.com/) | | Golang | 1.16.x | [go.dev](https://go.dev/) | +| Rust | 1.2+ | [rustup.rs](https://rustup.rs/) | | Database | Mysql 5.6+ 或 PostgreSQL 12+ | [mysql](https://www.mysql.com/) OR [postgresql](https://www.postgresql.org/) | | Redis | 3.0+ | [redis.io](https://redis.io/) | @@ -34,13 +35,36 @@ VERSION= wget -O dragonfly_linux_amd64.tar.gz https://github.com/dragonflyoss/Dragonfly2/releases/download/v${VERSION}/dragonfly-${VERSION}-linux-amd64.tar.gz ``` - 解压压缩包: +解压压缩包: ```bash # 替换 `/path/to/dragonfly` 为真实安装目录。 tar -zxf dragonfly_linux_amd64.tar.gz -C /path/to/dragonfly ``` +每个 Client [版本](https://github.com/dragonflyoss/client/releases) 都提供了各种操作系统的二进制版本,这些版本可以手动下载和安装。 + +下载 Client 的二进制文件: + +> 注意: your_client_version 建议使用最新版本 + +```bash +CLIENT_VERSION= + +wget -O client_dfget_x86_64-unknown-linux-gnu.tar.gz https://github.com/dragonflyoss/client/releases/download/v${CLIENT_VERSION}/dfget-v${CLIENT_VERSION}-x86_64-unknown-linux-gnu.tar.gz + +wget -O client_dfdaemon_x86_64-unknown-linux-gnu.tar.gz https://github.com/dragonflyoss/client/releases/download/v${CLIENT_VERSION}/dfdaemon-v${CLIENT_VERSION}-x86_64-unknown-linux-gnu.tar.gz +``` + +解压压缩包: + +```bash +# 替换 `/path/to/dragonfly` 为真实安装目录。 +tar -zxf client_dfget_x86_64-unknown-linux-gnu.tar.gz -C /path/to/dragonfly + +tar -zxf client_dfdaemon_x86_64-unknown-linux-gnu.tar.gz -C /path/to/dragonfly +``` + 配置环境变量: ```bash @@ -59,16 +83,30 @@ cd Dragonfly2 编译源码并安装二进制可执行程序: ```bash -# 同时构建 scheduler,dfget 以及 manager。 -make build +# 构建 manager scheduler +make build-manager && make build-scheduler -# make build 等同于 -make build-scheduler && make build-dfget && make build-manager - -# 安装二进制文件到 /opt/dragonfly/bin/{manager,scheduler,dfget} +# 安装二进制文件到 /opt/dragonfly/bin/{manager,scheduler} make install-manager make install-scheduler -make install-dfget +``` + +获取 Client 的源码: + +```bash +git clone --recurse-submodules https://github.com/dragonflyoss/client.git +cd client +``` + +编译源码并安装二进制可执行程序: + +```bash +# 构建 dfdaemon 和 dfget。 +cargo build --release --bins + +# 安装二进制文件到 /opt/dragonfly/bin/{dfget,dfdaemon} +mv target/release/dfget /opt/dragonfly/bin/dfget +mv target/release/dfdaemon /opt/dragonfly/bin/dfdaemon ``` 配置环境变量: @@ -86,7 +124,7 @@ export PATH="/opt/dragonfly/bin/:$PATH" 编辑配置文件 Linux 环境下默认 Manager 配置路径为 `/etc/dragonfly/manager.yaml`, Darwin 环境下默认 Manager 配置路径为 `$HOME/.dragonfly/config/manager.yaml`,参考文档 [Manager](../../reference/configuration/manager.md)。 -在 Manager 配置文件下设置 database.mysql.addrs 和 database.redis.addrs 地址为你的实际地址,配置内容如下: +在 Manager 配置文件下设置 database.mysql.addrs 和 database.redis.addrs 地址为你的实际地址,配置内容如下: ```yaml # Manager 配置。 @@ -185,24 +223,22 @@ telnet 127.0.0.1 8002 #### 启动 Dfdaemon 作为 Seed Peer -编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfget.yaml`, -Darwin 环境下默认 Dfdaemon 配置路径为 `$HOME/.dragonfly/config/dfget.yaml`,参考文档 [Dfdaemon](../../reference/configuration/dfdaemon.md)。 +编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfdaemon.yaml`, +Darwin 环境下默认 Dfdaemon 配置路径为 `$HOME/.dragonfly/config/dfdaemon.yaml`,参考文档 [Dfdaemon](../../reference/configuration/dfdaemon.md)。 + +在 Seed Peer 配置文件下设置 manager.addrs 地址为你的实际地址,配置内容如下: -在 Seed Peer 配置文件下设置 scheduler.manager.netAddrs.addr 地址为你的实际地址,配置内容如下: +> 注意: manager.addrs 必须是完整的URL。 ```yaml # Seed Peer 配置。 -scheduler: - manager: - enable: true - netAddrs: - - type: tcp - addr: dragonfly-manager:65003 - refreshInterval: 10m - seedPeer: - enable: true - type: super - clusterID: 1 +manager: + addrs: + - dragonfly-manager:65003 +seedPeer: + enable: true + type: super + clusterID: 1 ``` 把 Dfdaemon 当作 Seed Peer 运行: @@ -211,39 +247,37 @@ scheduler: # 查看 Dfget cli 帮助。 dfget --help -# 查看 Dfget daemon cli 帮助。 -dfget daemon --help +# 查看 Dfdaemon cli 帮助。 +dfdaemon --help -# 启动 Dfget daemon 模式。 -dfget daemon +# 启动 Dfdaemon 模式。 +dfdaemon ``` #### 验证 Seed Peer 是否在运行 -Seed Peer 部署完成之后,运行以下命令以检查 **Seed Peer** 是否正在运行,以及 `65000`,`65001` 和 `65002` 端口是否可用。 +Seed Peer 部署完成之后,运行以下命令以检查 **Seed Peer** 是否正在运行,以及 `4000`,`4001` 和 `4002` 端口是否可用。 ```bash -telnet 127.0.0.1 65000 -telnet 127.0.0.1 65001 -telnet 127.0.0.1 65002 +telnet 127.0.0.1 4000 +telnet 127.0.0.1 4001 +telnet 127.0.0.1 4002 ``` #### 启动 Dfdaemon 作为 Peer -编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfget.yaml`, -Darwin 环境下默认 Dfdaemon 配置路径为 `$HOME/.dragonfly/config/dfget.yaml`,参考文档 [Dfdaemon](../../reference/configuration/dfdaemon.md)。 +编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfdaemon.yaml`, +Darwin 环境下默认 Dfdaemon 配置路径为 `$HOME/.dragonfly/config/dfdaemon.yaml`,参考文档 [Dfdaemon](../../reference/configuration/dfdaemon.md)。 + +配置文件下设置 manager.addrs 地址为你的实际地址,配置内容如下: -配置文件下设置 scheduler.manager.netAddrs.addr 地址为你的实际地址,配置内容如下: +> 注意: manager.addrs 必须是完整的URL。 ```yaml # Peer 配置。 -scheduler: - manager: - enable: true - netAddrs: - - type: tcp - addr: dragonfly-manager:65003 - refreshInterval: 10m +manager: + addrs: + - dragonfly-manager:65003 ``` 把 Dfdaemon 当作 Peer 运行: @@ -252,19 +286,19 @@ scheduler: # 查看 Dfget cli 帮助。 dfget --help -# 查看 Dfget daemon cli 帮助。 -dfget daemon --help +# 查看 Dfdaemon cli 帮助。 +dfdaemon --help -# 启动 Dfget daemon 模式。 -dfget daemon +# 启动 Dfdaemon 模式。 +dfdaemon ``` #### 验证 Peer 是否在运行 -Peer 部署完成之后,运行以下命令以检查 **Peer** 是否正在运行,以及 `65000`,`65001` 和 `65002` 端口是否可用。 +Peer 部署完成之后,运行以下命令以检查 **Peer** 是否正在运行,以及 `4000`,`4001` 和 `4002` 端口是否可用。 ```bash -telnet 127.0.0.1 65000 -telnet 127.0.0.1 65001 -telnet 127.0.0.1 65002 +telnet 127.0.0.1 4000 +telnet 127.0.0.1 4001 +telnet 127.0.0.1 4002 ```