Skip to main content
Version: v2.1.x

Binaries

This guide shows how to install the Dragonfly. Dragonfly can be installed either from source, or from pre-built binary releases.

Prerequisites

NameVersionDocument
Git1.9.1+git-scm
Golang1.16.xgo.dev
DatabaseMysql 5.6+ OR PostgreSQL 12+mysql OR postgresql
Redis3.0+redis.io

Installing Dragonfly

From the Binary Releases

Every release of Dragonfly provides binary releases for a variety of OSes. These binary versions can be manually downloaded and installed.

Download the Dragonfly binaries:

Notice: your_version is recommended to use the latest version.

VERSION=<your_version>
wget -O dragonfly_linux_amd64.tar.gz https://github.com/dragonflyoss/Dragonfly2/releases/download/v${VERSION}/dragonfly-${VERSION}-linux-amd64.tar.gz

Untar the package:

# Replace `/path/to/dragonfly` with the installation directory.
tar -zxf dragonfly_linux_amd64.tar.gz -C /path/to/dragonfly

Configuration environment:

export PATH="/path/to/dragonfly:$PATH"

From Source

Clone the source code of Dragonfly:

git clone --recurse-submodules https://github.com/dragonflyoss/Dragonfly2.git
cd Dragonfly2

Compile the source code:

# At the same time to build scheduler, dfget and manager.
make build

# make build is equivalent to
make build-scheduler && make build-dfget && make build-manager

# Install executable file to /opt/dragonfly/bin/{manager,scheduler,dfget}.
make install-manager
make install-scheduler
make install-dfget

Configuration environment:

export PATH="/opt/dragonfly/bin/:$PATH"

Operation

Manager

Startup Manager

Configure Manager yaml file, The default path in Linux is /etc/dragonfly/manager.yaml in linux, The default path in Darwin is $HOME/.dragonfly/config/manager.yaml, refer to Manager.

Set the database.mysql.addrs and database.redis.addrs addresses under the configuration file to your actual addresses. Configuration content is as follows:

# Manager configuration.
database:
type: mysql
mysql:
user: dragonfly-mysql
password: your_mysql_password
host: your_mysql_host
port: your_mysql_port
dbname: manager
migrate: true
redis:
addrs:
- dragonfly-redis
masterName: your_redis_master_name
username: your_redis_username
password: your_redis_passwprd
db: 0
brokerDB: 1
backendDB: 2

Run Manager:

# View Manager cli help docs.
manager --help

# Startup Manager.
manager

Verify

After the Manager deployment is complete, run the following commands to verify if Manager is started, and if Port 8080 and 65003 is available.

telnet 127.0.0.1 8080
telnet 127.0.0.1 65003

Manager Console

Now you can open brower and visit console by localhost:8080, Console features preview reference document console preview.

manager-console

Scheduler

Startup Scheduler

Configure Scheduler yaml file, The default path in Linux is /etc/dragonfly/scheduler.yaml in linux, The default path in Darwin is $HOME/.dragonfly/config/scheduler.yaml, refer to Scheduler.

Set the database.redis.addrs and manager.addr addresses manager. under the configuration file to your actual addresses. Configuration content is as follows:

# Scheduler configuration.
database:
redis:
addrs:
- dragonfly-redis
masterName: your_redis_master_name
username: your_redis_username
password: your_redis_password
brokerDB: 1
backendDB: 2
networkTopologyDB: 3
manager:
addr: dragonfly-manager:65003
schedulerClusterID: 1
keepAlive:
interval: 5s

Run Scheduler:

# View Scheduler cli help docs.
scheduler --help

# Startup Scheduler.
scheduler

Verify

After the Scheduler deployment is complete, run the following commands to verify if Scheduler is started, and if Port 8002 is available.

telnet 127.0.0.1 8002

Dfdaemon

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, refer to Dfdaemon.

Set the scheduler.manager.netAddrs.addr address in the configuration file to your actual address. Configuration content is as follows:

# Seed Peer configuration.
scheduler:
manager:
enable: true
netAddrs:
- type: tcp
addr: dragonfly-manager:65003
refreshInterval: 10m
seedPeer:
enable: true
type: super
clusterID: 1

Run Dfdaemon as Seed Peer:

# View Dfget cli help docs.
dfget --help

# View Dfget daemon cli help docs.
dfget daemon --help

# Startup Dfget daemon mode.
dfget daemon

Verify

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.

telnet 127.0.0.1 65000
telnet 127.0.0.1 65001
telnet 127.0.0.1 65002

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, refer to Dfdaemon.

Set the scheduler.manager.netAddrs.addr address in the configuration file to your actual address. Configuration content is as follows:

# Peer configuration.
scheduler:
manager:
enable: true
netAddrs:
- type: tcp
addr: dragonfly-manager:65003
refreshInterval: 10m

Run Dfdaemon as Peer:

# View Dfget cli help docs.
dfget --help

# View Dfget daemon cli help docs.
dfget daemon --help

# Startup Dfget daemon mode.
dfget daemon

Verify

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.

telnet 127.0.0.1 65000
telnet 127.0.0.1 65001
telnet 127.0.0.1 65002