Project

General

Profile

NetDRMS Installation » History » Version 271

Herve Ballans, 08/06/2016 18:14

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