The week before the break, Alon R at Azureus Inc. came in to help us redo our Bit Torrent servers. It all went pretty well. Working together it took us only a couple of days to implement a more simplified seeder and tracker network at Sun.

The main goal that we were trying to accomplish was to simplify authoring/management of torrents. I have described the original implementation a while ago. The authoring piece was a mess, because it required remote displaying Azureus from a remote data center. All in all the process was perhaps 15 steps. Not something that could be handed off to a support team very easily.

The other major requirements of the environment included

  • High Availability - both the seeders and more importantly the tracker needed to run on multiple machines and fail over automatically.
  • Geographical Location Screening - (aka rDNS) we needed to make sure that people from embargoed countries were denied access.
  • Simple remote administration - the most preferable would be the web

All in all it went together pretty quickly. I threw a couple of curves at Alon, most notably, being able to fail over the tracker to a secondary box, but he was able to get patches from the developers overnight to allow for it.

We did encounter a strange problem when we attempted to fire up Azureus on the first server, we received a ton of Exceptions with stacktraces of the form

java.io.IOException: Invalid argument
        at sun.nio.ch.DevPollArrayWrapper.poll0(Native Method)
        at sun.nio.ch.DevPollArrayWrapper.poll(DevPollArrayWrapper.java:158)
        at sun.nio.ch.DevPollSelectorImpl.doSelect(DevPollSelectorImpl.java:68)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:84)

We we're both perplexed. I know I had run Azureus on Solaris 10 before and not seen the problem. And it was a new one to Alon as well. I decided to look on bugs.sun.com for lack of anything else to try. Low and behold, I found the problem. The bug 6322825 Selector fails with invalid argument on Solaris 10. And the bug had a work around. Just set the maximum number of file descriptors on the process over 8K. Once I did that, it fired up like a charm.

After that, the only other major task was to hook into our rDNS provider. From my description, Alon thought we could write a plugin, and again, talked to the developers who provide us a shell of a plugin. All I needed to do was add about 10-20 lines of code which actually did the screening query with the provider.

In the end, the network consists of three servers, a Master Tracker and two Seeders.

The Master Tracker is configured to watch a particular folder for new and removed files. When it finds changes, it automatically creates torrents for the files and starts seeding them. It also copies the .torrent files to a separate folder within the web servers docroot for customers to access.

The two Seeders, watch an RSS feed provided by the Master Tracker. The RSS feed contains a list of all the torrents the Master is seeding. When the seeders detect a change to the RSS feed, they act appropriately. If its a new torrent, they download it from the Master and start seeding it. If if a torrent is removed, they remove it from themselves as well.

Now, authoring a torrent is a easy a rsync'ing, scp'ing or sftp'ing a file over to the Master Seeder and voila.

Comments:

Any clue as to how I can find the bittorrent on a Solaris 10 system and disable it? I can see the port in use at 6881, but I cant find it in legacy or svcs -a or in pkginfo of in ps -ef.

Posted by Charles Cushing on September 07, 2006 at 06:45 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by mock