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:37:32 +0000 (11:37 +1000)
commitbffaecee9a91d972a1697101aee7b40fbb87edbf
tree6412e4f57b8045a37c2cb8f00f537edd048fac96
parent6b4b754758bde58e04ef6d3b57c723ff4a18e910
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