Agenda: exercises-dsc-install.txt

File exercises-dsc-install.txt, 4.9 KB (added by trac, 5 years ago)
Line 
1Install, configuring and running DSC on Ubuntu:
2
3NOTES:
4
5DSC is normally installed on multiple collector nodes, that collect
6traffic on the DNS nodes themselves, and a presenter, which receives
7the trace files generated by the collector nodes.
8
9In this exercise, we will be installing the collector and presenter
10on the same host.
11
12Also, we will not be using SSL certificates.
13
14Part I: Presenter Installation
15
161. Install Perl dependencies
17
18# perl -v
19
20If it is not installed, you can always get it with apt-get install perl
21
22
23Let's get all the necessary modules for DSC to run:
24
25# perl -MCPAN -e shell
26(Answer questions, etc...)
27
28You should get the following prompt in the end:
29
30cpan[1]>                                                                       
31
32At the prompt, for each of the following modules, run:
33
34    install MODULE_NAME
35
36        CGI::Untaint
37        CGI
38        Digest::MD5
39        File::Flock
40        File::Spec
41        File::Temp
42        Geography::Countries
43        Hash::Merge
44        IP::Country
45        MIME::Base64
46        Math::Calc::Units
47        List::Util
48        Text::Template
49        URI::Escape
50        XML::Simple
51
52(Some will aready be part of the base perl install, but they will be
53ignored, so don't worry)
54
55
563. Install other dependencies
57
58- To compile DSC modules:
59
60# apt-get install gcc
61# apt-get install make
62
63- Additional software required:
64
65# apt-get install apache2
66# apt-get install ploticus
67
684. Fetch the latest DSC distribution
69   (Always at http://dns.measurement-factory.com/tools/dsc/download/)
70
71# wget http://dns.measurement-factory.com/tools/dsc/download/dsc-200912101623.tar.gz
72
73Extract it:
74
75# tar xfz dsc-200912101623.tar.gz
76# cd dsc-200912101623
77
78
795. Build the presenter, and install it
80
81# cd presenter
82# make
83
84[there should be no errors]
85
86# mkdir /usr/local/dsc
87# make install
88
89
906. Make symlinks
91
92# cd /usr/lib/cgi-bin
93# ln -s /usr/local/dsc/libexec/put-file.pl
94# ln -s /usr/local/dsc/libexec/dsc-grapher.pl
95# cd /var/www
96# ln -s /usr/local/dsc/share/html dsc
97
987. Add a 'dsc' user
99
100# useradd dsc -d /usr/local/dsc -c "DSC"
101# chown dsc /usr/local/dsc
102
1038.  Create directories where data will be copied:
104
105# mkdir -p /usr/local/dsc/data/aroc-dns/localhost
106# chown -R dsc /usr/local/dsc/data/aroc-dns
107
1088. Set permissions on various data dirs
109
110# chgrp nogroup /usr/local/dsc/data/
111# chmod 2775 /usr/local/dsc/data/
112# chgrp www-data /usr/local/dsc/var/log/
113# chgrp www-data /usr/local/dsc/cache/
114
1159. Create a crontab for the cleanup jobs:
116
117# crontab -e
118
119# Presenter
120* * * * * /usr/local/dsc/libexec/refile-and-grok.sh
121@midnight find /usr/local/dsc/data/ | /usr/local/dsc/libexec/remove-xmls.pl 7
122
123(save and quit)
124
125
126Part II: Collector Installation
127
1281. Go back to the DSC distribution source directory
129
130# cd .../dsc-200912101623
131# collector
132# make
133# make install
134
1352. Create upload directories
136
137# mkdir -p /usr/local/dsc/run/localhost/upload/aroc
138
139(This means that we will have XML files in the localhost directory,
140and they will be moved to the upload directory 'aroc'.
141
142These files will be moved by the "upload-prep.sh" cron job:
143
144# crontab -e
145
146# Collector
147* * * * * /usr/local/dsc/libexec/upload-prep.sh
148
149
1503. Let's add cron jobs to "upload" the files to the presenter
151
152In reality, this is happening on the same machine, but we set up the
153system as if we were installing using a separate collector and presenter:
154
155# crontab -e
156
157* * * * * /usr/local/dsc/libexec/upload-rsync.sh localhost aroc dsc@localhost:/usr/local/dsc/data/aroc-dns/localhost
158
1594. Generate a key for the root user, used to copy files to the data
160   directories
161
162# ssh-keygen -t dsa
163
164(don't set any passphrase)
165
166Copy the /root/ssh/id_dsa.pub to the authorized_keys directory of the DSC
167user:
168
169# mkdir /usr/local/dsc/.ssh
170# cp /root/ssh/id_dsa.pub /usr/local/dsc/.ssh/authorized_keys
171# chown -R dsc /usr/local/dsc/.ssh
172
173
174
175Part III: Configuring and running the collector
176
1771. Configuration
178
179# cd /usr/local/dsc/etc
180# cp dsc.conf.sample dsc.conf
181
182Edit the file, and set the variables below as follows:
183
184
185    local_address   ip_of_your_server;
186
187    run_dir "/usr/local/dsc/run/localhost";
188
189    interface eth0;
190
191
192... the rest of the values are good defaults.
193
1942. Running
195
196# /usr/local/dsc/bin/dsc -d -f /usr/local/dsc/etc/dsc.conf
197
198XXX: We have a problem.  dsc crashes on Linux when running normally,
199i.e.: without the -d flag.  Bug report will be sent to Duane.
200
201As a result, with -d, it only runs once...
202
203
204Part IV: Configure and use the graph viewer
205
206
207# cp dsc-grapher.cfg.sample dsc-grapher.cfg
208
209Edit the file, and make the following changes:
210
211- Remove these two lines:
212
213server f-root pao1 sfo2
214server k-root A=k1.A,k2.A B=k1.B,k2.B C=k1.C,k2.C
215
216- Add this line instead:
217
218server aroc-dns localhost
219
220- Change the line
221
222valid_domains f-root all_tlds
223
224to
225
226valid_domains aroc-dns all_tlds
227
228
229
230That's it!
231
232You should be able to start observing the graphs at:
233
234        http://yourhost/cgi-bin/dsc-grapher.p
235
236
237TODO: test upload-rsync.sh, make sure that the copying is taking place
238      setup a bind nameserver, that receives queries
239     
240
241