使用BT协议构建软件快速分发系统(可用于Linux内网快速分发文件)

此处我们主要使用的工具为opentracker和ctorrent,主要服务分为以下几种:

  • Tracker服务器(使用opentracker)
  • 种子提供者和初始上传者(ctorrent做种)
  • 下载服务器(ctorrent做下载客户端)

安装工具

1. 安装opentracker

打开http://erdgeist.org/arts/software/opentracker/#overview
参照以下编译安装:

cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat
cd libowfat
make
cd ..
# LEGACY: cvs -d:pserver:anoncvs@cvs.erdgeist.org:/home/cvsroot co opentracker
git clone git://erdgeist.org/opentracker
cd opentracker
make

如果缺少gcc和cvs等工具请自行安装

2. 安装ctorrent
apt install ctorrent -y

配置和开启服务

1. 配置opentracker

将源码中的opentracker.conf.example拷贝到/etc/opentracker.conf,根据需要编辑

2. 开启tracker服务器
opentracker -f /etc/opentracker.conf

默认是6969端口
可以查看的地址包括:

http://trackerip:port(6969)/announce
http://trackerip:port(6969)/scrape
http://trackerip:port(6969)/stats
http://trackerip:port(6969)/stats?mode=everything

上述地址包括了tracker服务器的详细运行信息

3. 制作torrent种子
ctorrent -t -u "http://trackerip:port(6969)/announce" -s yourfile.tgz.torrent yourfile.tgz
4. 启动初始上传服务

让制作的种子和文件存在于同一文件夹中,开启服务之后就会自动做种

ctorrent yourfile.tgz.torrent
5. 启动其他的下载客户端

在其他机器上安装ctorrent,并拷贝torrent文件,种子文件比较小,可以自由分发,然后启动下载,下载完毕后会自动开启上传

ctorrent yourfile.tgz.torrent

其他参考内容:
https://www.jianshu.com/p/63818466fce3

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值