The word database is used in the MySQL sense. It consists of a collection of tables which may reference each other via foreign keys. User accounts may be granted access privileges per database (or even per table, but this shouldn't be necessary).
account and username in this context mean MySQL account and username. They have nothing to do with operating system accounts and usernames.
A single node may have up to three databases. Names come from the set mood_test, mood_user, mood. mood is the production database. mood_user is for testing and development by MOOT users. mood_test is for developers of MOOT itself.
Ultimately — by the time the system is released for production use if not before — some SLAC node (an Offline node like glastlnxXX ?) will be master for all three. Other nodes may be mirrors for one or more. Mobile rack will be mirror for production dbs mood, but need not mirror the others. Other databases will be mirrored only if it is too much trouble to exclude them.
Slaves will be "pure": users will not write to any slave databases. Such databases will receive updates only via MySQL replication. This can be enforced by granting only select privilege to user accounts on the slave.
In order to set up slave replication, use procedure laid out in MySQL replication how-to, keeping in mind that
Main points in the procedure as documented in the MySQL manual are:
CHANGE MASTER TO statement.The master copy of each mood-like database has associated with it a disk file archive, containing Parameter files, FSW input files and Offline Calibration files. These files may only be written by users with update and insert privilege for the associated database; however the typical user with read access to the MySQL database will also need read access to the files. [Those who only want to browse the database interactively and don't need access to the files can use the rdbBrowse program.] In fact, in order to use MOOT services, a user must have defined an environment variable, MOOT_ARCHIVE, which identifies the location of the file archive. From the archive MOOT can determine which is the correct database to connect to and whether write access is allowed. Each slave db supporting MOOT read services must have an associated mirror of the archive. Someone connecting to a slave rather than the master normally is doing so because the master is unreachable or performance is poor, and in this case the master file archive is normally also unreachable.
Files are written to a (user-writable, i.e. master) archive via MOOT, on behalf of the user, as part of the registration process. Ideally, files should be copied to slave archives before the slave database is modified to refer to them, but so far I have no idea how to do this. In practice files will probably be written only sporadically and in bunches, and readers will tend not to need access to newly written files soon after they are registered, so some simple mechanism with no guarantee of proper ordering of operations may be good enough.
| Created: 2 June 2006 Last revised: |
J. Bogart |