Add a configuration database, implemented as a persistent database.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 25 Aug 2010 01:37:32 +0000 (11:37 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 25 Aug 2010 01:49:56 +0000 (11:49 +1000)
commit292d7435a360efd7f15a7a99f658a605e07c0a81
treee15de75d4a429579f1cf52f9949533ac43710273
parent9999771105d7105efaa232fe2842e21e66f78706
Add a configuration database, implemented as a persistent database.

This database can be used, as an option, to store
the public address assignment instead of editing the /etc/ctdb/public-addresses file manually.

This configuration is stored in one record per key, with a key-name of
public-addresses:node#<pnn>
where <pnn> is the node number.

The content of this record is the same syntax as the /etc/ctdb/public-addresses file.

When ctdbd starts, if this key exist and contains data. It is extracted from the database and compared with the normal file /etc/ctdb/public-addresses.

If the content differs, the config database "wins" and is used to overwrite/update the /etc/ctdb/public-addresses file, after which ctdbd is restarted.

The main benefit with this option is that it can be used to update the public address configuration for nodes that are offline/unreachable by updating their configuration in the persistent database.
Once the offline node is available again, it will resync its databases with the rest of the cluster, find out that the config has changed, apply the changes and restart ctdbd automatically.

The command to store the public address configuration for a node into the persistent database is :

ctdb pstore config.tdb public-addresses:node#<pnn> <filename>

where <pnn> is the node# we wish to update the config for, and <filename> is a file containing the new content for  that nodes public address configuration.
config/events.d/00.ctdb