-
Notifications
You must be signed in to change notification settings - Fork 23
RADOS Dictionary Plugin
The Dovecot dictionaries are a good candidate to be implemented using the Ceph omap key/value store. They are a building block to enable a Dovecot which runs exclusively on Ceph.
Dovecot uses two namespaces for dictionary keys.
public
-
These are shared entries. These keys will be stored in a RADOS object named <oid>. <public> will be used as omap key as given.
username+<user_suffix>
-
These are private entries for a user. These keys will be stored in a RADOS object named <oid>. <username+user_suffix> will be used as omap key as given.:
The dictionary plugin also supports namespace indirection, as described in the RADOS Storage Plugin chapter Namespace Usage.
To load the plugin, add dict_rados to the list of mail plugins to be loaded. There are several ways to do this. Add, for example, the plugin in 10-mail.conf
to mail_plugins.
mail_plugins = $mail_plugins dict_rados
To enable or disable the plugin per user, you can make your userdb return mail_plugins as an extra field. See UserDatabase/ExtraFields for examples.
The name of the dict driver is rados
.
Add the plugin, for example, to 10-mail.conf
as mail\_attribute\_dict.
See Dovecot Dictionaries for details.
mail_attribute_dict = rados:oid=metadata:pool=mail_dictionary:dict_cluster_name=ceph:dict_user_name=client.admin:dict_cfg_object_name=rbox_cfg
The configuration parameters are:
- oid
-
The RADOS object id to use.
- pool
-
The RADOS pool to use for the dictionary objects. The pool name ist optional and defaults to mail_dictionary. If the pool is missing, it will be created.
- dict_cluser_name
-
The ceph cluster name, default is ceph
- dict_user_name
-
The ceph cluster user, default is client.admin
- dict_cfg_object_name
-
The dovecot-ceph plugin json configuration object name, default is rbox_cfg
All key/values are be stored in OMAP key/values of the object <oid>.
The plugin uses the default way for Ceph configuration described in Step 2: Configuring a Cluster Handle:
-
rados_conf_parse_env()
: Evaluate the CEPH_ARGS environment variable. -
rados_conf_read_file()
: Search the default locations, and the first found is used. The locations are:-
$CEPH_CONF
(environment variable) -
/etc/ceph/ceph.conf
-
~/.ceph/config
-
ceph.conf
(in the current working directory)
-
The test directory src/tests contains a test application for the dictionary plugin (it_test_dict_rados). It uses Google Test, Google’s C++ test framework.
The test needs a running Ceph cluster. The Ceph cluster can be run locally without cephx that was created, for example, using vstart.sh as decribed in Developer Guide (quick) or ceph/README.md.
../src/vstart.sh -X -n -l
Any other way to get a Ceph cluster is valid, too.