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