静看光阴荏苒
不管不顾不问不说也不念

使用OpenTracker自建高性能Tracker服务器

Tracker服务器是在BT协议中必不可少的一部分,一个BT种子想要正常工作,必须要有Tracker服务器的支持。

我在网上翻找了半天,想了解一下关于搭建Tracker服务器这方面的资料,但是搜索出来的文章和信息实在太老旧了,有些文章里面提到的软件和环境官网都打不开。。。

不过经过我的一番努力,我找到了一个工具:OpenTracker。官网:http://erdgeist.org/arts/software/opentracker/

就目前的情况而言,这个工具可以说是最优秀的了,据说性能也非常好,可以用在生产环境。我昨天也试着制作了一个种子进行测试,目前表现良好。

下面是OpenTracker在CentOS7上的搭建教程。

安装EPEL:

yum -y install epel-release

安装开发工具包:

yum -y groupinstall "Development Tools"

安装编译所需依赖:

yum -y install openssl-devel zlib-devel

我将OpenTracker的源码上传到博客中,因为个人不是很喜欢官方的下载方式:

libowfat.tar

opentracker.tar

在终端内下载源码并解压:

cd ~
wget https://lala.im/wp-content/uploads/2018/09/libowfat.tar.gz
wget https://lala.im/wp-content/uploads/2018/09/opentracker.tar.gz
tar -xzvf libowfat.tar.gz
tar -xzvf opentracker.tar.gz

先编译libowfat:

cd libowfat
make

然后再编译opentracker:

cd ..
cd opentracker
make

完成之后,我们将二进制文件移动到/usr/bin:

cp opentracker /usr/bin

然后写一个服务文件:

vi /usr/lib/systemd/system/opentracker.service

写入:

[Unit]
Description=opentracker server
    
[Service]
User=root
ExecStart=/usr/bin/opentracker -p 1337 -P 1337
Restart=on-abort
    
[Install]
WantedBy=multi-user.target

注:

1.我这里监听的端口是1337,这个端口可以自行更改,并且opentracker支持同时监听多端口。

2.-p(小写p)指TCP端口,-P(大写P)指UDP端口。

设置开机启动并立即运行:

systemctl enable opentracker.service
systemctl start opentracker.service

其他管理命令:

systemctl status opentracker.service
systemctl stop opentracker.service
systemctl restart opentracker.service

制作种子的时候,我们添加Tracker服务器时,可以这么写:

http://你的服务器公网IP:1337/announce

或者:

udp://你的服务器公网IP:1337/announce

当然也可以同时添加http和udp,这个不受影响。

OpenTracker还有一个自带的统计功能:

http://你的服务器公网IP:1337/stats

更详细的统计信息访问:

http://你的服务器公网IP:1337/stats?mode=everything

赞(7)
未经允许不得转载:荒岛 » 使用OpenTracker自建高性能Tracker服务器
分享到: 更多 (0)

评论 25

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    沙发

    ixuner6年前 (2018-09-09) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 7 x64 Edition Windows 7 x64 Edition回复
  2. #2

    二楼

    瞎折腾6年前 (2018-09-09) Google Chrome 68.0.3440.91 Google Chrome 68.0.3440.91 Android 6.0.1 Android 6.0.1回复
  3. #3

    http://103.27.187.165:1337/announce
    按lala说的造了一个
    哪位老铁试试看- -哈哈 :cry: :wink:

    凸凸酱6年前 (2018-09-09) Google Chrome 55.0.2883.87 Google Chrome 55.0.2883.87 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 做个巨J8骚气的种子出来,绝对有一堆人抢着帮你测试,你懂的~

      LALA6年前 (2018-09-10) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
  4. #4

    已经做了个Docker镜像,要不要水篇教程 :cool:

    Rat's6年前 (2018-09-10) Google Chrome 63.0.3239.132 Google Chrome 63.0.3239.132 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 药药药 :neutral:

      LALA6年前 (2018-09-11) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
  5. #5

    这一步编译出错了 应该怎么解决呢
    [root@181199 opentracker]# make
    cc -o opentracker opentracker.o trackerlogic.o scan_urlencoded_query.o ot_mutex.o ot_stats.o ot_vector.o ot_clean.o ot_udp.o ot_iovec.o ot_fullscrape.o ot_accesslist.o ot_http.o ot_livesync.o ot_rijndael.o -L../libowfat -lowfat -pthread -lpthread -lz
    ../libowfat/libowfat.a(socket_accept6.o): In function `socket_accept6′:
    socket_accept6.c:(.text+0x7b): undefined reference to `__builtin_bswap16′
    socket_accept6.c:(.text+0xee): undefined reference to `__builtin_bswap16′
    ../libowfat/libowfat.a(socket_recv6.o): In function `socket_recv6′:
    socket_recv6.c:(.text+0xa9): undefined reference to `__builtin_bswap16′
    socket_recv6.c:(.text+0x125): undefined reference to `__builtin_bswap16′
    ../libowfat/libowfat.a(socket_send6.o): In function `socket_send6_flag’:
    socket_send6.c:(.text+0xb7): undefined reference to `__builtin_bswap16′
    ../libowfat/libowfat.a(socket_bind6.o):socket_bind6.c:(.text+0xa0): more undefined references to `__builtin_bswap16′ follow
    collect2: ld returned 1 exit status
    make: *** [opentracker] Error 1

    木风6年前 (2018-10-31) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 7 x64 Edition Windows 7 x64 Edition回复
  6. #6

    ../libowfat/libowfat.a(socket_bind6.o):socket_bind6.c:(.text+0xa0): more undefined references to `__builtin_bswap16′ follow
    collect2: ld returned 1 exit status
    make: *** [opentracker] Error 1
    make :cry: 出现上面的错误 求解

    木风6年前 (2018-10-31) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 评论里面说不清楚,你要是愿意的话+右下角QQ,发SSH信息给我上去帮你看下。

      LALA6年前 (2018-11-01) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • :grin: 右下角好像已经没有QQ了,哈哈.还说想请教老乡几个问题的.

        CaiBao4年前 (2020-07-18) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  7. #7

    ./opentracker
    这个命令之后就一直没有任何反应是什么情况,求解

    1115年前 (2019-01-13) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 没有任何日志或者截图我也不知道你遇到了什么问题,如果实在不行,试试这个?https://lala.im/4630.html
      文末有已经编译好的二进制文件,下载就能用了。

      LALA5年前 (2019-01-13) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 参照你写的教程,我成功过运行编辑好的opentracker了。但是有两个问题:
        1 tracker复制到BT 客户端没有效果;
        2 通过网络端也不能查看stats。如果你方便的话,我们邮件联系吧,我把服务器信息发给你。可以有偿。
        3 herwidget@outlook.com

        1115年前 (2019-01-13) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
  8. #8

    make等其他都是成功了

    1115年前 (2019-01-13) Google Chrome 71.0.3578.98 Google Chrome 71.0.3578.98 Windows 10 x64 Edition Windows 10 x64 Edition回复
  9. #9

    谢谢大大, 以经按教程成功设置。 要是能把:1337/announce 去掉就好了

    yavg5年前 (2019-04-26) Google Chrome 73.0.3683.103 Google Chrome 73.0.3683.103 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 这个不能去掉。。tracker服务器的地址都是这种命名规范。。

      LALA5年前 (2019-04-26) Google Chrome 72.0.3626.121 Google Chrome 72.0.3626.121 Windows 10 x64 Edition Windows 10 x64 Edition回复
  10. #10

    lala大佬OpenTracker说可以支持集群不知道怎么个集群法谷歌搜索OpenTracker 集群 :cry: :cry: :cry: 请求您能写一篇关于集群的文章可以吗有备无患 :smile: :smile: :smile:

    白墨5年前 (2019-04-26) Google Chrome 72.0.3626.105 Google Chrome 72.0.3626.105 Android 9 Android 9回复
    • 。。这个还有集群一说?这个随便放一台VPS都能抗几十上百万个种子了。。

      LALA5年前 (2019-04-26) Google Chrome 72.0.3626.121 Google Chrome 72.0.3626.121 Windows 10 x64 Edition Windows 10 x64 Edition回复
  11. #11

    您好,我用这个配置来配置反代以支持IPV6,但opentracker貌似不能正常获取用户IP,请问opentracker或者nginx应该怎么配置呢?
    server {
    listen [::]:80;
    server_name ipv6-tracker.rxxx.com;

    location / {
    proxy_pass http://127.0.0.1:3389/;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    }

    寒夜方舟3年前 (2021-05-17) Google Chrome 90.0.4430.212 Google Chrome 90.0.4430.212 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 抱歉,这个我也没配置过,但是单纯看你的nginx配置应该是没问题的,具体问题可能需要你自己排查一下了。。

      LALA3年前 (2021-05-20) Google Chrome 86.0.4240.198 Google Chrome 86.0.4240.198 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿