Difference between revisions of "Centos6"

From DXSpider Documentation Wiki
Jump to: navigation, search
(package installation)
(package installation)
Line 42: Line 42:
  # yum install perl-TimeDate perl-Time-HiRes perl-Digest-SHA1 perl-Curses perl-Net-Telnet git gcc make
  # yum install perl-TimeDate perl-Time-HiRes perl-Digest-SHA1 perl-Curses perl-Net-Telnet git gcc make
Optionally you may wish to install the vim editor (extends vi editor features )
Optionally you may wish to install the vim editor (extends vi editor features ), NTP (network Time protocol to keep the system clock in sync )
#yum install vim ntpd
== configuring the user and group ==  
== configuring the user and group ==  

Revision as of 16:28, 14 March 2012



Installing Dxspider on centos version 6.x starting from a basic 'bare bones' server install that is up to date

Some notes before we begin. commands starting with


are carried out as the root user


are carried out as the sysop user

Selinux is by default enabled and there is no need to disable it for running DXspider

to update the system use yum

#yum update

package installation

as the root user install the addtional package repository EPEL, this is required for perl-Curses

see http://fedoraproject.org/wiki/EPEL/FAQ#What_is_EPEL.3F

instructions here


as of 2012/03/12 the command is

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

install needed packages

# yum install perl-TimeDate perl-Time-HiRes perl-Digest-SHA1 perl-Curses perl-Net-Telnet git gcc make

Optionally you may wish to install the vim editor (extends vi editor features ), NTP (network Time protocol to keep the system clock in sync )

#yum install vim ntpd

configuring the user and group

Now create the sysop user

# adduser -m sysop
# passwd sysop

Choose a strong password here!

yes I know that /home/sysop/spider we are about to link to does not exist yet but the plan is to use git to pull it in as the sysop user a bit later and I am root right now and doing it in this order does not break anything.

# ln -s ~sysop/spider /spider

before adding the spider group it is advisable to check that group # 251 is not already in use

# cat /etc/group |grep 251

Which should produce no output, if 251 is already assigned to a group choose a different group Number here, On Redhat based distributions Group numbers below 500 are assigned to system services so choose a free group number below 500

# groupadd -g 251 spider

Use the following commands to add the users to the spider group

# usermod -aG spider sysop
# usermod -aG spider root 

getting the latest version of DXSpider

Change to user sysop

# su - sysop

use git to get latest DXspider build

$ git clone git://scm.dxcluster.org/scm/spider

Fix up permissions (AS THE SYSOP USER )

Very bad things happen if you run these as root and in the wrong place, so I wish to make it abundantly clear that these are to be run as the sysop user in the sysop's home directory /home/sysop

$ chown -R sysop.spider spider
$ find . -type d -exec chmod 2775 {} \;
$ find . -type f -exec chmod 775 {} \;

Cluster configuration

We are installed, now to configure the cluster

$ cd /spider
$ mkdir local
$ mkdir local_cmd
$ cp perl/DXVars.pm.issue local/DXVars.pm
$ cd local
$ vi DXVars.pm (or your favourite editor)

Using the distributed DXVars.pm as a a template, set your cluster callsign, sysop callsign and other user info to suit your own environment.

$mycall = "GB7DJK";     

This is the call sign of your cluster. Here in the UK we have separate callsigns for our cluster nodes. If you can't use a different callsign I suggest you use an SSID of '-2' for the node callsign '$mycall'.

$myalias = "G1TLH";

This is the sysop user callsign, normally your own.


Note that this a perl file which will be parsed and executed as part of the cluster. If you get it wrong then perl will complain when you start the cluster process. It is important only to alter the text of any section. Some of the lines look a little odd. Take this line for example ....

$myemail = "ianmaude\@example.com";

There appears to be an extra slash in there. However this has to be there for the file to work so leave it in.

DON'T alter any file in /spider/perl, they are overwritten with every release. Any files or commands you place in /spider/local or /spider/local_cmd will automagically be used in preference to the ones in /spider/perl EVEN while the cluster is running!

Save the new file and change directory to ../perl ....

$ cd ../perl

Now type the following command which creates the basic user file with you as the sysop.

$ ./create_sysop.pl

Compile the Client program

$cd /spider/src

Internet access

Now set up your cluster so that it is avalable from the internet

you need to copy the file /spider/perl/Listeners.pm to /spider/local and then edit it. You will need to uncomment the line containing "" and select the correct port to listen on.

$ cp /spider/perl/Listeners.pm  /spider/local/

edit /spider/local/Listeners.pm

It comes out of the box looking something like:-

 @listen = (
#    ["", 7300],

Change it so that it looks like this:-

 @listen = (
   ["", 7300],

Later versions have more comments in the Listeners.pm file that are designed to help you remove the correct '#' character.

As standard, the listener will listen on all interfaces simultaneously. If you require more control than this, you can specify each interface individually:-

 @listen = (
   ["gb7baa.dxcluster.net", 7300],
   ["", 6300],

This will only be successful if the IP addresses on each interface are static. If you are using some kind of dynamic IP addressing then the 'default' method is the only one that will work.

Restart the cluster.pl program to enable the listener.

firewall configuration

This might be a good time to modify the default firewall to allow connections to the cluster on port 7300 (or other port of your choosing)

as root edit /etc/sysconfig/iptables add the line

-A INPUT -m state --state NEW -m tcp -p tcp --dport 7300 -j ACCEPT

Just after the line permitting ssh on port 22

restart iptables

#service iptables restart

service configuration Centos 6.x

whilst you are still root, now might be a good time to configure the cluster to auto-start In this regard there are differences between the way that centos 5.x and 6.x handle startups

6.x uses upstart so we need to create an upstart configuration

create the following file /etc/init/dxspider.conf

# This service kicks off the DXspider cluster 

start on stopped rc RUNLEVEL=[3]
stop on starting runlevel [016]

respawn limit 10 5
exec /bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7

now start the cluster

#start dxspider

Should you need to stop it

#stop dxspider 

will do the trick

service configuration Centos 5.x

On centos 5.x (and older) we use inittab to launch the dxcluster service on boot

edit /etc/inittab

add the following line at the end

DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7

now launch the cluster by reloading init

#telinit q

change back to the sysop user

#su - sysop

Cluster Peers

create a connect script to connect to your peer node(s)

to do this create a new connect script for your chosen peer in /spider/connect/ One entry per peer

$cd /spider/connect

Next create a connect script to bring up connections, here I use the vi editor but you can also use nano

$vi ei7mre

my script looks like this, be sure to change the connect line to telnet to you peer node and the 'Login' line to your own cluster callsign

timeout 15
connect  telnet mayodx.ath.cx 7300
'Login' 'ei7tst'

now use the cluster console to set up the peer node as a dxspider node

$ /spider/perl/console.pl


set/spider <peer call as used for connect script>

(in my exmaple: set/spider ei7mre ) now connect

connect ei7mre


Tidying up

you will want your cluster to automatically connect to your peer node(s)

create a file called crontab in /spider/local_cmd

$cd /spider/local_cmd

with an entry like

* * * * * start_connect('ei7mre') unless connected('ei7mre')

This will casue the cluster to attemt to connect to ei7mre unless already connected, once per minute using the connect script file that was created earlier

Other things

run the NTP service to keep the clock accurate

# chkconfig ntpd on
# service ntpd start

you can check all is well by querying the NTP service

#ntpdc -pn