1 production 1.1 NotesOnConvert_dcs0,1,2_to_dcs0,1,2x.txt
2
3 New datacapture machines:: 3/26/2013 dcs1x dcs2x
4 dcs0x
5 #production bn_dat4yu
6 production j1!!-beer
7 root: mdi:tng/ (try hfcsg0?a)
8 postgres: j1ka-ale
9 #jim: j1ka-ale
10 jim: same as xim
11 sumsadmin: j1ka-ale
12 prodtest: j1ka-ale (search forward to Password::)
13 jsoc: _istwamwy
14 Run > chsh to change to /bin/tcsh shell
15 As user postgres:
16 dcs0x:/var/lib/pgsql> initdb -D /var/lib/pgsql/data_sums
17 The files belonging to this database system will be owned by user "postgres".
18 This user must also own the server process.
19
20 The database cluster will be initialized with locale en_US.
21 The default database encoding has accordingly been set to LATIN1.
22 production 1.1 The default text search configuration will be set to "english".
23 fixing permissions on existing directory /var/lib/pgsql/data_sums ... ok
24 creating subdirectories ... ok
25 selecting default max_connections ... 100
26 selecting default shared_buffers ... 32MB
27 creating configuration files ... ok
28 creating template1 database in /var/lib/pgsql/data_sums/base/1 ... ok
29 initializing pg_authid ... ok
30 initializing dependencies ... ok
31 creating system views ... ok
32 loading system objects' descriptions ... ok
33 creating conversions ... ok
34 creating dictionaries ... ok
35 setting privileges on built-in objects ... ok
36 creating information schema ... ok
37 vacuuming database template1 ... ok
38 copying template1 to template0 ... ok
39 copying template1 to postgres ... ok
40
41 WARNING: enabling "trust" authentication for local connections
42 You can change this by editing pg_hba.conf or using the -A option the
43 production 1.1 next time you run initdb.
44
45 Success. You can now start the database server using:
46
47 postgres -D /var/lib/pgsql/data_sums
48 or
49 pg_ctl -D /var/lib/pgsql/data_sums -l /tmp/postgres.sums.log start
50
51 Stop:
52 pg_ctl -D /var/lib/pgsql/data_sums stop [-m fast]
53
54 #Also do:
55 #dcs0x:/var/lib/pgsql> initdb -D /var/lib/pgsql/data_sums
56 #[...]
57
58 Start server:
59 pg_ctl -D /var/lib/pgsql/data_sums -l /tmp/postgres.sums.log start
60
61 ##!! CAN skip this for dcs1x and dcs2x!!!!!!!!!!!!!!!
62 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
63 NOTE: Latter changed the name of the DB below from jsoc to aiadb,
64 production 1.1 and from jsoc_sums to aiadb_sums.
65 As user postgres:
66 dcs0x:/var/lib/pgsql> psql template1
67 psql (8.4.13)
68 Type "help" for help.
69
70 template1=# ALTER DATABASE jsoc RENAME TO aiadb;
71 ALTER DATABASE
72 template1=# \q
73 (First stop sums as user sumsadmin sum_stop)
74 dcs0x:/var/lib/pgsql> psql -p 5434 template1
75 psql (8.4.13)
76 Type "help" for help.
77
78 template1=# ALTER DATABASE jsoc_sums RENAME TO aiadb_sums;
79 ALTER DATABASE
80 template1=# \q
81 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
82
83 edit /home/prodtest/cvs/JSOC/config.local
84 DRMS_DATABASE aiadb
85 production 1.1
86 > cd /home/prodtest/cvs/JSOC/base/sums/apps/data
87 > cp sum_rm.cfg.jsoc_sums sum_rm.cfg.aiadb_sums
88
89 ===================================================================
90
91 > createdb -p 5434 -U postgres aiadb_sums
92 And edit data_sums/postgresql.conf for:
93 port = 5434 # (change requires restart)
94
95 Also add:
96 listen_addresses = '*' # what IP address(es) to listen on;
97
98 Make .pgpass for prodtest and sumsadmin. Fix pg_hba.conf and postgresql.conf.
99
100 > cd /home/prodtest/cvs/JSOC/base/sums/scripts/postgres
101 > psql -p 5434 -U postgres aiadb_sums
102 aiadb_sums=# create user prodtest with password '????????';
103 aiadb_sums=# create user sumsadmin with password '????????';
104 aiadb_sums=# \i create_sums_tables.sql
105 aiadb_sums=# insert into sum_partn_avail values ('/SUM1', 30000000000000, 30000000000000, 0, 0);
106 production 1.1 aiadb_sums=# copy sum_arch_group from '/tmp/sum_arch_group.copy';
107 aiadb_sums=# grant all on sum_tape to sumsadmin;
108 GRANT
109 aiadb_sums=# grant all on sum_ds_index_seq,sum_seq to sumsadmin;
110 GRANT
111 aiadb_sums=# grant all on sum_file,sum_group,sum_main,sum_open to sumsadmin;
112 GRANT
113 aiadb_sums=# grant all on sum_partn_alloc,sum_partn_avail to sumsadmin;
114 GRANT
115 aiadb_sums=# grant all on sum_tape to prodtest;
116 GRANT
117 aiadb_sums=# grant all on sum_ds_index_seq,sum_seq to prodtest;
118 GRANT
119 aiadb_sums=# grant all on sum_file,sum_group,sum_main,sum_open to prodtest;
120 GRANT
121 aiadb_sums=# grant all on sum_partn_alloc,sum_partn_avail to prodtest;
122 aiadb_sums=# \q
123 >
124
125 > su - sumsadmin
126 > scp irisdc:/home/sumsadmin/.tcshrc . #NOTE use dcs0x subsequently for 1x and 2x
127 production 1.1 (also .jimalias, .aliases, .setNEWJSOCenv)
128 Comment out JSOC_COMPILER and JSOC_FCOMPILER in .tcshrc
129 dcs0x:/home/sumsadmin> scp irisdc.stanford.edu:/home/sumsadmin/\* .
130 edit /home/prodtest/cvs/JSOC/config.local to change iris to dcs0x stuff
131 edit /home/sumsadmin/sum_start to add localhost check (!!No, going to take out)
132 As root:
133 mkdir /usr/local/logs/[soc,SUM]
134 chmod g+ws soc SUM
135 [root@dcs1x logs]# chown prodtest soc
136 [root@dcs1x logs]# chgrp sums soc
137 chown sumsadmin SUM
138 chgrp sums SUM
139 mkdir lev0
140 chown prodtest lev0
141 chgrp sums lev0
142 chmod g+ws lev0
143
144 dcs0x:/var/lib/pgsql> pg_ctl -D /var/lib/pgsql/data_drms -l /tmp/postgres.drms.log start
145
146 > pg_ctl -D /var/lib/pgsql/data_drms stop
147
148 production 1.1 Also do:
149 > initdb -D /var/lib/pgsql/data_drms
150 > createdb -p 5432 -U postgres aiadb
151 And edit data_drms/postgresql.conf for:
152 port = 5432 # (change requires restart)
153
154 Also add:
155 listen_addresses = '*' # what IP address(es) to listen on;
156
157 > psql -p 5432 -U postgres aiadb
158 jsoc=# create user postgres with password '????????';
159 or
160 hmidb=# ALTER USER postgres WITH PASSWORD 'j1ka-ale';
161 ALTER ROLE
162 or
163 Edit /var/lib/pgsql/data_drms/pg_hba.conf for no password:
164 local all all trust
165
166 Also do the above for psql -p 5434 -U postgres hmidb_sums
167
168
169 production 1.1 As root:
170 cp /home/prodtest/cvs/JSOC/bin/linux_x86_64/../../_linux_x86_64/base/sums/apps/sum_chmown /usr/local/bin
171 And do:
172 chmod u+s /usr/local/bin/sum_chmown
173 [root@dcs0x bin]# ls -l sum_chmown
174 -rwsr-xr-x 1 root root 10661 May 13 10:01 sum_chmown
175
176 Add to /etc/sudoers (do chmod +w and then after edit chmod -w)
177 NOTE: the dcs0x will have to be changed to dcs0 later.
178 jim dcs0x=NOPASSWD:/bin/chmod, /bin/chown, /usr/bin/mt, /bin/nice
179 sumsadmin dcs0x=NOPASSWD:/bin/chmod, /bin/chown, /bin/mt, /bin/nice
180 prodtest dcs0x=NOPASSWD:/bin/chmod, /bin/chown, /bin/mt, /bin/nice
181
182 See: http://vso.stanford.edu/netdrms/setup.html for making
183 the drms db tables. (as shown below)
184 As user postgres:
185 dcs0x:/var/lib/pgsql> createlang plpgsql aiadb
186 dcs0x:/var/lib/pgsql>
187 dcs0x:/var/lib/pgsql> psql -f /home/prodtest/cvs/JSOC/scripts/NetDRMS.sql aiadb
188 CREATE SCHEMA
189 GRANT
190 production 1.1 CREATE TABLE
191 CREATE TABLE
192 GRANT
193 GRANT
194 dcs0x:/var/lib/pgsql> cd /home/prodtest/cvs/JSOC
195 dcs0x:/home/prodtest/cvs/JSOC> scripts/createpgfuncs.pl aiadb
196 dcs0x:/home/prodtest/cvs/JSOC> cd
197 dcs0x:/var/lib/pgsql> psql -h dcs0x -d aiadb -U postgres
198 jsoc=# create role drmsuser;
199 CREATE ROLE
200 jsoc=# create role sumsadmin;
201 CREATE ROLE
202 jsoc=# \q
203 dcs0x:/var/lib/pgsql> psql -h dcs0x -d aiadb -U postgres
204 jsoc=# create schema drms;
205 CREATE SCHEMA
206 jsoc=# create table drms.minvers (minversion text default '1.0' not null);
207 CREATE TABLE
208 jsoc=# grant select on drms.minvers to public;
209 GRANT
210 jsoc=# GRANT USAGE ON SCHEMA drms TO PUBLIC;
211 production 1.1 GRANT
212 jsoc=# insert into drms.minvers (minversion) values ('1.0');
213 INSERT 0 1
214
215 hmidb=# create user prodtest with password 'j1ka-ale';
216
217 jsoc=# \q
218
219 > masterlists dbuser=prodtest namespace=aia nsgrp=user JSOC_DBHOST=dcs0x
220
221 > psql -U postgres aiadb
222 Password for user postgres:
223 psql (8.4.13)
224 Type "help" for help.
225 jsoc=# insert into admin.sessionns values ('prodtest', 'aia');
226 INSERT 0 1
227 jsoc=# \q
228
229 dcs0x:/home/prodtest/cvs/JSOC/proj/lev0/apps/data> create_series JSOC_DBHOST=dcs0x aia.tlm.jsd
230 Creating new series 'aia.tlm'...
231 NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tlm_pkey" for table "tlm"
232 production 1.1
233 And for now (until Art can fix):
234 setenv JSOC_DBHOST dcs0x (put in .tcshrc)
235
236 And see if need:
237 setenv JSOC_DBNAME aiadb (put in .tcshrc)
238
239 As user jsoc:
240 [jsoc@dcs0x ~]$ cp /home/prodtest/.jimalias .
241 source .jimalias
242 dcs0x:/home/jsoc> mkdir -p bin/linux_x86_64/
243 dcs0x:/home/jsoc/bin/linux_x86_64> ln -s /usr/bin/perl perl
244 > cd
245 > chmod 755 .
246
247 On dcs1 that need the hmi mech tables:
248 As user jsoc.
249 dcs1x:/home/jsoc> mkdir -p cvs/Development/JSOC/proj/tables/
250 > cd cvs/Development/JSOC/proj/tables/
251 dcs1x:/home/jsoc/cvs/Development/JSOC/proj/tables> scp -rp xim:/home/jsoc/cvs/Development/JSOC/proj/tables/hmi_mech .
252
253 production 1.1 Change ingest_lev0_hmiaia.c to use imgdecode_hmiaia.h to get lookup tables
254
255
256 SEE: NOTE above about changing the db names to aiadb and aiadb_sums
257
258 #Edit /home/prodtest/cvs/JSOC/proj/datacapture/apps/ingest_tlm.c
259 ##define DEFAULTDB "aiadb_sums"
260 #Edit /home/prodtest/cvs/JSOC/include/serverdefs.h
261 ##define SERVER "dcs0x"
262 #> make ingest_tlm
263
264 See dcs0x:/home/prodtest/cvs/JSOC/proj/lev0/apps/ingest_lev0_hmiaia.c.
265 and Rules.mk
266
267 Edit /home/prodtest/cvs/JSOC/proj/lev0/apps/SOURCE_ENV_FOR_HK_DECODE to
268 change production to prodtest.
269 change /surge40 to /data and make /data/jsocprod/lev0/hk_hsb_dayfile
270 chmod g+ws chgrp SOI chown prodtest
271
272 mkdir /usr/local/logs/lev0 and fix perms.
273
274 production 1.1 jsd in /home/prodtest/cvs/JSOC/proj/lev0/apps/data
275 create_series aia.lev0_seq_0011.jsd
276 create_series aia.lev0_isp_0011.jsd
277
278 Don't forget to do:
279 > cd /dds/soc2pipe/hmi
280 > mkdir xday
281
282 If need to make a new namespace, e.g. iris, see:
283 irisdc:/home/prodtest/cvs/JSOC/proj/lev0/apps/data/createns.iris
284
285 For apache on dcs1x:
286 As root:
287 > cd /
288 > ln -s /srv web
289 > cd /var
290 > cp -rp www www.BAK
291 > ln -s /web/www www
292 Copy everything from dcs1 /web/www
293 The apache logs are in /etc/httpd/logs
294
295 production 1.1 #No:
296 #>cd /etc/httpd
297 #[root@dcs1x httpd]# scp dcs1:/etc/apache2/default-server.conf .
298
299 Do as root:
300 $ perl -MCPAN -e shell
301 cpan[1]> install DBD::Pg
302
303 In /web/www/cgi-bin/forms_jsocdc_dcs1_SUMS as root change:
304 $HOST = "dcs1x"; #host where the cgi runs
305 $user = "prodtest";
306 $password = "j1ka-ale";
307 $hostdb = "dcs1x"; #host where Postgres runs
308 $PGPORT = 5434;
309
310 [root@dcs1x prodtest]# cd /usr/local
311 [root@dcs1x local]# mkdir -p rdb/bin
312 [root@dcs1x local]# cd rdb/bin
313 [root@dcs1x rdb]# scp dcs1:/usr/local/rdb/bin/justify .
314 cd /web/www
315 ln -s htdocs html
316 production 1.1
317 Apache on dcs1x logs: /var/log/httpd/
318
319 ===============================================================================
320 irisarc:: j1ka-ale
321 irisarc has been configured to communicate with irisdc
322 over the 10g LMSAL link. Its 14TB disk is now mounted
323 on irisdc as /irisarc (owner/group sumsadmin/sums).
324
325 *******************************************************************
326
|