create new prefix_data.pl file
[spider.git] / UPGRADE.mojo
1 There are the notes for upgrading to the mojo branch.
2
3 There is NO POINT in doing this at the moment unless you are running a node with many (>50)
4 users. It is the future, but at the moment I am testing larger and larger installations to
5 check that it a) still works as people imagine it should and b) it provides the improvement
6 in scaling that I am anticipating. There are no significant new features - yet. 
7
8 The BIG TICKET ITEM in this branch is that (potentially) "long lived" commands such as sh/dx
9 and commands that poll external internet resources now don't halt the flow of data through
10 the node. I am also using a modern, event driven, web socket "manager" called Mojolicious
11 which is considerably more efficient than what went before (but is not necessary for small
12 nodes). There are some 200-400 user nodes out there that will definitely see the difference
13 in terms of both CPU usage and general responsiveness. Using Mojolicious also brings the
14 tantalising possibility of grafting on a web frontend, as it were, to the "side" of a
15 DXSpider node. But serious work on this won't start until we have a stable base to work
16 on. Apart from anything else there will, almost certainly, need to be some internal data
17 structure reorganisation before a decent web frontend could be constructed.
18
19 Upgrading is not for the faint of heart. There is no installation script (but there
20 will be) so, for the time being, you need to do some manual editing. Also, while there is
21 a backward path, it will involve moving various files from their new home (/spider/local_data),
22 back to where they came from (/spider/data).
23
24 Prerequisites:
25
26         A supply of good, strong tea - preferably in pint mugs. A tin hat, stout boots, a
27         rucksack with survival rations and a decent miners' lamp might also prove comforting. I
28         enclose this link: http://www.noswearing.com/dictionary in case you run out of swear words.
29
30         An installed and known working git based installation. Mojo is not supported under CVS or
31         installation from a tarball. 
32
33         perl 5.10.1, preferably 5.14.1 or greater. This basically means running ubuntu 12.04 or
34         later (or one of the other linux distros of similar age or later). The install instructions are
35         for debian based systems. IT WILL NOT WORK WITHOUT A "MODERN" PERL. Yes, you can use
36         bleadperl if you know how to use it and can get it to run the node under it as a daemon
37         without resorting the handy URL supplied above. Personally, I wouldn't bother. It's
38         easier and quicker just to upgrade your linux distro. Apart from anything else things like ssh
39         ntpd are broken on ALL older systems and will allow the ungodly in more easily than something
40         modern.
41
42 Install cpamminus:
43
44         sudo apt-get install cpanminus
45 or
46     wget -O - https://cpanmin.us | perl - --sudo App::cpanminus
47 or
48         sudo apt-get install curl
49         curl -L https://cpanmin.us | perl - --sudo App::cpanminus
50
51 You will need the following CPAN packages:
52
53         sudo cpanm EV Mojolicious Mojo::IOLoop::ForkCall JSON JSON::XS
54         # just in case it's missing
55         sudo apt-get install top
56
57 Login as the sysop user.
58
59 Edit your /spider/local/DXVars.pm so that the bottom of the file is changed from something like:
60
61 ---- old ----
62
63          # the port number of the cluster (just leave this, unless it REALLY matters to you)
64          $clusterport = 27754;
65
66          # your favorite way to say 'Yes'
67          $yes = 'Yes';
68
69          # your favorite way to say 'No'
70          $no = 'No';
71
72          # the interval between unsolicited prompts if not traffic
73          $user_interval = 11*60;
74
75          # data files live in 
76          $data = "$root/data";
77
78          # system files live in
79          $system = "$root/sys";
80
81          # command files live in
82          $cmd = "$root/cmd";
83
84          # local command files live in (and overide $cmd)
85          $localcmd = "$root/local_cmd";
86
87          # where the user data lives
88          $userfn = "$data/users";
89
90          # the "message of the day" file
91          $motd = "$data/motd";
92
93          # are we debugging ?
94          @debug = qw(chan state msg cron );
95
96 ---- to this: ----
97
98          # the port number of the cluster (just leave this, unless it REALLY matters to you)
99          $clusterport = 27754;
100
101          # your favorite way to say 'Yes'
102          $yes = 'Yes';
103
104          # your favorite way to say 'No'
105          $no = 'No';
106
107          # this is where the paths used to be which you have just removed
108          
109          # are we debugging ?
110          @debug = qw(chan state msg cron );
111
112 ---- new  ------
113
114 There may be other stuff after this in DXVars.pm, that doesn't matter. The point is to remove
115 all the path definitions in DXVars.pm. If this isn't clear to you then it would be better if
116 you asked on dxspider-support for help before attempting to go any further.
117
118 One of the things that will happen is that several files currently in /spider/data will be
119 placed in /spider/local_data. These include the user, qsl and usdb data files, the band and
120 prefix files, and various "bad" data files. I.e. everything that is modified from the base
121 git distribution. 
122
123 Now run the console program or telnet localhost and login as the sysop user.
124
125         export_users
126         bye
127
128 as the sysop user:
129
130    sudo service dxspider stop
131
132 having stopped the node:
133
134    mkdir /spider/local_data
135    git reset --hard
136    git pull
137    git checkout --track -b mojo origin/mojo
138
139 if you have not already done this:
140
141    sudo ln -s /spider/perl/console.pl /usr/local/bin/dx
142    sudo ln -s /spider/perl/*dbg /usr/local/bin
143
144 Now in another window run:
145
146         watchdbg
147
148 and finally:
149
150    sudo service dxspider start
151
152 You should be aware that this code base is now under active development and, if you do a 'git pull',
153 what you get may be broken. But, if this does happen, the likelyhood is that I am actively working
154 on the codebase and any brokenness may be fixed (maybe in minutes) with another 'git pull'.
155
156 I try very hard not to leave it in a broken state...
157
158 Dirk G1TLH
159
160
161
162