This topic explains how to install the Dragonfly dfclient
.
Install the dfclient
in one of the following ways:
- Deploying with Docker.
- Deploying with physical machines.
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 |
You can get it from DockerHub directly.
-
Obtain the latest Docker image ID of the SuperNode.
docker pull dragonflyoss/dfclient:1.0.0
Or you can build your own dfclient image.
-
Obtain the source code of Dragonfly.
git clone https://github.com/dragonflyoss/Dragonfly.git
-
Enter the project directory.
cd Dragonfly
-
Build the Docker image.
TAG="1.0.0" make docker-build-client DF_VERSION=$TAG
-
Obtain the latest Docker image ID of the
dfclient
.docker image ls | grep 'dfclient' | awk '{print $3}' | head -n1
NOTE: You should prepare the config files which should locate under /etc/dragonfly
by default.
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
-
Download a binary package of the SuperNode. You can download one of the latest builds for Dragonfly on the github releases page.
version=1.0.0 wget https://github.com/dragonflyoss/Dragonfly/releases/download/v$version/Dragonfly_$version_linux_amd64.tar.gz
-
Unzip the package.
# Replace `xxx` with the installation directory. tar -zxf Dragonfly_1.0.0_linux_amd64.tar.gz -C xxx
-
Move the
dfget
anddfdaemon
to yourPATH
environment variable to make sure you can directly usedfget
anddfdaemon
command.
Or you can build your own dfclient executable files.
-
Obtain the source code of Dragonfly.
git clone https://github.com/dragonflyoss/Dragonfly.git
-
Enter the project directory.
cd Dragonfly
-
Build
dfdaemon
anddfget
.make build-client && make install-client
NOTE: You can ignore this step when using only dfget for file distribution .
# Replace ${supernode} with your own supernode node with format `ip:port=weight`.
SUPERNODE=$supernode
dfdaemon --node $SUPERNODE
Test if the downloading works.
dfget --url "http://${resourceUrl}" --output ./resource.png --node "127.0.0.1:8002"
And test dfdaemon by pulling an image.