-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathirods.txt
5454 lines (4107 loc) · 178 KB
/
irods.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
IRODS
=====
Steven K. Baum
v0.5, 2013-02-18
:doctype: book
:toc:
:icons:
:numbered:
[preface]
Executive Summary
-----------------
iRODS is a distributed filesystem that creates a virtual filesystem consisting
of some combination of directories on the machine on which it is running,
directories on other local and remote machines, and datasets residing on other
servers such as THREDDS and ERDDAP. This virtual filesystem makes access to
the datasets residing in all those places transparent to the user. When using
an iRODS client program, the user will see a list of available files and -
depending on the capabilities of the browser - be able to peruse file
metadata, download a file, and/or select and download spatial and temporal
subsets of a file.
A perspective on distributed filesystems can be obtained by a paper that
compares six of them including iRODS:
http://hal.archives-ouvertes.fr/docs/00/78/90/86/PDF/a_survey_of_dfs.pdf[+http://hal.archives-ouvertes.fr/docs/00/78/90/86/PDF/a_survey_of_dfs.pdf+]
wherein a distributed filesystem (DFS) is defined to "provide permanent
storage for sharing multiple files, and build a hierarchical and unified
view of these files by federating storage resources dispersed in a network."
A DFS should be:
* *transparent*: users should be able to access the system from wherever they
choose to log in, be able to perform the same operations on the DFS as they
can on their local filesystem (list files, obtain file sizes, etc.), and
should not have to worry about faults due to the distributed nature of the
filesystem thanks to fault tolerance mechanisms.
* *fault tolerant*: a fault tolerant system should not have to be stopped
because of transient or partial failures, with the list of possible faults
including network and server failures that make data and services
unavailable, and data integrity and consistency when several users
concurrently access data.
* *scalable*: the system should be able to efficiently leverage large numbers
of servers that are dynamically and continuously added to the system.
Overview
--------
Documentation about the iRODS (Integrated Rule-Oriented Data
System) package, a highly-configurable, open source technology used in
multiple high-demand production sites globally for data management, sharing
and integration. iRODS is data grid middleware, a data management
infrastructure, and a framework for implementing data policy.
The system is a generic software infrastructure that can be tuned to
implement any desired data management application, including:
* a data grid for sharing data across collaborations;
* a digital library for publishing data;
* a preservation environment for long-term data retention;
* a data processing pipeline; and
* a system for federating real-time sensor data streams.
The key features of iRODS are that it:
* manages and automates data operations across distributed, heterogeneous
systems;
* functions independently of storage resources, i.e. it abstracts data
control away from the storage devices and device location; and
* the middleware layer allows data stewards to develop data services to
meet user needs without involving system administrators.
iRODS has a centralized architecture with two major components:
* the *iCat server* that stores metadata in a database and handles
queries to the metadata; and
* several *iRODS servers* that store data to storage resources.
An iCat server and several iRODS servers form a *zone*.
A zone can interoperate with other independent iRODS zones as
a federation of zones wherein each zone continues to operate
as a separate iRODS instance with separate administration.
Users in the various zones will be able - if given
permission - to access data and metadata from other zones, with
the authentication provided at the user's original zone
propagating automatically to the other zones.
The major features of the iRODS architecture are:
* a *data grid architecture* based on a client/server model that controls
interactions with distributed storage and compute resources;
* a *metadata catalog* managed in a database system (e.g. MySQL, PostgreSQL)
for maintaining the attributes of data and state informatino generated by
remote operations; and
* a *rule system* for enforcing and executing adaptive rules.
The iRODS system expresses management policies as computer actionable
rules, and management procedures as sets of remotely executable
services called microservices. The rules control the execution of the
microservices, and the state information generated is stored in a
metadata catalog.
Resources
~~~~~~~~~
https://irods.org/[+https://irods.org/+]
iRODS 4.0.0 Manual (PDF) -
http://irods.org/dev/wp-content/uploads/2014/03/irods-manual-4.0.0.pdf[+http://irods.org/dev/wp-content/uploads/2014/03/irods-manual-4.0.0.pdf+]
iRODS Overview (PDF) -
http://irods.org/dev/wp-content/uploads/2012/04/SC12-iRODS-overview.pdf[+http://irods.org/dev/wp-content/uploads/2012/04/SC12-iRODS-overview.pdf+]
iRODS Overview: Intro. to Data Grids, Policy-Driven Data Management, and
Enterprise iRODS -
http://eirods.org/dev/wp-content/uploads/2012/08/irods-intro.pdf[+http://eirods.org/dev/wp-content/uploads/2012/08/irods-intro.pdf+]
iRODS Tutorial: I. Getting Started (PDF) -
http://eirods.org/dev/wp-content/uploads/2012/08/irods-getting-started.pdf[+http://eirods.org/dev/wp-content/uploads/2012/08/irods-getting-started.pdf+]
iRODS Tutorial: II. Data Grid Administration (PDF) -
http://eirods.org/dev/wp-content/uploads/2012/08/irods-admin.pdf[+http://eirods.org/dev/wp-content/uploads/2012/08/irods-admin.pdf+]
Microservice Developers Tutorial (PDF) -
http://irods.org/dev/wp-content/uploads/2012/04/microservice_tutorial.pdf[+http://irods.org/dev/wp-content/uploads/2012/04/microservice_tutorial.pdf+]
Resource Plugin Tutorial (PDF) -
http://irods.org/dev/wp-content/uploads/2012/04/Resource_Plugin_Tutorial_20131114.pdf[+http://irods.org/dev/wp-content/uploads/2012/04/Resource_Plugin_Tutorial_20131114.pdf+]
Composable Resources (PDF) -
http://irods.org/dev/wp-content/uploads/2013/02/eirods-composable-resources.pdf[+http://irods.org/dev/wp-content/uploads/2013/02/eirods-composable-resources.pdf+]
iRODS Admin Interface (PDF) -
http://eirods.org/dev/wp-content/uploads/2013/03/scotty-irods-admin-interface.pdf[+http://eirods.org/dev/wp-content/uploads/2013/03/scotty-irods-admin-interface.pdf+]
iRODS Wiki -
https://wiki.irods.org/index.php/IRODS:Data_Grids,_Digital_Libraries,_Persistent_Archives,_and_Real-time_Data_Systems[+https://wiki.irods.org/index.php/IRODS:Data_Grids,_Digital_Libraries,_Persistent_Archives,_and_Real-time_Data_Systems+]
EUDAT iRODS Deployment -
http://www.eudat.eu/User%20Documentation%20-%20iRODS%20Deployment.html[+http://www.eudat.eu/User%20Documentation%20-%20iRODS%20Deployment.html+]
iRODS Usage at GBIO -
http://gbio-pbil.ibcp.fr/en/cblanchet/irods/[+http://gbio-pbil.ibcp.fr/en/cblanchet/irods/+]
Analysis of Six Distributed File Systems (PDF) -
http://hal.archives-ouvertes.fr/docs/00/78/90/86/PDF/a_survey_of_dfs.pdf[+http://hal.archives-ouvertes.fr/docs/00/78/90/86/PDF/a_survey_of_dfs.pdf+]
Videos
^^^^^^
iRODS on YouTube -
http://www.youtube.com/results?search_query=irods[+http://www.youtube.com/results?search_query=irods+]
DICE Research on YouTube -
http://www.youtube.com/channel/UCNep6KfyRu7IgxEXZvAmv1g[+http://www.youtube.com/channel/UCNep6KfyRu7IgxEXZvAmv1g+]
iRODS: The Integrated Rule Oriented Data-Management System (10:10) -
http://www.youtube.com/watch?v=QwZTGzNJCnc[+http://www.youtube.com/watch?v=QwZTGzNJCnc+]
Policy Based Preservation Environments (iRODS) (51:05) -
http://www.youtube.com/watch?v=SYqEVgdtnes[+http://www.youtube.com/watch?v=SYqEVgdtnes+]
iDrop Suite Overview, Part 1 (8:31) -
http://www.youtube.com/watch?v=YhciVQCZuBY[+http://www.youtube.com/watch?v=YhciVQCZuBY+]
iDrop Suite Overview, Part 2 (7:22) -
http://www.youtube.com/watch?v=1pu_EU3rmkU[+http://www.youtube.com/watch?v=1pu_EU3rmkU+]
Large Scale Storage for Data Intensive Science at KIT (28:30) -
http://www.youtube.com/watch?v=Cqxepa999Jc[+http://www.youtube.com/watch?v=Cqxepa999Jc+]
Extensions
~~~~~~~~~~
In addition to the built-in functionality, there are many extensions including
features, interfaces and drivers that increase its functionality via
third-party software. A list of the available extensions can be found at:
https://wiki.irods.org/index.php/Extensions[+https://wiki.irods.org/index.php/Extensions+]
Obtaining and Installing
------------------------
Source and binary distributions are available at:
https://irods.org/download/[+https://irods.org/download/+]
Installation instructions are found at:
https://wiki.irods.org/index.php/Installation[+https://wiki.irods.org/index.php/Installation+]
Source Distribution
~~~~~~~~~~~~~~~~~~~
The source distribution is located on GitHub at:
https://github.com/irods/irods[+https://github.com/irods/irods+]
and can be downloaded via the command:
-----
su
cd /var/lib
git clone https://github.com/irods/irods.git
-----
As of this writing, this must be done in the +/var/lib+ directory.
After it has been downloaded into the directory +irods+, it is
compiled via:
-----
./packaging/build.sh icat postgres
./packaging/build.sh icommands
./packaging/build.sh resource
-----
The options for +build.sh+ are obtained by running it with no
arguments:
-----
+------------------------------------+
| RENCI iRODS Build Script |
+------------------------------------+
Tue Apr 15 13:21:29 CDT 2014
Usage: build.sh [OPTIONS] <serverType> [databaseType]
Usage: build.sh docs
Usage: build.sh clean
Options:
-c Build with coverage support (gcov)
-h Show this help
-r Build a release package (no debugging information, optimized)
-s Skip compilation of iRODS source
-p Portable option, ignores OS and builds a tar.gz
Long Options:
--run-in-place Build server for in-place execution (not recommended)
Examples:
build.sh icat postgres
build.sh resource
build.sh -s icat postgres
build.sh -s resource
-----
Installing RPM Files
~~~~~~~~~~~~~~~~~~~~
The +RPM_INSTALLATION_HOWTO.txt+ file at:
ftp://ftp.renci.org/pub/irods/releases/4.0.0/[+ftp://ftp.renci.org/pub/irods/releases/4.0.0/+]
tell us what we need to do before we starting installing the RPMs.
-----
1. Yum Install Required Dependencies ::
-- Note - names may change slightly between different OS versions, which can be determined by 'yum search package-name'
postgresql
postgresql-server
unixODBC
perl
authd
AND
postgresql-odbc (could also be postgresqlXX-odbc)
- also needs to be installed, but this is not declared in the RPM due to issues with versioning resolution
-----
On barataria: All packages already installed via checking via +rpm -q+.
-----
2. Start Postgres Server and Initialize Database Tables ::
CentOS 5.x :: sudo /sbin/service postgresql start
CentOS 6.x :: sudo /sbin/service postgresql initdb; sudo /sbin/service postgresql start
SUSE11 :: sudo /usr/sbin/rcpostgresql start
OpenSUSE12 :: sudo /usr/sbin/rcpostgresql start
-----
On barataria: PostgreSQL server already initialized and started. Checked
with +/etc/init.d/postgresql status+.
-----
3. Modify authd config file for xinetd.d ::
vim /etc/xinetd.d/auth
Remove the '-E' command line argument for auth ::
changing :
[ server_args = -t60 --xerror --os -E ]
to :
[ server_args = -t60 --xerror --os ]
-----
On barataria: The +-E+ command line argument was already gone.
-----
4. Set the proper runlevel for authd ::
sudo /sbin/chkconfig --level=3 auth on
-----
On barataria: Entered command +/sbin/chkconfig --level=3 auth on+.
-----
5. Restart xinetd
sudo /etc/init.d/xinetd restart
-----
On barataria: Entered command +/etc/init.d/xinetd restart+.
-----
6. Open your firewall, if necessary, to let in iRODS ::
Add the following to your /etc/sysconfig/iptables:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1247 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20000:20199 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 20000:20199 -j ACCEPT
Restart the firewall:
sudo service iptables restart
-----
On barataria: Not done yet.
-----
7. Install the iRODS RPM ::
rpm -i irods-XXX.rpm
-----
Now we can start installing the RPMs on barataria. They are
located in:
-----
/home/baum/IRODS
-----
irods-icat
^^^^^^^^^^
The irods-icat RPM package installs a service account and group named +irods+
and the iRODS binaries.
Running:
-----
rpm -ivh irods-icat-4.0.0-64bit-centos5.rpm
-----
gives:
-----
Preparing... ########################################### [100%]
Creating Service Group and Account: irods at /var/lib/irods
1:irods-icat ########################################### [100%]
=======================================================================
Welcome to iRODS.
This installation of an iCAT server is currently incomplete and
needs a database plugin to be installed and configured before
it can be started and used.
Please consult the manual for further instructions.
=======================================================================
-----
irods-runtime
^^^^^^^^^^^^^
Running:
-----
rpm -ivh irods-runtime-4.0.0-64bit-centos5.rpm
-----
gives:
-----
Preparing... ########################################### [100%]
1:irods-runtime ########################################### [100%]
-----
irods-resource
^^^^^^^^^^^^^^
The irods-resource RPM installs a service acccount and group named +irods+ and
the iRODS binaries.
Running:
-----
rpm -ivh irods-resource-4.0.0-64bit-centos5.rpm
-----
gives:
-----
Preparing... ########################################### [100%]
file /etc/irods/irods.config from install of irods-resource-4.0.0-0.x86_64 conflicts with file from package irods-icat-4.0.0-0.x86_64
file /var/lib/irods/iRODS/config/config.mk from install of irods-resource-4.0.0-0.x86_64 conflicts with file from package irods-icat-4.0.0-0.x86_64
file /var/lib/irods/iRODS/server/bin/irodsAgent from install of irods-resource-4.0.0-0.x86_64 conflicts with file from package irods-icat-4.0.0-0.x86_64
file /var/lib/irods/iRODS/server/bin/irodsReServer from install of irods-resource-4.0.0-0.x86_64 conflicts with file from package irods-icat-4.0.0-0.x86_64
file /var/lib/irods/iRODS/server/bin/irodsServer from install of irods-resource-4.0.0-0.x86_64 conflicts with file from package irods-icat-4.0.0-0.x86_64
-----
Moving on the force things we get:
-----
[root@barataria IRODS]# rpm -ivh --force irods-resource-4.0.0-64bit-centos5.rpm
Preparing... ########################################### [100%]
Creating Service Group and Account: irods at /var/lib/irods
ERROR :: Please delete the existing Service Group irods before proceeding.
error: %pre(irods-resource-4.0.0-0.x86_64) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping irods-resource-4.0.0-0
-----
We can't just delete the group without deleting the user, which
also deletes the group. This is done via:
-----
/usr/sbin/userdel irods
-----
after which - upon trying the RPM again - we obtain:
-----
Preparing... ########################################### [100%]
Creating Service Group and Account: irods at /var/lib/irods
1:irods-resource ########################################### [100%]
=======================================================================
Welcome to iRODS.
This installation of a resource server is currently incomplete and
needs the following steps executed as the service account "irods":
sudo su - irods
As the service account user, executing the following script will
prompt for necessary iRODS iCAT server information and then
populate your irods.config accordingly:
./packaging/setup_resource.sh
This will result in a running resource server with a default
resource named with your hostname concatenated with "Resource"
and a local vault in ~/iRODS/Vault.
Please consult the manual for further configuration details.
=======================================================================
-----
irods-icommands
^^^^^^^^^^^^^^^
-----
rpm -ivh irods-icommands-4.0.0-64bit-centos5.rpm
-----
on barataria gives:
-----
Preparing... ########################################### [100%]
1:irods-icommands ########################################### [100%]
###########################################################
#
# The iCommands have been installed into your path.
#
# They require your environment to be configured
# for communication with an iRODS server.
#
# Place the following configuration information into
# your .irodsEnv file and edit as appropriate:
#
# ~/.irods/.irodsEnv
#
###########################################################
# iRODS server host name:
irodsHost 'FULLY.QUALIFIED.DOMAIN.NAME'
# iRODS server port number:
irodsPort 1247
# Default storage resource name:
irodsDefResource 'demoResc'
# Home directory in iRODS:
irodsHome '/tempZone/home/USERNAME'
# Current directory in iRODS:
irodsCwd '/tempZone/home/USERNAME'
# Account name:
irodsUserName 'USERNAME'
# Zone:
irodsZone 'tempZone'
# Enable Advanced Client-Server negotiation:
irodsClientServerNegotiation 'request_server_negotiation'
# Client-Server connection policy:
irodsClientServerPolicy 'CS_NEG_REFUSE'
# Client-Server Encryption Key Size In Bytes:
irodsEncryptionKeySize '32'
# Client-Server Encryption Salt Size In Bytes:
irodsEncryptionSaltSize '8'
# Client-Server Encryption Number of Hash Rounds:
irodsEncryptionNumHashRounds '16'
# Client-Server Encryption Algorithm:
irodsEncryptionAlgorithm 'AES-256-CBC'
-----
irods-dev
^^^^^^^^^
Running:
-----
rpm -ivh irods-dev-4.0.0-64bit-centos5.rpm
-----
gives:
-----
Preparing... ########################################### [100%]
1:irods-dev ########################################### [100%]
-----
irods-database-plugin-postgres
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Running:
-----
rpm -ivh irods-database-plugin-postgres-1.0-centos5.rpm
-----
gives:
-----
Preparing... ########################################### [100%]
1:irods-database-plugin-p########################################### [100%]
=======================================================================
iRODS Postgres Database Plugin installation was successful.
To configure this plugin, the following prerequisites need to be met:
- an existing database user (to be used by the iRODS server)
- an existing database (to be used as the iCAT catalog)
- permissions for existing user on existing database
Please run the following setup script as the irods user:
./packaging/setup_database.sh
=======================================================================
-----
Preparing PostgreSQL for iRODS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A database and a user must first be created from within PostgreSQL.
-----
su
su - postgres
-bash-3.2$ createdb icat
CREATE DATABASE
-bash-3.2$ psql
Welcome to psql 8.1.23, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=# create database icat;
CREATE DATABASE
postgres=# create user irods;
postgres=# select * from "pg_user";
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig
| | | | | | |
postgres | 10 | t | t | t | ******** | |
irods | 16385 | f | f | f | ******** | |
(2 rows)
postgres=# \l
List of databases
Name | Owner | Encoding
+ +
icat | postgres | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(4 rows)
postgres=# alter database icat owner to irods;
ALTER DATABASE
postgres=# \l
List of databases
Name | Owner | Encoding
+ +
icat | irods | UTF8
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(4 rows)
icat=# grant all on database icat to irods
GRANT
icat=# alter user irods with password 'g*';
icat=# alter user irods valid until 'infinity';
postgres=# \q
exit
-----
Next set up iRODS by running +setup_database.sh+, which is:
The Bash Script +setup_database.sh+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Next set up iRODS by running +setup_database.sh+, which is:
[source,bash]
-----
#!/bin/bash -e
DATABASETYPE="postgres"
DEFAULT_DATABASEPORT="5432"
# config
IRODS_CONFIG_FILE="/etc/irods/irods.config"
SETUP_DATABASE_FLAG="/tmp/$USER/setup_database.flag"
# get into the irods user home directory
DETECTEDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DETECTEDDIR/../
# get temp file from prior run, if it exists
mkdir -p /tmp/$USER
if [ -f $SETUP_DATABASE_FLAG ] ; then
# have run this before, read the existing config file
DATABASEHOSTORIP=`grep "DATABASE_HOST =" $IRODS_CONFIG_FILE | awk -F\' '{print $2}'`
DATABASEPORT=`grep "DATABASE_PORT =" $IRODS_CONFIG_FILE | awk -F\' '{print $2}'`
DATABASENAME=`grep "DB_NAME =" $IRODS_CONFIG_FILE | awk -F\' '{print $2}'`
DATABASEUSER=`grep "DATABASE_USER =" $IRODS_CONFIG_FILE | awk -F\' '{print $2}'`
STATUS="loop"
else
# no temp file, this is the first run
STATUS="firstpass"
fi
echo "==================================================================="
echo ""
echo "You are installing an iRODS database plugin."
echo ""
echo "The iRODS server cannot be started until its database"
echo "has been properly configured."
echo ""
while [ "$STATUS" != "complete" ] ; do
# set default values from an earlier loop
if [ "$STATUS" != "firstpass" ] ; then
LASTDATABASEHOSTORIP=$DATABASEHOSTORIP
LASTDATABASEPORT=$DATABASEPORT
LASTDATABASENAME=$DATABASENAME
LASTDATABASEUSER=$DATABASEUSER
fi
# get host
echo -n "Database server's hostname or IP address"
if [ "$LASTDATABASEHOSTORIP" ] ; then echo -n " [$LASTDATABASEHOSTORIP]"; fi
echo -n ": "
read DATABASEHOSTORIP
if [ "$DATABASEHOSTORIP" == "" ] ; then
if [ "$LASTDATABASEHOSTORIP" ] ; then DATABASEHOSTORIP=$LASTDATABASEHOSTORIP; fi
fi
# strip all forward slashes
DATABASEHOSTORIP=`echo "${DATABASEHOSTORIP}" | sed -e "s/\///g"`
echo ""
# get port
echo -n "Database server's port"
if [ "$LASTDATABASEPORT" ] ; then
echo -n " [$LASTDATABASEPORT]"
else
echo -n " [$DEFAULT_DATABASEPORT]"
fi
echo -n ": "
read DATABASEPORT
if [ "$DATABASEPORT" == "" ] ; then
if [ "$LASTDATABASEPORT" ] ; then
DATABASEPORT=$LASTDATABASEPORT
else
DATABASEPORT=$DEFAULT_DATABASEPORT
fi
fi
# strip all forward slashes
DATABASEPORT=`echo "${DATABASEPORT}" | sed -e "s/\///g"`
echo ""
# get the db name
echo -n "Database name"
if [ "$LASTDATABASENAME" ] ; then
echo -n " [$LASTDATABASENAME]"
else
echo -n " [ICAT]"
fi
echo -n ": "
read DATABASENAME
if [ "$DATABASENAME" == "" ] ; then
if [ "$LASTDATABASENAME" ] ; then
DATABASENAME=$LASTDATABASENAME
else
DATABASENAME="ICAT"
fi
fi
# strip all forward slashes
DATABASENAME=`echo "${DATABASENAME}" | sed -e "s/\///g"`
echo ""
# get database user
echo -n "Database username"
if [ "$LASTDATABASEUSER" ] ; then
echo -n " [$LASTDATABASEUSER]"
else
echo -n " [irods]"
fi
echo -n ": "
read DATABASEUSER
if [ "$DATABASEUSER" == "" ] ; then
if [ "$LASTDATABASEUSER" ] ; then
DATABASEUSER=$LASTDATABASEUSER
else
DATABASEUSER=irods
fi
fi
# strip all forward slashes
ADMINUSER=`echo "${DATABASEUSER}" | sed -e "s/\///g"`
echo ""
echo -n "Database password: "
# get db password, without showing on screen
read -s DATABASEPASSWORD
echo ""
echo ""
# confirm
echo "-------------------------------------------"
echo "Database Type: $DATABASETYPE"
echo "Hostname or IP: $DATABASEHOSTORIP"
echo "Database Port: $DATABASEPORT"
echo "Database Name: $DATABASENAME"
echo "Database User: $DATABASEUSER"
echo "Database Password: Not Shown"
echo "-------------------------------------------"
echo -n "Please confirm these settings [yes]: "
read CONFIRM
if [ "$CONFIRM" == "" -o "$CONFIRM" == "y" -o "$CONFIRM" == "Y" -o "$CONFIRM" == "yes" ]; then
STATUS="complete"
else
STATUS="loop"
fi
echo ""
echo ""
done
touch $SETUP_DATABASE_FLAG
echo "==================================================================="
IRODS_CONFIG_TEMPFILE="/tmp/$USER/tmp.irods.config"
echo "Updating irods.config..."
sed -e "/^\$DATABASE_TYPE/s/^.*$/\$DATABASE_TYPE = '$DATABASETYPE';/" $IRODS_CONFIG_FILE > $IRODS_CONFIG_TEMPFILE
mv $IRODS_CONFIG_TEMPFILE $IRODS_CONFIG_FILE
sed -e "/^\$DATABASE_HOST/s/^.*$/\$DATABASE_HOST = '$DATABASEHOSTORIP';/" $IRODS_CONFIG_FILE > $IRODS_CONFIG_TEMPFILE
mv $IRODS_CONFIG_TEMPFILE $IRODS_CONFIG_FILE
sed -e "/^\$DATABASE_PORT/s/^.*$/\$DATABASE_PORT = '$DATABASEPORT';/" $IRODS_CONFIG_FILE > $IRODS_CONFIG_TEMPFILE
mv $IRODS_CONFIG_TEMPFILE $IRODS_CONFIG_FILE
sed -e "/^\$DATABASE_ADMIN_NAME/s/^.*$/\$DATABASE_ADMIN_NAME = '$DATABASEUSER';/" $IRODS_CONFIG_FILE > $IRODS_CONFIG_TEMPFILE
mv $IRODS_CONFIG_TEMPFILE $IRODS_CONFIG_FILE
sed -e "/^\$DB_NAME/s/^.*$/\$DB_NAME = '$DATABASENAME';/" $IRODS_CONFIG_FILE > $IRODS_CONFIG_TEMPFILE
mv $IRODS_CONFIG_TEMPFILE $IRODS_CONFIG_FILE
# =-=-=-=-=-=-=-
# update database flavor
if [ -e /etc/irods/server.config ] ; then
server_config="/etc/irods/server.config"
else
server_config="./iRODS/server/config/server.config"
fi
echo ""
echo "# configuration of icat database plugin - e.g. postgres, mysql, or oracle" >> $server_config
echo "catalog_database_type $DATABASETYPE" >> $server_config
echo ""
# =-=-=-=-=-=-=-
# run irods_setup.pl
cd iRODS
./irodsctl stop
echo "Running irods_setup.pl..."
perl ./scripts/perl/irods_setup.pl $DATABASETYPE $DATABASEHOSTORIP $DATABASEPORT $DATABASEUSER $DATABASEPASSWORD
-----
At the end of this bash script, the following Perl command is run to set up
the PostgreSQL database:
-----
perl ./scripts/perl/irods_setup.pl $DATABASETYPE $DATABASEHOSTORIP $DATABASEPORT $DATABASEUSER $DATABASEPASSWORD
-----
But running this by itself still doesn't work.
The script stalls right before it's supposed to run the SQL creation files:
-----
/var/lib/irods/iRODS/server/icat/src/icatSysTables.sql
/var/lib/irods/iRODS/server/icat/src/icatSysInserts.sql
-----
So we'll just run the commands within those files by hand. Be sure
to become the user +irods+ before this is done.
Even after creating the tables we still get the "could not list tables"
error, so we go into the appropriate section of:
-----
/var/lib/irods/iRODS/scripts/perl/irods_setup.pl
-----
to find:
[source,perl]
-----
# Create the tables.
# The iCAT SQL files issue a number of instructions to
# create tables and initialize state. If this script
# has been run before, then these tables will already be
# there. Running the SQL instructions a second time
# will corrupt the database. So, we need to check first.
printStatus( "Creating iCAT tables...\n" );
printLog( "Creating iCAT tables...\n" );
my $tables = listDatabaseTables( $DB_NAME );
if ( ! defined( $tables ) )
{
printError( "\nInstall problem:\n" );
printError( " Could not list tables in the database:\n" );
printError( " ", $output );
printLog( "\nSQL failed:\n" );
printLog( " ", $output );
cleanAndExit( 1 );
}
-----
where +listDatabaseTables+ is the subroutine:
[source,perl]
-----
sub listDatabaseTables()
{
my ($dbname) = @_;
# Postgres
if ( $DATABASE_TYPE eq "postgres" )
{
return Postgres_ListDatabaseTables( $dbname );
}
# Oracle
if ( $DATABASE_TYPE eq "oracle" )
{
return Oracle_ListDatabaseTables( $dbname );
}
# MySQL
if ( $DATABASE_TYPE eq "mysql" )
{
return MySQL_ListDatabaseTables( $dbname );
}
# Empty
if ( $DATABASE_TYPE eq "" )
{
printStatus( " Skipped. No database to access.\n" );
printLog( " Skipped. No database to access.\n" );
return undef;
}
# Otherwise skip it.
printStatus( " Skipped. Unsupported database type: $DATABASE_TYPE.\n" );
printLog( " Skipped. Unsupported database type: $DATABASE_TYPE.\n" );
return undef;
}
-----
and +Postgres_ListDatabaseTables+ is the subroutine:
[source,perl]
-----
sub Postgres_ListDatabaseTables($)
{
my ($dbname) = @_;
# Using psql, issue the \d command for a list of tables.
my $tmpSql = createTempFilePath( "sql" );
printToFile( $tmpSql, "\n\\d\n" );
($status,$output) = execute_sql( $dbname, $tmpSql );
unlink( $tmpSql );
if ( $status == 0 )
{
return $output;
}
printLog( " Cannot get list of tables from Postgres:\n" );
printLog( " ", $output );
return undef;
}
-----
Next...
-----
su - irods
-bash-3.2$ ./packaging/setup_database.sh
===================================================================
You are installing an iRODS database plugin.
The iRODS server cannot be started until its database
has been properly configured.
Database server's hostname or IP address [barataria.tamu.edu]:
Database server's port [5432]:
Database name [icat]:
Database username [irods]:
Database password:
-------------------------------------------
Database Type: postgres
Hostname or IP: barataria.tamu.edu
Database Port: 5432
Database Name: icat
Database User: irods
Database Password: Not Shown
-------------------------------------------
Please confirm these settings [yes]:
===================================================================
Updating irods.config...
Stopping iRODS server...
Found 0 processes:
There are no iRODS servers running.
Running irods_setup.pl...
Step 1 of 5: Configuring database user...
Updating user's .pgpass...
Skipped. File already uptodate.
Step 2 of 5: Creating database and tables...
Checking whether iCAT database exists...
Skipped creating iCAT database, it already exists.
Updating user's .odbc.ini...
Creating iCAT tables...
Install problem: