欢迎光临
我们一直在努力

CENTOS 7.X 架设XBT TRACKER服务器

自己的电驴网用的是linux服务器 需要架设种子系统 xbt tracker 因为之前是用的win系统 架设比较简单 linux 也是百度了很多才搭建成功,因为总是有一些错误出现

安装依赖环境

yum install boost-devel gcc-c++ mysql-devel subversion

获取xbt_tracker源码

cd /home
svn co https://svn.code.sf.net/p/xbtt/code/trunk/xbt/misc xbt/misc
svn co https://svn.code.sf.net/p/xbtt/code/trunk/xbt/Tracker xbt/Tracker
cd xbt/Tracker
./make.sh

如果出现command not found使用yum install svn -y安装svn

cp xbt_tracker /home/xbt_tracker/
cp xbt_tracker.conf.default /home/xbt_tracker/
cp xbt_tracker.sql /home/xbt_tracker/
cd /home/xbt_tracker/
mv xbt_tracker.conf.default xbt_tracker.conf

建立数据库

mysql -uroot -p密码
CREATE USER ‘xbt_tracker’@‘localhost’ IDENTIFIED BY ‘你的密码’;
GRANT USAGE ON * . * TO ‘xbt_tracker’@‘localhost’ IDENTIFIED BY ‘你的密码’;
CREATE DATABASE IF NOT EXISTS `xbt_tracker` ;
GRANT ALL PRIVILEGES ON `xbt_tracker` . * TO ‘xbt_tracker’@‘localhost’;

导入数据库&编辑conf文件

cd ../xbt/Tracker
mysql -u数据用户名 -p数据库密码 xbt_tracker < xbt_tracker.sql
cd ../xbt_tracker
vim xbt_tracker.conf

修改数据库连接设置

mysql_host = localhost #数据库地址
mysql_user = xbt_tracker #数据库用户名
mysql_password = qazzaq123 #数据库密码
mysql_database = xbt_tracker 数据库名

向数据库写入xbt_tracker的设置

mysql -u root -p 你的密码
use xbt_tracker
insert into xbt_config values (‘announce_interval’,’1800′);
insert into xbt_config values (‘anonymous_connect’,’1′);
insert into xbt_config values (‘anonymous_announce’,’1′);
insert into xbt_config values (‘anonymous_scrape’,’1′);
insert into xbt_config values (‘auto_register’,’1′);
insert into xbt_config values (‘clean_up_interval’,’60’);
insert into xbt_config values (‘daemon’,’1′);
insert into xbt_config values (‘debug’,’0′);
insert into xbt_config values (‘full_scrape’,’0′);
insert into xbt_config values (‘gzip_debug’,’1′);
insert into xbt_config values (‘gzip_scrape’,’1′);
insert into xbt_config values (‘listen_ipa’,’*’);
insert into xbt_config values (‘listen_port’,’2710′);
insert into xbt_config values (‘log_access ‘,’0’);
insert into xbt_config values (‘log_announce ‘,’0’);
insert into xbt_config values (‘log_scrape ‘,’0’);
insert into xbt_config values (‘offline_message’,”);
insert into xbt_config values (‘pid_file ‘,’xbt_tracker.pid’);
insert into xbt_config values (‘read_config_interval’,’60’);
insert into xbt_config values (‘read_db_interval’,’60’);
insert into xbt_config values (‘redirect_url’,”);
insert into xbt_config values (‘table_announce_log’,’xbt_announce_log’);
insert into xbt_config values (‘table_files’,’xbt_files’);
insert into xbt_config values (‘table_files_users’,’xbt_files_users’);
insert into xbt_config values (‘table_scrape_log’,’xbt_scrape_log’);
insert into xbt_config values (‘table_users’,”);
insert into xbt_config values (‘write_db_interval’,’15’);

启动xbt_tracker

./xbt_tracker

announce地址:http://localhost:2710/announce

状态查看地址:http://localhost:2710/statistics或者是http://localhost:2710/statis

ps 如果出现错误 请看有没有下面类似这些 按照修改一下 我也是这样做的

如果遇到下面的情况

/make.sh
  1. 在包含自 ../misc/sql/database.h:9 的文件中,
  2.                 从 server.h:10,
  3.                 从 connection.cpp:8:
  4. ../misc/sql/sql_result.h:14:25: 错误:mysql/mysql.h:没有那个文件或目录
  5. …….

这表示找不到你自己安装的Mysql,需要定义下数据库的地址

cd ../misc
  1. ln -s /usr/local/mysql/include/ mysql     //当然,mysql的地址要换成你自己的    
  2. cd ../XBT/Tracker
  3. ./make.sh

如果正常的话,这样就可以执行了。然后在Tracker目录下你会发现多出一个xbt_tracker的文件

运行这个文件

./xbt_tracker

如果出现了这个错误:

./xbt_tracker: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory

还是mysql问题,建立连接,如下:

cd /usr/lib/
  1. ln -s /usr/local/mysql/lib/mysql/libmysqlclient.so.15 libmysqlclient.so.15    //根据自己的数据库地址修改
  2. cd –
  3. ./xbt_tracker
赞(0)
未经允许不得转载:站长电台 » CENTOS 7.X 架设XBT TRACKER服务器
分享到: 更多 (0)

评论 5

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

    I simply want to mention I am all new to weblog and certainly loved your web-site. Probably I’m likely to bookmark your blog . You actually have wonderful stories. Appreciate it for sharing your website page.

  2. #2

    I was just looking for this info for some time. After six hours of continuous Googleing, at last I got it in your website. I wonder what is the lack of Google strategy that don’t rank this kind of informative websites in top of the list. Normally the top web sites are full of garbage.

  3. #3

    I’ve been surfing online greater than three hours these days, but I never found any attention-grabbing article like yours. It is beautiful price enough for me. In my opinion, if all website owners and bloggers made excellent content material as you probably did, the internet shall be much more useful than ever before.

  4. #4

    Hello there, just became aware of your blog through Google, and found that it’s really informative. I’m gonna watch out for brussels. I will be grateful if you continue this in future. A lot of people will be benefited from your writing. Cheers!

  5. #5

    Hello my loved one! I want to say that this article is awesome, great written and come with approximately all significant infos. I would like to see more posts like this .