release notes | Book: 1.9.5, 1.9.12 (opt, FHS), 2.11 (FHS), 2.12 (FHS), 2.13 (FHS), 2.14 (FHS), | Wiki | Q&A black_bg
Web: Multi-page, Single page | PDF: A4-size, Letter-size | eBook: epub black_bg

The Databases of pnfs

pnfs stores all the information in GNU dbm database files. Since each operation will lock the database file used globally and since GNU dbm cannot handle database files larger than 2GB, it is advisable to split them sutably to future usage. Each database stores the information of a sub-tree of the pnfs filesystem namespace. Which database is responsible for a directory and subsequent subdirectories is determined at creation time of the directory. The following procedure will create a new database and connect a new subdirectory to it.

Each database is handled by a separate server process. The maximum number of servers is set by the variable shmservers in file /usr/etc/pnfsSetup. Therefore, take care that this number is always higher than the number of databases that will be used (restart pnfs services, if changed).

Prepare the environment with

[root] # . /usr/etc/pnfsSetup
[root] # PATH=${pnfs}/tools:$PATH

To get a list of currently existing databases, issue

[root] # mdb show
ID Name Type Status Path
-------------------------------
0 admin r enabled (r) /opt/pnfsdb/pnfs/databases/admin
1 data1 r enabled (r) /opt/pnfsdb/pnfs/databases/data1

Choose a new database name <databaseName> and a location for the database file <databaseFilePath> (just a placeholder for the PostgreSQL version of pnfs) and create it with

[root] # mdb create <databaseName> <databaseFilePath>

e.g.

[root] # mdb create data2 /opt/pnfsdb/pnfs/databases/data2

Make sure the file <databaseFilePath> exists with

[root] # touch <databaseFilePath>

This might seem a little strange. The reason is that the PostgreSQL version of the pnfs server only uses the file as reference and stores the actual data in the PostgreSQL server.

In order to refresh database information run

[root] # mdb update
Starting data2

Running command mdb show shows the new database:

[root] # mdb show
ID Name Type Status Path
-------------------------------
0 admin r enabled (r) /opt/pnfsdb/pnfs/databases/admin
1 data1 r enabled (r) /opt/pnfsdb/pnfs/databases/data1
2 data2 r enabled (r) /opt/pnfsdb/pnfs/databases/data2

In the pnfs filesystem tree, create the new directory in the following way

[root] # cd /pnfs/<site.de>/<some/sub/dir>/
[root] # mkdir '.(<newDbID>)(<newDirectory>)'

where <newDbID> is the ID of the new database as listed in the output of mdb show and <newDirectory> is the name of the new directory. E.g.

[root] # cd /pnfs/desy.de/data/zeus/
[root] # mkdir '.(2)(mcdata)'

The new database does not know anything about the wormhole '.(config)()', yet. For this, the pnfs ID of the wormhole directory (/pnfs/fs/admin/etc/config/) has to be specified. It can be found out with

[root] # sclient getroot ${shmkey} 0
0 000000000000000000001000 <wormholePnfsId>

The last pnfsID is the one of the wormhole directory of the database with ID 0 (already set correctly). Now you can set this ID with

[root] # sclient getroot ${shmkey} <newDbID> <wormholePnfsId>
<newDbID> 000000000000000000001000 <wormholePnfsId>

For example, do the following

[root] # sclient getroot ${shmkey} 0
0 000000000000000000001000 0000000000000000000010E0
[root] # sclient getroot ${shmkey} 2 0000000000000000000010E0
2 000000000000000000001000 0000000000000000000010E0

Finally, add directory tags for the new directories. The default tags are added by

[root] # cd /pnfs/<site.de>/<some/sub/dir>/<newDirectory>
[root] # echo 'StoreName myStore' > '.(tag)(OSMTemplate)'
[root] # echo 'STRING' > '.(tag)(sGroup)'