-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
101 lines (60 loc) · 2.93 KB
/
README
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
SGAS LUTS3 Client
== Installation ==
python setup.py install
If you just need to use the scripts, you can just use them directly from
unpacked tarball. No need to install.
== Usage ==
There are currently for tools/script in the package:
sgas-ur-register Register usage records to an SGAS instance.
sgas-ur-update Upgrade the usage records format (CouchDB only).
sgas-db-migrate Migrate from CouchDB to another, while updating _id
sgas-postgres-migrate Create PostgreSQL insert statements from CouchDB.
Usage of the four tools follows:
=== sgas-ur-register ===
To register usage records to an SGAS instance:
sgas-ur-register <url> <urfile1> [<urfile2> ...]
e.g.,
sgas-ur-register https://orval.grid.aau.dk:7143/sgas ur1.xml
By default the host certificate will be used. It is possible to use other
certificates. Run "sgas-ur-register --help" for more information.
=== sgas-ur-update ===
To update old document versions:
sgas-ur-update <couchdb-url>
e.g.,
./sgas-ur-update http://localhost:7984/usagerecords
It is recommended to create a replica database and try the operations on that
first. Note: This will take for bloody ever on a big database.
=== sgas-db-migrate ===
The sgas-db-migrate will read all the documents from one CouchDB collection,
transform the _id field to the new smaller format, and insert the document into
another collection.
1. Stop SGAS (i.e., /etc/init.d/sgas stop)
2. Create a new database with the web interface (http://localhost:5984/_utils/)
3. Run the migration script, e.g,
./sgas-db-migrate http://localhost:5984/db-source http://localhost:5984/db-target
4. Change the SGAS database to use new collection (edit /etc/sgas.conf)
5. Update SGAS to 3.1.0 or later (can be done in paralllel with running the migration script)
6. Start SGAS.
You probably want to perform compaction on the database, and views (must be
done after initial generation for the views).
=== sgas-postgres-migrate ===
The script will read all documents from a CouchDB database and produce insert
statements for the SGAS PostgreSQL schema.
Usage: ./sgas-postgres-migrate <couchdb-url> <records.sql>
e.g.,
./sgas-postgres-migrate http://localhost:5984/usagerecords usagerecords.sql
The script can be run while SGAS is still running, however usage records which
inserted during the script is running, is not guarantied to be included. After
the file has been created start "psql <database>" and do: \i records.sql
=== sgas-sr-registrant ===
Client for registering storage records to SGAS. The client will need a
configuration file, which typically look like this:
---
[logger]
log_dir=/var/spool/sgas/
log_all="https://orval.grid.aau.dk:8143/sgas"
registrant_logfile=/var/spool/sgas-sr-registrant.log
---
The log_all entry should be the only required attribute (the [logger] section
must also be present). The configuration file is specified with -c. The client
is typically invoked with cron at a regular interval.