Project

General

Profile

NetDRMS Installation » History » Version 344

Herve Ballans, 15/06/2016 17:52

1 50 Herve Ballans
{{toc}}
2 1 Herve Ballans
3 322 Pablo Alingery
h1. NetDRMS 8.11 Installation
4 1 Herve Ballans
5 276 Herve Ballans
h2. Preliminary note
6 275 Herve Ballans
7 275 Herve Ballans
In the following sections, when there is a command line :
8 324 Herve Ballans
<pre>#</pre>means that command is executed into _root_ user
9 324 Herve Ballans
<pre>$</pre>means that command is executed into _production_ user
10 275 Herve Ballans
11 333 Herve Ballans
h2. Environment
12 333 Herve Ballans
13 343 Herve Ballans
Server : DELL PowerEdge R730
14 343 Herve Ballans
RAM : 64.00GB
15 343 Herve Ballans
CPU : 32 CPUs Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
16 343 Herve Ballans
Hard Disk Configuration :
17 344 Herve Ballans
* 264 GB mounted in / (2 X 278.88 GB SAS 12G disks in RAID1)
18 344 Herve Ballans
* 1,7 TB mounted in /var/lib/postgresql (7 X 278.88 GB SAS 12G disks in RAID5 configuration)
19 344 Herve Ballans
* 1 global spare for both RAID
20 344 Herve Ballans
* DDP storage mounted in /SUM*
21 343 Herve Ballans
22 343 Herve Ballans
Guest OS : Debian 8.4
23 343 Herve Ballans
Kernel : Linux sdo-new 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) x86_64 GNU/Linux
24 343 Herve Ballans
25 1 Herve Ballans
h2. Requirements
26 1 Herve Ballans
27 47 Pablo Alingery
h3. Configuring production environment
28 1 Herve Ballans
29 284 Herve Ballans
Adding user production
30 47 Pablo Alingery
31 1 Herve Ballans
<pre>
32 1 Herve Ballans
# adduser production
33 1 Herve Ballans
# addgroup ias
34 1 Herve Ballans
# adduser production ias
35 1 Herve Ballans
</pre>
36 1 Herve Ballans
37 49 Herve Ballans
h3. Configure /home/production/.profile
38 1 Herve Ballans
39 49 Herve Ballans
Adding environment variables
40 1 Herve Ballans
41 1 Herve Ballans
<pre>
42 122 Herve Ballans
#Modif Herve.B Pablo.A 12/05/2016
43 122 Herve Ballans
44 1 Herve Ballans
PATH="/usr/local/netdrms_current/bin/linux_x86_64:$PATH"
45 49 Herve Ballans
PATH="/usr/local/netdrms_current/scripts:$PATH"
46 122 Herve Ballans
PATH="/usr/local/jmd/bin:$PATH"
47 122 Herve Ballans
PATH="/usr/local/jmd/scripts:$PATH"
48 141 Pablo Alingery
#The following is not needed as installed with 'apt-get install' 
49 141 Pablo Alingery
#PATH="/usr/local/pgsql/bin:$PATH"
50 122 Herve Ballans
PATH="/usr/local/netdrms-tools/scripts:$PATH"
51 49 Herve Ballans
#2014-12-17 Avec Herve et Pablo on pense que la ligne suivante est intutile as it is f.. install in /usr/local/lib
52 140 Pablo Alingery
PATH="/usr/local/cfitsio:$PATH"
53 1 Herve Ballans
#Done
54 49 Herve Ballans
55 122 Herve Ballans
DERBY_HOME=/usr/local/jmd/databases/derby/derbyBD
56 49 Herve Ballans
export DERBY_HOME
57 49 Herve Ballans
58 49 Herve Ballans
export CVSROOT=:pserver:anonymous@solarch.tuc.noao.edu:2401/vtarc1/vso/cvsroot
59 49 Herve Ballans
</pre>
60 49 Herve Ballans
61 162 Pablo Alingery
h3. Configure /varl/lib/postgres/.profile
62 161 Pablo Alingery
63 163 Pablo Alingery
Add to $PATH so postgres can exeute command like initdb
64 161 Pablo Alingery
65 161 Pablo Alingery
<pre>
66 161 Pablo Alingery
#Modif Herve.B Pablo.A 19/05/2016
67 161 Pablo Alingery
PATH="/usr/lib/postgresql/9.4/bin:$PATH"
68 161 Pablo Alingery
</pre>
69 161 Pablo Alingery
70 125 Pablo Alingery
h3. Setting privileges for SUMS_MANAGER
71 87 Herve Ballans
72 126 Pablo Alingery
Please modify file /etc/sudoers so user 'production' will be able to execute  'sum_chown' that we will locate in the dir : /usr/local/bin . See below
73 125 Pablo Alingery
Add to /etc/sudoers the following line :
74 1 Herve Ballans
	production host=NOPASSWD:/usr/local/bin/sum_chmown
75 1 Herve Ballans
76 127 Pablo Alingery
h3. Set passwords file for db postgres 
77 1 Herve Ballans
78 127 Pablo Alingery
Please create file .pgpass with the following information for user 'production" so he will be able to connect without password as 'production' or 'postgres' to 2 db that we will create later ias_sdo and ias_sdo_sums.
79 1 Herve Ballans
80 1 Herve Ballans
81 1 Herve Ballans
.pgpass content :
82 1 Herve Ballans
<pre>
83 128 Pablo Alingery
	#hostname:5432:ias_sdo:production: 
84 128 Pablo Alingery
	#hostname:5434:ias_sdo_sums:production: 
85 128 Pablo Alingery
	#hostname:5432:ias_sdo:postgres: 
86 128 Pablo Alingery
	#hostname:5434:ias_sdo_sums:postgres
87 1 Herve Ballans
</pre>
88 128 Pablo Alingery
89 129 Pablo Alingery
where #hostname is the name of your server
90 129 Pablo Alingery
91 129 Pablo Alingery
92 131 Pablo Alingery
%{color:red}WARNING : change hostname when migrate sdo-new to sdo%
93 1 Herve Ballans
94 133 Pablo Alingery
h3. Install missing libraries 
95 1 Herve Ballans
96 293 Herve Ballans
* libreadline-dev (but already installed with postgresql)
97 293 Herve Ballans
* libssl-dev 
98 293 Herve Ballans
* libpam0g-dev 
99 293 Herve Ballans
* libperl-dev 
100 293 Herve Ballans
* libnet-ssh-perl
101 293 Herve Ballans
* libstring-shellquote-perl
102 296 Herve Ballans
* libdbi-perl 
103 296 Herve Ballans
* libdbd-pg-perl
104 1 Herve Ballans
105 133 Pablo Alingery
NB : Already done in Debian 8.4 Jessy
106 1 Herve Ballans
<pre>
107 1 Herve Ballans
# apt-get install $library_name
108 1 Herve Ballans
</pre> 
109 1 Herve Ballans
where
110 1 Herve Ballans
	_$library_name_ is the name of library
111 19 Pablo Alingery
112 1 Herve Ballans
Then to update path on libraries, please type :
113 1 Herve Ballans
<pre>
114 19 Pablo Alingery
# ldconfig
115 1 Herve Ballans
</pre>
116 1 Herve Ballans
117 1 Herve Ballans
h3. Reconfigure locale
118 1 Herve Ballans
119 1 Herve Ballans
<pre>
120 1 Herve Ballans
# dpkg-reconfigure locales
121 1 Herve Ballans
</pre>
122 1 Herve Ballans
123 1 Herve Ballans
select fr_FR.UTF8 UTF8 and unselect en_US.UTF-8
124 1 Herve Ballans
125 1 Herve Ballans
localedef -i en_US -f UTF-8 en_US.UTF-8
126 1 Herve Ballans
127 1 Herve Ballans
(see here : [[http://www.thomas-krenn.com/en/wiki/Perl_warning_Setting_locale_failed_in_Debian]])
128 1 Herve Ballans
129 134 Pablo Alingery
h3. Install gfortran packages
130 1 Herve Ballans
131 1 Herve Ballans
<pre>
132 1 Herve Ballans
# apt-get install gfortran swig
133 1 Herve Ballans
</pre>
134 1 Herve Ballans
135 1 Herve Ballans
h3. Installation of cfitsio library
136 1 Herve Ballans
137 135 Pablo Alingery
In /usr/local dir
138 135 Pablo Alingery
139 135 Pablo Alingery
Version 3.39 (currently on sdo : 3.24)
140 1 Herve Ballans
<pre>
141 135 Pablo Alingery
# wget ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3390.tar.gz
142 1 Herve Ballans
</pre>
143 137 Pablo Alingery
Untar and  decompression
144 1 Herve Ballans
<pre>
145 136 Pablo Alingery
# tar -xzvf cfitsio3390.tar.gz
146 1 Herve Ballans
</pre> 
147 1 Herve Ballans
148 139 Pablo Alingery
Go into /usr/local and type
149 1 Herve Ballans
150 1 Herve Ballans
su - root and :
151 1 Herve Ballans
<pre>
152 1 Herve Ballans
# ./configure --prefix=/usr/local
153 1 Herve Ballans
# make 
154 1 Herve Ballans
# make install
155 135 Pablo Alingery
</pre>
156 118 Pablo Alingery
157 237 Herve Ballans
h3. Installation des libraries libtar-dev, libcurl3-dev et libecpg-dev
158 237 Herve Ballans
159 237 Herve Ballans
<pre>
160 237 Herve Ballans
apt-get install libtar libtar-dev
161 237 Herve Ballans
</pre>
162 237 Herve Ballans
163 238 Pablo Alingery
Note, selecting 'libcurl4-openssl-dev' instead of 'libcurl3-dev'
164 238 Pablo Alingery
libcurl4-openssl-dev is already the newest version
165 237 Herve Ballans
<pre>
166 237 Herve Ballans
apt-get install libcurl3-dev
167 237 Herve Ballans
</pre>
168 237 Herve Ballans
169 237 Herve Ballans
<pre>
170 237 Herve Ballans
apt-get install libecpg-dev
171 237 Herve Ballans
</pre>
172 237 Herve Ballans
173 144 Pablo Alingery
h3. Installation of apache2 and lib perl
174 118 Pablo Alingery
175 118 Pablo Alingery
<pre>
176 118 Pablo Alingery
# apt-get install apache2
177 118 Pablo Alingery
178 118 Pablo Alingery
# apt-get install libjson-perl
179 118 Pablo Alingery
180 118 Pablo Alingery
# apt-get install libapache2-mod-perl2
181 118 Pablo Alingery
</pre>
182 1 Herve Ballans
183 183 Herve Ballans
h3. Installation of postgresql
184 1 Herve Ballans
185 145 Pablo Alingery
Into 'root'
186 145 Pablo Alingery
 
187 145 Pablo Alingery
<pre>
188 147 Pablo Alingery
apt-get install postgresql-9.4 postgresql-client-9.4 
189 145 Pablo Alingery
</pre>
190 145 Pablo Alingery
191 213 Herve Ballans
h3. Installation of python3
192 209 Pablo Alingery
193 209 Pablo Alingery
Into 'root'
194 209 Pablo Alingery
 
195 209 Pablo Alingery
<pre>
196 209 Pablo Alingery
apt-get install python3 
197 1 Herve Ballans
</pre>
198 210 Pablo Alingery
199 211 Pablo Alingery
Add some modules psycopg2 (postgres connector) and pySmartDL (Download manager) 
200 210 Pablo Alingery
201 210 Pablo Alingery
<pre>
202 210 Pablo Alingery
apt-get install python3-psycopg2
203 210 Pablo Alingery
</pre>
204 210 Pablo Alingery
205 210 Pablo Alingery
<pre>
206 210 Pablo Alingery
apt-get install python3-psycopg2
207 210 Pablo Alingery
</pre>
208 210 Pablo Alingery
209 210 Pablo Alingery
Add python3-pip for modules within python3
210 210 Pablo Alingery
211 210 Pablo Alingery
<pre>
212 210 Pablo Alingery
apt-get install python3-pip
213 1 Herve Ballans
</pre>
214 212 Pablo Alingery
215 212 Pablo Alingery
<pre>
216 212 Pablo Alingery
pip3 install pySmartDL
217 212 Pablo Alingery
</pre>
218 1 Herve Ballans
219 213 Herve Ballans
Both python2.7 and 3.4 versions are installed on the system.
220 213 Herve Ballans
By default, the python2.7 is used.
221 213 Herve Ballans
In order to change in 3.4 by default, type :
222 213 Herve Ballans
<pre>
223 213 Herve Ballans
update-alternatives --config python
224 213 Herve Ballans
</pre>
225 209 Pablo Alingery
226 1 Herve Ballans
h3. Installation of sdo_scripts
227 218 Pablo Alingery
228 219 Pablo Alingery
Install monitoring scripts for sdo
229 218 Pablo Alingery
230 218 Pablo Alingery
<pre>
231 268 Pablo Alingery
rsync -av scripts production@sdo-new:/home/production/netdrms-tools/
232 218 Pablo Alingery
</pre>
233 218 Pablo Alingery
234 1 Herve Ballans
h2. NetDRMS databases
235 1 Herve Ballans
236 156 Pablo Alingery
into /var/lib/postgresql  (hard mount point separated,  7 disks 15000 tr/min in raid5 in order to distribute read and write) 
237 1 Herve Ballans
238 1 Herve Ballans
<pre>
239 158 Pablo Alingery
# cd /var/lib/postgresql
240 157 Pablo Alingery
# mkdir data  data_sums data_monitor
241 157 Pablo Alingery
# chown -R postgres:postgres * 
242 1 Herve Ballans
</pre>
243 1 Herve Ballans
244 160 Pablo Alingery
h3. Initialize 3 servers data,  data_sums, data_monitor
245 1 Herve Ballans
246 159 Pablo Alingery
Into postgres
247 1 Herve Ballans
<pre>
248 1 Herve Ballans
# su - postgres
249 1 Herve Ballans
250 1 Herve Ballans
$ initdb --locale=C -D data -A md5 -W
251 1 Herve Ballans
(no password)
252 2 Herve Ballans
253 2 Herve Ballans
Success. You can now start the database server using:
254 2 Herve Ballans
255 2 Herve Ballans
    postgres -D data
256 2 Herve Ballans
or
257 2 Herve Ballans
    pg_ctl -D data -l logfile start
258 2 Herve Ballans
259 1 Herve Ballans
260 1 Herve Ballans
$ initdb --locale=C -D data_sums -A md5 -W
261 2 Herve Ballans
(no password)
262 2 Herve Ballans
263 2 Herve Ballans
Success. You can now start the database server using:
264 2 Herve Ballans
265 2 Herve Ballans
    postgres -D data_sums
266 2 Herve Ballans
or
267 2 Herve Ballans
    pg_ctl -D data_sums -l logfile start
268 8 Pablo Alingery
269 8 Pablo Alingery
$ initdb --locale=C -D data_monitor -A md5 -W
270 8 Pablo Alingery
(no password)
271 8 Pablo Alingery
272 8 Pablo Alingery
Success. You can now start the database server using:
273 8 Pablo Alingery
274 8 Pablo Alingery
    postgres -D data_monitor
275 8 Pablo Alingery
or
276 8 Pablo Alingery
    pg_ctl -D data_monitor -l logfile start
277 2 Herve Ballans
</pre>
278 2 Herve Ballans
279 1 Herve Ballans
280 1 Herve Ballans
281 1 Herve Ballans
Edition des fichiers postgresql.conf pour configurer les bons ports d'écoute :
282 1 Herve Ballans
listen_addresses = '*'
283 1 Herve Ballans
data -> port 5432
284 10 Pablo Alingery
data_sums -> port 5434
285 1 Herve Ballans
data_monitor -> port 5436
286 10 Pablo Alingery
287 165 Pablo Alingery
Edit files data*/pg_hba.conf : replace 'md5' by 'trust'
288 1 Herve Ballans
<pre>
289 1 Herve Ballans
#"local"
290 1 Herve Ballans
local   all             all                                     trust
291 1 Herve Ballans
#"IPv4"
292 1 Herve Ballans
host   all             all                                     trust
293 1 Herve Ballans
</pre>
294 166 Pablo Alingery
295 166 Pablo Alingery
h3. Tunning postgres 
296 166 Pablo Alingery
297 166 Pablo Alingery
In file postgres.conf ( according to https://www.qwant.com/?q=Tunning+postgres+server+9.4+&client=firefox  )
298 166 Pablo Alingery
299 168 Pablo Alingery
shared_buffer=4096MB %{color:red}So 1/12 of the total RAM memory available%
300 1 Herve Ballans
301 169 Pablo Alingery
work_mem = 24MB
302 168 Pablo Alingery
303 168 Pablo Alingery
maintenance_work_mem = 4096MB
304 1 Herve Ballans
305 169 Pablo Alingery
wal_buffers = 16MB
306 169 Pablo Alingery
307 169 Pablo Alingery
checkpoint_segments = 32
308 169 Pablo Alingery
309 169 Pablo Alingery
checkpoint_completion_target = 0.9
310 169 Pablo Alingery
311 169 Pablo Alingery
random_page_cost = 1.0
312 169 Pablo Alingery
313 169 Pablo Alingery
effective_cache_size = 16384MB so 1/4 of the max memory 
314 169 Pablo Alingery
315 170 Pablo Alingery
316 170 Pablo Alingery
317 170 Pablo Alingery
#log
318 169 Pablo Alingery
logging_collector = on 
319 169 Pablo Alingery
log_directory = 'pg_log' 
320 169 Pablo Alingery
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
321 169 Pablo Alingery
log_truncate_on_rotation = on           # If on, an existing log file with the
322 169 Pablo Alingery
log_rotation_age = 1d                   # Automatic rotation of logfiles will
323 170 Pablo Alingery
client_min_messages = error
324 170 Pablo Alingery
log_min_messages = error 
325 170 Pablo Alingery
log_min_duration_statement = 0
326 170 Pablo Alingery
327 170 Pablo Alingery
log_connections = on
328 170 Pablo Alingery
log_disconnections = on
329 170 Pablo Alingery
log_duration = off
330 170 Pablo Alingery
log_hostname = on
331 170 Pablo Alingery
log_line_prefix = '%t [%p]: %u@%h - %d :'  
332 170 Pablo Alingery
333 170 Pablo Alingery
track_counts = on
334 170 Pablo Alingery
autovacuum = on 
335 170 Pablo Alingery
336 170 Pablo Alingery
extra_float_digits = 3
337 170 Pablo Alingery
338 177 Pablo Alingery
h3. Start the 3 databases :
339 1 Herve Ballans
340 1 Herve Ballans
<pre>
341 1 Herve Ballans
# su - postgres
342 196 Herve Ballans
$ cd /var/lib/postgresql
343 172 Pablo Alingery
$ pg_ctl -D data  start
344 172 Pablo Alingery
$ pg_ctl -D data_sums start
345 172 Pablo Alingery
$ pg_ctl -D data_monitor start
346 1 Herve Ballans
</pre>
347 174 Pablo Alingery
348 1 Herve Ballans
h3. Create the 3 databases :
349 181 Pablo Alingery
350 178 Pablo Alingery
Into user 'postgres'
351 1 Herve Ballans
352 179 Pablo Alingery
* createdb --locale C -E LATIN1 -T template0 ias_sdo
353 179 Pablo Alingery
* createdb --locale C -E LATIN1 -T template0 -p 5434 ias_sdo_sums
354 179 Pablo Alingery
* createdb --locale C -E LATIN1 -T template0 -p 5436 ias_sdo_monitor
355 54 Herve Ballans
356 182 Herve Ballans
h3. Automatic startup
357 182 Herve Ballans
358 182 Herve Ballans
Add following lines in the /etc/rc.local file :
359 182 Herve Ballans
360 182 Herve Ballans
<pre>
361 197 Herve Ballans
su -l -c "/usr/lib/postgresql/9.4/bin/pg_ctl -D /var/lib/postgresql/data start" postgres
362 197 Herve Ballans
su -l -c "/usr/lib/postgresql/9.4/bin/pg_ctl -D /var/lib/postgresql/data_sums start" postgres
363 197 Herve Ballans
su -l -c "/usr/lib/postgresql/9.4/bin/pg_ctl -D /var/lib/postgresql/data_monitor start" postgres
364 182 Herve Ballans
</pre>
365 182 Herve Ballans
366 325 Pablo Alingery
h3. Install additional modules
367 327 Pablo Alingery
368 326 Pablo Alingery
We need dblink for triggers between db so let's install postgresql-contrib-9.4 
369 325 Pablo Alingery
370 325 Pablo Alingery
<pre>
371 326 Pablo Alingery
root@sdo-new:~# apt-get install postgresql-contrib-9.4
372 325 Pablo Alingery
</pre>
373 325 Pablo Alingery
374 328 Pablo Alingery
Create extension dblink for each db 
375 328 Pablo Alingery
ias_sdo
376 325 Pablo Alingery
<pre>
377 328 Pablo Alingery
root@sdo-new:$ psql ias_sdo -p5432 -U postgres
378 328 Pablo Alingery
psql (9.4.6)
379 325 Pablo Alingery
Type "help" for help.
380 1 Herve Ballans
381 328 Pablo Alingery
ias_sdo=# CREATE EXTENSION dblink ;
382 1 Herve Ballans
CREATE EXTENSION
383 328 Pablo Alingery
</pre>
384 1 Herve Ballans
385 328 Pablo Alingery
ias_sdo_sums 
386 328 Pablo Alingery
<pre>
387 328 Pablo Alingery
root@sdo-new:$ psql ias_sdo -p5434 -U postgres
388 328 Pablo Alingery
psql (9.4.6)
389 328 Pablo Alingery
Type "help" for help.
390 328 Pablo Alingery
391 328 Pablo Alingery
ias_sdo=# CREATE EXTENSION dblink ;
392 328 Pablo Alingery
CREATE EXTENSION
393 328 Pablo Alingery
</pre>
394 328 Pablo Alingery
395 328 Pablo Alingery
ias_sdo_monitor
396 328 Pablo Alingery
<pre>
397 328 Pablo Alingery
root@sdo-new:$ psql ias_sdo -p5436 -U postgres
398 328 Pablo Alingery
psql (9.4.6)
399 328 Pablo Alingery
Type "help" for help.
400 328 Pablo Alingery
401 328 Pablo Alingery
ias_sdo=# CREATE EXTENSION dblink ;
402 328 Pablo Alingery
CREATE EXTENSION
403 325 Pablo Alingery
</pre>
404 325 Pablo Alingery
405 330 Pablo Alingery
To check the list of installed extensions type :
406 330 Pablo Alingery
 <pre>
407 330 Pablo Alingery
ias_sdo=\dx
408 332 Herve Ballans
                                 List of installed extensions
409 332 Herve Ballans
  Name   | Version |   Schema   |                         Description                          
410 332 Herve Ballans
---------+---------+------------+--------------------------------------------------------------
411 332 Herve Ballans
 dblink  | 1.1     | public     | connect to other PostgreSQL databases from within a database
412 332 Herve Ballans
 plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
413 332 Herve Ballans
(2 rows)
414 330 Pablo Alingery
415 330 Pablo Alingery
</pre>
416 332 Herve Ballans
417 332 Herve Ballans
418 325 Pablo Alingery
419 184 Herve Ballans
h2. System tuning
420 1 Herve Ballans
421 187 Herve Ballans
Current configuration :
422 185 Herve Ballans
<pre>
423 185 Herve Ballans
# sysctl -a
424 185 Herve Ballans
</pre>
425 1 Herve Ballans
426 187 Herve Ballans
In the following file :
427 185 Herve Ballans
<pre>
428 185 Herve Ballans
# vi /etc/sysctl.conf
429 185 Herve Ballans
</pre>
430 1 Herve Ballans
431 188 Herve Ballans
we change some values (default values are commented with '#')
432 194 Herve Ballans
433 195 Herve Ballans
(resources links [[Links|here]])
434 194 Herve Ballans
435 185 Herve Ballans
<pre>
436 191 Herve Ballans
# Semaphore is a object that is used to control utilization of a particular process.
437 191 Herve Ballans
# kernel.sem = SEMMSL SEMMNS SEMOPM SEMMNI
438 191 Herve Ballans
# SEMMSL        maximum number of semaphores per array  (min 128)
439 191 Herve Ballans
# SEMMNS        maximum semaphores system-wide  
440 191 Herve Ballans
# SEMOPM        maximum operations per semop call       
441 191 Herve Ballans
# SEMMNI        maximum arrays 
442 191 Herve Ballans
#semop incresed from 32 (default value)operation to 100 (3rd value )
443 191 Herve Ballans
# kernel.sem = 250      32000   32      128
444 191 Herve Ballans
kernel.sem = 250 32000 100 128
445 191 Herve Ballans
446 191 Herve Ballans
In order to  apply changes :#This sets the  OS receive buffer size for all types of connections (default value 212992)
447 191 Herve Ballans
#net.core.rmem_default = 212992
448 191 Herve Ballans
#net.core.rmem_max = 212992
449 191 Herve Ballans
net.core.rmem_default = 33554432
450 191 Herve Ballans
net.core.rmem_max = 33554432
451 191 Herve Ballans
452 191 Herve Ballans
#This is the OS send buffer size for all types of connections (212992 default value) 
453 191 Herve Ballans
#net.core.wmem_default = 212992
454 191 Herve Ballans
#net.core.wmem_max = 212992
455 191 Herve Ballans
net.core.wmem_default = 33554432
456 191 Herve Ballans
net.core.wmem_max = 33554432
457 191 Herve Ballans
458 193 Pablo Alingery
#TCP Autotuning setting. "The first value tells the kernel the minimum receive buffer for each TCP connection, and this buffer is always
459 193 Pablo Alingery
# allocated to a TCP socket, even under high pressure on the system. ... The second value specified tells the kernel the default receive
460 193 Pablo Alingery
# buffer allocated for each TCP socket. This value overrides the /proc/sys/net/core/rmem_default value used by other protocols. ...
461 192 Pablo Alingery
# The third and last value specified in this variable specifies the maximum receive buffer that can be allocated for a TCP socket."
462 1 Herve Ballans
#net.ipv4.tcp_rmem = 4096       87380   6291456
463 1 Herve Ballans
net.ipv4.tcp_rmem = 10240 87380 33554432
464 1 Herve Ballans
465 193 Pablo Alingery
#TCP Autotuning setting. "This variable takes 3 different values which holds information on how much TCP sendbuffer memory space
466 193 Pablo Alingery
# each TCP socket has to use. Every TCP socket has this much buffer space to use before the buffer is filled up. Each of the three 
467 193 Pablo Alingery
#values are used under different conditions. ... The first value in this variable tells the minimum TCP send buffer space available
468 193 Pablo Alingery
# for a single TCP socket. ... The second value in the variable tells us the default buffer space allowed for a single TCP socket to use. ... 
469 193 Pablo Alingery
#The third value tells the kernel the maximum TCP send buffer space." 
470 191 Herve Ballans
#net.ipv4.tcp_wmem = 4096       16384   4194304
471 191 Herve Ballans
net.ipv4.tcp_wmem = 10240 87380 33554432
472 191 Herve Ballans
473 191 Herve Ballans
#Disable cache metrics so the initial conditions of the closed connections will not be saved to be used in near future connections
474 191 Herve Ballans
#net.ipv4.tcp_no_metrics_save = 0
475 191 Herve Ballans
net.ipv4.tcp_no_metrics_save = 1
476 191 Herve Ballans
477 1 Herve Ballans
# Increase number of incoming connections backlog
478 1 Herve Ballans
# net.core.netdev_max_backlog = 1000
479 1 Herve Ballans
net.core.netdev_max_backlog = 5000
480 1 Herve Ballans
481 1 Herve Ballans
# The tcp_mem variable defines how the TCP stack should behave when it comes to memory usage. ... 
482 192 Pablo Alingery
#The first value specified in the tcp_mem variable tells the kernel the low threshold. 
483 192 Pablo Alingery
#Below this point, the TCP stack do not bother at all about putting any pressure on the memory usage by different TCP sockets. ... 
484 193 Pablo Alingery
#The second value tells the kernel at which point to start pressuring memory usage down. ... The final value tells the kernel how many
485 193 Pablo Alingery
# memory pages it may use maximally
486 1 Herve Ballans
# net.ipv4.tcp_mem = 1543347    2057796 3086694
487 191 Herve Ballans
net.ipv4.tcp_mem = 786432 1048576 26777216
488 191 Herve Ballans
489 192 Pablo Alingery
# local port range that is used by TCP and UDP traffic to choose the local port. You will see in the parameters of this file two numbers:
490 192 Pablo Alingery
# The first number is the first local port allowed for TCP and UDP traffic on the server, the second is the last local port number.
491 191 Herve Ballans
# net.ipv4.ip_local_port_range = 32768  61000
492 191 Herve Ballans
net.ipv4.ip_local_port_range = 1024 65535
493 191 Herve Ballans
494 191 Herve Ballans
# maximum number of sockets in TIME-WAIT to be held simultaneously.
495 191 Herve Ballans
# net.ipv4.tcp_max_tw_buckets = 262144
496 191 Herve Ballans
net.ipv4.tcp_max_tw_buckets = 360000
497 1 Herve Ballans
</pre>
498 185 Herve Ballans
499 191 Herve Ballans
Then we run the following command to make our change take effect:
500 191 Herve Ballans
501 185 Herve Ballans
<pre>
502 185 Herve Ballans
# sysctl -p
503 185 Herve Ballans
</pre>
504 176 Pablo Alingery
505 216 Pablo Alingery
h2. JMD Installation 
506 215 Herve Ballans
507 217 Pablo Alingery
Download new JMD package build by Niles Oien 2016-04-07 following thoses actions :
508 215 Herve Ballans
509 215 Herve Ballans
<pre>
510 215 Herve Ballans
cd /urs/local
511 215 Herve Ballans
512 215 Herve Ballans
[oien@spsc-nso19-12 ~]$ ftp gong2.nso.edu
513 215 Herve Ballans
Name (gong2.nso.edu:oien): anonymous
514 215 Herve Ballans
Password: <---------------- use your email as the password
515 215 Herve Ballans
ftp> cd outgoing/oien
516 215 Herve Ballans
ftp> get pablo_jmd.tar.gz
517 215 Herve Ballans
ftp> quit
518 215 Herve Ballans
</pre>
519 215 Herve Ballans
520 215 Herve Ballans
Install new JMD package following thoses actions 
521 215 Herve Ballans
522 215 Herve Ballans
<pre>
523 215 Herve Ballans
[oien@spsc-nso19-12 ~]$ gunzip -vf pablo_jmd.tar.gz
524 215 Herve Ballans
pablo_jmd.tar.gz:      8.3% -- replaced with pablo_jmd.tar
525 215 Herve Ballans
[oien@spsc-nso19-12 ~]$ tar xf pablo_jmd.tar
526 215 Herve Ballans
[oien@spsc-nso19-12 ~]$ cd pablo_jmd
527 338 Pablo Alingery
[oien@spsc-nso19-12 pablo_jmd]$ less README.txt
528 215 Herve Ballans
cd ..
529 215 Herve Ballans
mv jmd jmd_old
530 215 Herve Ballans
mv pablo_jmd jmd 
531 215 Herve Ballans
</pre>
532 215 Herve Ballans
533 340 Pablo Alingery
url provided by jsoc to download last JMD version http://vso.tuc.noao.edu/VSO/downloads/JMD
534 339 Pablo Alingery
535 266 Herve Ballans
h2. Apache Configuration for JMD
536 215 Herve Ballans
537 215 Herve Ballans
Configure webserver  to request jsoc_fetch
538 215 Herve Ballans
(following the mail from nilesoien@gmail.com)
539 215 Herve Ballans
540 222 Pablo Alingery
%{color:red}WARNING : change hostname when migrate sdo-new to sdo%
541 222 Pablo Alingery
542 220 Pablo Alingery
config d 'apache2 fichier sdo-new.ias.u-psud.fr 
543 215 Herve Ballans
<pre>
544 215 Herve Ballans
545 215 Herve Ballans
<VirtualHost *:80>
546 220 Pablo Alingery
        ServerName sdo-new.ias.u-psud.fr
547 215 Herve Ballans
        ServerAdmin pablo.alingery@ias.u-psud.fr
548 215 Herve Ballans
        #ErrorLog /var/log/apache2/error.log
549 215 Herve Ballans
        DocumentRoot /var/www
550 215 Herve Ballans
551 215 Herve Ballans
        # Possible values include: debug, info, notice, warn, error, crit,
552 215 Herve Ballans
        # alert, emerg.
553 215 Herve Ballans
        LogLevel debug
554 215 Herve Ballans
555 215 Herve Ballans
        #CustomLog /var/log/apache2/VSO/access.log combined
556 215 Herve Ballans
557 215 Herve Ballans
        Alias /VSO/DRMS/cgi-bin/ "/home/production/netdrms-tools/scripts/cgi-bin/"
558 215 Herve Ballans
559 215 Herve Ballans
        <Location /VSO/DRMS/cgi-bin>
560 215 Herve Ballans
                SetHandler perl-script
561 215 Herve Ballans
                PerlResponseHandler ModPerl::Registry
562 215 Herve Ballans
                PerlOptions +ParseHeaders
563 215 Herve Ballans
                Options +ExecCGI
564 215 Herve Ballans
                Order allow,deny
565 215 Herve Ballans
                Allow from all
566 215 Herve Ballans
        </Location>
567 215 Herve Ballans
</VirtualHost>
568 215 Herve Ballans
569 215 Herve Ballans
</pre>
570 215 Herve Ballans
571 223 Herve Ballans
Activate the new virtualhost and disable the default one :
572 223 Herve Ballans
<pre>
573 225 Herve Ballans
# a2ensite sdo-new.ias.u-psud.fr.conf
574 225 Herve Ballans
# a2dissite 000-default.conf
575 225 Herve Ballans
# service apache2 restart
576 225 Herve Ballans
</pre>
577 225 Herve Ballans
578 225 Herve Ballans
Allow symlink for the cgi scripts dierctory in apache2.conf :
579 225 Herve Ballans
<pre>
580 225 Herve Ballans
<Directory /home/production/netdrms-tools/scripts/>
581 225 Herve Ballans
        Options FollowSymLinks
582 225 Herve Ballans
        AllowOverride None
583 225 Herve Ballans
        Require all granted
584 225 Herve Ballans
</Directory>
585 225 Herve Ballans
</pre>
586 225 Herve Ballans
587 225 Herve Ballans
<pre>
588 225 Herve Ballans
# service apache2 restart
589 223 Herve Ballans
</pre>
590 223 Herve Ballans
 
591 226 Pablo Alingery
%{color:red}To be  added futher to test cgi%
592 1 Herve Ballans
Execution test cgi with URL :
593 226 Pablo Alingery
594 226 Pablo Alingery
make sure my $hostname=in the cgi file vso_jsoc_fetch.cgi is correct and test
595 224 Pablo Alingery
http://sdo-new.ias.u-psud.fr/VSO/DRMS/cgi-bin/vso_jsoc_fetch.cgi
596 215 Herve Ballans
597 215 Herve Ballans
expected result  :
598 215 Herve Ballans
<pre>
599 215 Herve Ballans
{
600 215 Herve Ballans
   "wait" : 0,
601 215 Herve Ballans
   "requestid" : "",
602 215 Herve Ballans
   "data" : {},
603 215 Herve Ballans
   "method" : "url_quick",
604 215 Herve Ballans
   "size" : 0,
605 215 Herve Ballans
   "errormsg" : "Empty query",
606 215 Herve Ballans
   "protocol" : "as-is",
607 215 Herve Ballans
   "status" : 1,
608 215 Herve Ballans
   "space_ratio" : 0.1,
609 215 Herve Ballans
   "load_ratio" : 0.066875,
610 215 Herve Ballans
   "dir" : "",
611 215 Herve Ballans
   "count" : 0
612 215 Herve Ballans
}
613 215 Herve Ballans
</pre>
614 215 Herve Ballans
615 267 Herve Ballans
h2. JMD configuration
616 267 Herve Ballans
617 291 Herve Ballans
Modify the file [[/usr/local/jmd/cfg/JMD.cfg]]
618 267 Herve Ballans
619 267 Herve Ballans
620 271 Herve Ballans
%{color:red}Warning : when migrate production server, change _sdo-new_ by _sdo_%
621 271 Herve Ballans
622 1 Herve Ballans
h2. NetDRMS tool Install
623 23 Pablo Alingery
624 199 Pablo Alingery
The following installed is based on : [[http://inf-redmine.ias.u-psud.fr/redmine/attachments/download/114/Netdrms_First_Install.odt]]
625 1 Herve Ballans
626 207 Pablo Alingery
The sources are in : http://jsoc.stanford.edu/netdrms/dist/ 
627 207 Pablo Alingery
Locally on sdo-new in  : /home/production/sources
628 1 Herve Ballans
629 199 Pablo Alingery
Symbolic link created 'netdrms_current' that corresponds to the last release
630 227 Pablo Alingery
ln -s netdrms_8.11/ netdrms_current 
631 1 Herve Ballans
632 199 Pablo Alingery
Edit file config.local
633 27 Pablo Alingery
<pre>
634 27 Pablo Alingery
cp config.local.template config.local
635 1 Herve Ballans
</pre>
636 29 Pablo Alingery
637 203 Pablo Alingery
%{color:red}Warning WEB_DBUSER      apache  We think that it should value www maybe , to be checked testing the cgi%
638 208 Pablo Alingery
%{color:red}So check the cgi to figure out which user is used to connect to bd%
639 32 Herve Ballans
640 199 Pablo Alingery
Create 2 followings dirs : 
641 1 Herve Ballans
<pre>
642 227 Pablo Alingery
mkdir /usr/local/netdrms_8.11/logs/SUM
643 227 Pablo Alingery
mkdir /usr/local/netdrms_8.11/logs/slony
644 27 Pablo Alingery
</pre>
645 1 Herve Ballans
646 205 Pablo Alingery
%{color:red}Warning config.local from line 150 =>222 Remote config to provide data, series to externals%
647 205 Pablo Alingery
%{color:red}To be checked for PLATO%
648 1 Herve Ballans
649 1 Herve Ballans
Création d'un alias netdrms dans /root/.bashrc
650 27 Pablo Alingery
<pre>
651 1 Herve Ballans
alias netdrms='cd /usr/local/netdrms_current'
652 1 Herve Ballans
</pre>
653 31 Pablo Alingery
654 1 Herve Ballans
h3. Prepare compiling
655 1 Herve Ballans
656 252 Herve Ballans
Into _production_ profile
657 252 Herve Ballans
658 246 Herve Ballans
<pre>
659 252 Herve Ballans
$ ./configure
660 246 Herve Ballans
</pre>
661 246 Herve Ballans
662 113 Pablo Alingery
h3. Compilation
663 113 Pablo Alingery
664 249 Herve Ballans
Creating lib64 link (lib64 does not exist on debian 8)
665 113 Pablo Alingery
<pre>
666 249 Herve Ballans
# cd /usr
667 249 Herve Ballans
# ln -s lib/ lib64
668 249 Herve Ballans
</pre>
669 249 Herve Ballans
670 249 Herve Ballans
<pre>
671 253 Herve Ballans
$ make
672 253 Herve Ballans
$ make sums
673 113 Pablo Alingery
</pre>
674 113 Pablo Alingery
675 255 Herve Ballans
h2. SSH-HPN install 
676 255 Herve Ballans
677 258 Herve Ballans
Intallation de openssh 7.2p2 car le dernier patch hpn dispo est 7.2hpn14.V10 
678 255 Herve Ballans
679 258 Herve Ballans
web site for open ssh : http://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.2p2.tar.gz
680 258 Herve Ballans
patch hpn : https://sourceforge.net/projects/hpnssh/files/HPN-SSH%2014v10%207.2p2/openssh-7_2_P2-hpn-14.10.diff
681 255 Herve Ballans
682 256 Pablo Alingery
In the dir /home/production/sources into  'root'
683 255 Herve Ballans
684 255 Herve Ballans
<pre>
685 258 Herve Ballans
# tar -xzvf openssh-7.2p2.tar.gz
686 258 Herve Ballans
# cd openssh-7.2p2/
687 258 Herve Ballans
# cat ../openssh-7_2_P2-hpn-14.10.diff |patch -p1
688 255 Herve Ballans
# ./configure --prefix=/usr/local/hpn-ssh --with-pam --with-md5-passwords --without-zlib-version-check --with-tcp-wrappers
689 255 Herve Ballans
# make
690 255 Herve Ballans
# make install
691 255 Herve Ballans
</pre>
692 255 Herve Ballans
693 255 Herve Ballans
Depuis sdo :
694 255 Herve Ballans
<pre>
695 255 Herve Ballans
# cd /usr/local/hpn-ssh/etc/
696 259 Herve Ballans
# rsync -av *key* production@sdo-new:/home/production/
697 255 Herve Ballans
</pre>
698 255 Herve Ballans
699 273 Herve Ballans
Following the link : http://vso.stanford.edu/netdrms/rmtsums.html
700 1 Herve Ballans
<pre>
701 274 Herve Ballans
$ cd /home/production/
702 273 Herve Ballans
$ ssh-agent -c > ~/.ssh-agent_rs
703 285 Pablo Alingery
</pre>
704 286 Pablo Alingery
NB : correct file   ~/.ssh-agent_rs it should look like :
705 285 Pablo Alingery
<pre>
706 285 Pablo Alingery
#!/bin/csh
707 285 Pablo Alingery
export SSH_AUTH_SOCK=/tmp/ssh-9POrTXobhLR4/agent.74272;
708 285 Pablo Alingery
export SSH_AGENT_PID=74273;
709 285 Pablo Alingery
echo Agent pid 74273;
710 285 Pablo Alingery
</pre>
711 285 Pablo Alingery
712 285 Pablo Alingery
<pre>
713 273 Herve Ballans
$ source ~/.ssh-agent_rs
714 273 Herve Ballans
$ ssh-add ~/.ssh/id_rsa
715 269 Herve Ballans
</pre>
716 269 Herve Ballans
717 259 Herve Ballans
Sur sdo-new :
718 255 Herve Ballans
<pre>
719 260 Herve Ballans
# mv /home/production/*key* /usr/local/hpn-ssh/etc/
720 255 Herve Ballans
</pre>
721 255 Herve Ballans
722 255 Herve Ballans
We have to configure the port number to 55000
723 255 Herve Ballans
<pre>
724 255 Herve Ballans
# vi ssh_config
725 255 Herve Ballans
</pre>
726 255 Herve Ballans
727 255 Herve Ballans
and add :
728 255 Herve Ballans
<pre>
729 255 Herve Ballans
#Port 22
730 255 Herve Ballans
Port 55000
731 255 Herve Ballans
</pre>
732 255 Herve Ballans
733 255 Herve Ballans
We configure also the server hpn (even we don't use it yet)
734 255 Herve Ballans
<pre>
735 255 Herve Ballans
# vi sshd_config
736 255 Herve Ballans
</pre>
737 255 Herve Ballans
738 255 Herve Ballans
and add :
739 255 Herve Ballans
<pre>
740 255 Herve Ballans
#Port 22
741 255 Herve Ballans
Port 55000
742 255 Herve Ballans
743 255 Herve Ballans
#PidFile /var/run/sshd.pid
744 255 Herve Ballans
PidFile /var/run/sshd.55000.pid
745 255 Herve Ballans
746 255 Herve Ballans
# allow the use of the none cipher
747 255 Herve Ballans
#NoneEnabled no
748 255 Herve Ballans
NoneEnabled yes
749 255 Herve Ballans
</pre>
750 255 Herve Ballans
751 265 Herve Ballans
In order to force the use of SSH-hpn by JMD :
752 265 Herve Ballans
753 265 Herve Ballans
<pre>
754 265 Herve Ballans
$ vi /usr/local/jmd/cfg/JMD.cfg
755 265 Herve Ballans
</pre>
756 265 Herve Ballans
757 265 Herve Ballans
and replace the path of scp binary :
758 265 Herve Ballans
759 265 Herve Ballans
<pre>
760 265 Herve Ballans
SCPCommand=/usr/local/hpn-ssh/bin/scp -o NoneSwitch=yes -o NoneEnabled=yes
761 265 Herve Ballans
</pre>
762 265 Herve Ballans
763 262 Herve Ballans
h2. Private key Public key generation 
764 262 Herve Ballans
765 262 Herve Ballans
JSOC need your public key to directly connect to your netdrms server. In order to generate your RSA public/private key pair :
766 262 Herve Ballans
767 262 Herve Ballans
<pre>
768 262 Herve Ballans
$ ssh-keygen -t rsa
769 262 Herve Ballans
</pre>
770 262 Herve Ballans
771 263 Pablo Alingery
Not necessary in our case cause we recover the ssh keys of the current server 'sdo'.
772 262 Herve Ballans
773 262 Herve Ballans
However, we have to retrieve the private key of production account on sdo-new
774 262 Herve Ballans
775 262 Herve Ballans
From sdo :
776 262 Herve Ballans
<pre>
777 262 Herve Ballans
rsync -av id_rsa production@sdo-new:/home/production/.ssh/
778 262 Herve Ballans
</pre>
779 262 Herve Ballans
780 300 Herve Ballans
In order to test the connection :
781 300 Herve Ballans
<pre>
782 300 Herve Ballans
$ ssh jsocexp@jsocport.stanford.edu -p55000
783 300 Herve Ballans
</pre>
784 300 Herve Ballans
785 301 Herve Ballans
Note : the IP of the server has to be declared to the jsoc
786 301 Herve Ballans
787 299 Pablo Alingery
h2. NetDRMS Replication Config
788 112 Herve Ballans
789 319 Herve Ballans
%{color:red}To be check if we keep that here or not%
790 311 Pablo Alingery
To prevent from deleting files 
791 307 Pablo Alingery
<pre>
792 307 Pablo Alingery
cd logs/SUM ; scp production@sdo:/usr/local/netdrms/install-config-files/sum_rm.cfg .
793 112 Herve Ballans
</pre>
794 1 Herve Ballans
795 1 Herve Ballans
Create tmp dir in netdrms working directory (/usr/local/netdrms_current)
796 112 Herve Ballans
<pre>
797 315 Herve Ballans
$ mkdir tmp
798 112 Herve Ballans
</pre>
799 112 Herve Ballans
800 308 Pablo Alingery
Create config file from template 
801 112 Herve Ballans
<pre>
802 315 Herve Ballans
$ cd base/drms/replication/etc
803 313 Pablo Alingery
cp repclient.template.cfg ias.repclient.cfg
804 307 Pablo Alingery
</pre>
805 91 Herve Ballans
806 316 Herve Ballans
Define node in file : [[/usr/local/netdrms_current/base/drms/replication/etc/ias.repclient.cfg]]
807 1 Herve Ballans
808 309 Pablo Alingery
In our case :
809 94 Herve Ballans
<pre>
810 1 Herve Ballans
node=IASprod
811 319 Herve Ballans
</pre>
812 319 Herve Ballans
813 341 Pablo Alingery
There are 4 new fields in the new version of repclient (see Art mail June 11, 2016)
814 335 Herve Ballans
815 319 Herve Ballans
<pre>
816 320 Herve Ballans
#kRSBaseURL=<base URL for all Slony services>
817 334 Herve Ballans
kRSBaseURL=http://jsoc.stanford.edu/cgi-bin/ajax
818 320 Herve Ballans
#kSubService=<URL of the subscription service>
819 334 Herve Ballans
kSubService=${kRSBaseURL}/request-subs.py
820 320 Herve Ballans
#kPubListService=<URL of the publication-list service>
821 334 Herve Ballans
kPubListService=${kRSBaseURL}/publist.py
822 320 Herve Ballans
#kSubXfer=<URL of the file transfer directory>
823 334 Herve Ballans
kSubXfer=http://jsoc.stanford.edu/subscription
824 106 Pablo Alingery
</pre>
825 321 Pablo Alingery
826 321 Pablo Alingery
h2. NetDRMS Subsribe list Config
827 321 Pablo Alingery
828 321 Pablo Alingery
Create config subscribe file from template 
829 321 Pablo Alingery
<pre>
830 321 Pablo Alingery
$ cd base/drms/replication/etc
831 321 Pablo Alingery
cp subscribe_list.template.cfg ias.subscribe_list.cfg
832 321 Pablo Alingery
</pre>
833 321 Pablo Alingery
834 292 Pablo Alingery
h2. TO BE DONE BEFORE MIGRATION
835 1 Herve Ballans
836 152 Pablo Alingery
%{color:red} configure sytem taille  buffer%
837 152 Pablo Alingery
838 155 Pablo Alingery
%{color:red} swap désactivé ? discussion Stephane et Gilles%
839 1 Herve Ballans
840 1 Herve Ballans
%{color:red}Test ssh connection to JSOC , NSO CFA before subcription and just after name sdo-new into sdo%
841 317 Pablo Alingery
%{color:red}Take old counter and place it in the same dir before migration%