This topic explains how to install the Dragonfly server with Golang version.
NOTE: The Golang version supernode is not ready for production usage. However, you can use it more easily in your test environment.
Install the SuperNodes in one of the following ways:
- Deploying with Docker: Recommended for quick local deployment and test.
- Deploying with physical machines: Recommended for production usage.
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 |
| Nginx | 0.8+ |
You can get it from DockerHub directly.
-
Obtain the latest Docker image ID of the SuperNode.
docker pull dragonflyoss/supernode:0.4.3
Or you can build your own supernode 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="0.4.3" make docker-build-supernode DF_VERSION=$TAG
-
Obtain the latest Docker image ID of the SuperNode.
docker image ls|grep 'supernode' |awk '{print $3}' | head -n1
NOTE: Replace ${supernodeDockerImageId} with the ID obtained at the previous step.
docker run -d --name supernode --restart=always -p 8001:8001 -p 8002:8002 -v /home/admin/supernode:/home/admin/supernode dragonflyoss/supernode:0.4.3 --download-port=8001
or
docker run -d --name supernode --restart=always -p 8001:8001 -p 8002:8002 -v /home/admin/supernode:/home/admin/supernode ${supernodeDockerImageId} --download-port=8001-
Obtain the source code of Dragonfly.
git clone https://github.com/dragonflyoss/Dragonfly.git
-
Enter the project directory.
cd Dragonfly -
Compile the source code.
make build-supernode && make install -
Start the SuperNode.
supernode --home-dir=/home/admin/supernode --port=8002 --download-port=8001
-
Add the following configuration items to the Nginx configuration file.
server { listen 8001; location / { # Must be ${supernode.baseHome}/repo root /home/admin/supernode/repo; } } -
Start Nginx.
sudo nginx
-
After the SuperNode is installed, run the following commands to verify if Nginx and Supernode are started, and if Port
8001and8002are available.telnet 127.0.0.1 8001 telnet 127.0.0.1 8002
-
Install the Dragonfly client and test if the downloading works.
dfget --url "http://${resourceUrl}" --output ./resource.png --node "127.0.0.1:8002"