Ubuntu 24.04: Difference between revisions

From DXSpider Documentation Wiki
Jump to navigation Jump to search
G1FEF (talk | contribs)
No edit summary
G0TRT (talk | contribs)
m Removed the forward slash from connect/ <peer-node>
Line 126: Line 126:
Now it’s time to connect and see if things are working.
Now it’s time to connect and see if things are working.


  connect/<peer-node>
  connect <peer-node>


If all is good you should see spots start arriving.
If all is good you should see spots start arriving.
Line 149: Line 149:
  #
  #


Further help on crontab scheduling can be found here [https://crontab.guru/ ]
Further help on crontab scheduling can be found here [https://crontab.guru/]


Now we will install the systemd service file for the dxpsider service and enable it.
Now we will install the systemd service file for the dxpsider service and enable it.

Revision as of 11:02, 19 February 2025

Installing dxspider 'mojo' branch on Ubuntu 22.04

Prerequisites

A stock install of Ubuntu server edition, install the standard version, not the light version. The default settings are fine and no extra packages are required at install time.

As part of the standard install you will be asked to create a user account on the system, choose strong passwords.

This is the account that you will use to manage the Ubuntu server and will have sudo privileges. Dxspider does not require sudo access and you will create a separate 'sysop' account for dxspider to use as part of the installation.

Enable ssh as you will require this for administration.

In these notes command executed as root are prefixed with #

Commands executed as the user ‘sysop’ are prefixed with $

At various points during the installation text files will need to be edited at the command line, 'nano' and 'vim' are both choices built into the stock Ubuntu server install. If you do not already have a familiarity with vim, nano is probably the choice you want.

Download the latest Ubuntu server install image from here Ubuntu

Installation

Login as the user you created at install time and become root.

$ sudo su -

Create the sysop user & group , this is the user that the dxcluster will run as.

# adduser sysop

Add your normal login user to the sysop group, this allows the normal login user to interact with the cluster via the ‘dx’ command etc.

  • Note however the sysop user must be used for administration involving file system access such as the creation of new connection scripts, git updates etc.
# usermod -a -G sysop <login_user>

Install packages that will be required for dxspider, we are going to go directly to mojo branch. All the packages required are in the apt packaging system so we shall install from there.

# apt install procps git build-essential libtimedate-perl libnet-telnet-perl libdigest-sha-perl libdata-structure-util-perl libmojo-ioloop-readwriteprocess-perl libjson-perl gcc libmath-round-perl libnet-cidr-lite-perl libcurses-perl libdbi-perl cpanminus

You will also need to ensure that you have the Perl library for the database you intend using, e.g. for SQLite:

apt install libdbd-sqlite3-perl

or for MySQL / MariaDB:

apt install libdbd-mysql-perl

We will make some links now, whilst we are still root.

# ln -s /home/sysop/spider /spider
# ln -s /spider/perl/console.pl /usr/local/bin/dx
# ln -s /spider/perl/*dbg /usr/local/bin

Now would also be a very good time to consider one’s firewall requirements, for example:

# ufw allow 7300/tcp
# ufw allow ssh
# ufw enable

We have done everything we need to do for now as the root user, for the rest of the install we will be the user “sysop”

change to the sysop user

# su - sysop


We want to install dxspider, Mojo branch.

$ git clone -b mojo  git://scm.dxcluster.org/scm/spider

Change into the newly created spider directory.

$ cd spider

Make our local directories.

$ mkdir local_cmd
$ mkdir local_data
$ mkdir local

Configure DXvars, this is where the parameters for the cluster are defined.

$ cp perl/DXVars.pm.issue local/DXVars.pm

Edit local/DXVars.pm to define the various parameters that are appropriate for your cluster.

$ cp perl/Listeners.pm local/

Edit local/Listeners.pm and follow instructions, generally if you do have a static ipv6 address it’s worth configuring for dual stack these days, however before you will see ipv6 users you will also need to ensure that you have the appropriate AAAA DNS record in place for the v6 address of your dxcluster.

Create a connect script to connect to your peer node(s).

$ cd /spider/connect/
$ cp gb7tlh <peer-node>

Edit this file with your chosen editor so that the telnet address and port are correct for your peer node(s) and set your own node callsign.

We need to build from source the client program

$ cd /spider/src
$ make

You should see this complete with no errors and how have an executable file called client.

Change to the base spider directory

$ cd /spider

Now we need to set up the sysop user for dxpsider, this is based on the configuration in /spider/local/DXVars.pm and you will need to rerun this command if you change details pertaining to the sysop.

$ perl/create_sysop.pl

Run the cluster

$ perl/cluster.pl

Assuming there are no errors, it will start up.

Now it’s time to connect to the node and check that it’s working ok. Open a second ssh session to your server and become sysop.

$ sudo su - sysop

Issue the ‘dx’ command to access the dxcluster administration console.

$ dx 

We need to tell the node the callsign (including any SSID) of it’s peer node(s), this has to be done both ends so you will need to have agreement in place with other node(s) you wish to peer with.

set/spider <peer-node> 

Now it’s time to connect and see if things are working.

connect <peer-node>

If all is good you should see spots start arriving. At this point you may wish to confirm remote telnet access is working also.

Time to tidy up the installation and set up dxspider to start as a service, exit the console by issuing the ‘bye’ command.

bye

Firstly, as the user sysop we will set up the dxpsider crontab file. This controls things that dxpsider should do on a regular schedule, like check that it is connected to upstream nodes, update databases etc.

$ cd /spider/local_cmd/

now use an editor to create a file called crontab.

$ vim crontab

With the contents below (replacing <peer-node> with the call of the upstream peer node). This will set up a simple schedule that will check very minute to see if the node is connected to it’s peer, if not connection will be attempted.

# Dxspider crontab file 
# m h dm m dw 
* * * * * start_connect('<peer-node>') unless connected('<peer-node>')
#

Further help on crontab scheduling can be found here [1]

Now we will install the systemd service file for the dxpsider service and enable it.

We must become root, however since the sysop user does not have sudo privileges, we will first have to drop back to our login user.

sysop@ei7mre-2:~$ exit
bminish@ei7mre-2:~$ sudo su -
[sudo] password for bminish:  
root@ei7mre-2:~#

Now we will copy the service file to /etc/systemd/system/

# cp /spider/dxspider.service /etc/systemd/system/

And start the service

# systemctl start dxspider.service

On some systems it may also need enabling

# systemctl enable dxspider.service

Become the sysop user

#  su - sysop 

Verify the cluster is running by opening the admin console

$ dx