The multi-instance Akonadi setup allows to run multiple Akonadi servers in parallel, using the same posix-user and D-Bus session bus. D-Bus service names are postfixed with an instance identifier and all relevant configuration files/directories are either postfixed or put in a separate directory, to avoid any clashes, making it safe to run multiple instances in parallel.
The behavior of a normal Akonadi instance is not changed.
To run multiple Akonadi instances in parallel it is required to assign to each instance a unique identifier using:
akonadictl --instance IDENTIFIER start
An application will then connect to a server depending on the AKONADI_INSTANCE environment variable (set to IDENTIFIER).
You can run a normal Akonadi instance (without --instance) in parallel with multi-instance Akonadi instances.
Each instance will run it's own Mysql server by default, just like a regular Akonadi instance does.
export AKONADI_DISABLE_AGENT_AUTOSTART akonadictl --instance IDENTIFIER start
connect any Akonadi client (see also risks section below):
export AKONADI_INSTANCE=IDENTIFIER akonadiconsole
akonadictl --instance IDENTIFIER stop
The multi-instance setup puts it's files in the following directories:
To cleanup an instance, just delete all the directories and configs above.
To connect to an instance using a Akonadi client application, export the following environment variable first (with inst1 being the instance identifier):
Unlike regular client applications, akonadiconsole will automatically detect the presence of multiple Akonadi instances and asks to which one to connect to if more than one was found.
Some of the debugging facilities do not work correctly yet, these are the known issues:
You can also connect to the Mysql instance directly using the Mysql console (standalone, not the akonadiconsole one):
mysql --protocol=SOCKET --socket=~/.local/share/akonadi/instance/<inst1>/socket-<hostname>/mysql.socket
In order to make Akonadi code work in the multi-instance setup all unique identifiers need to be made distinguishable between instances. That includes most prominently:
You only need to change these, if you add/use D-Bus interfaces, or access configuration files directly. Most things have already been taken care of using the AgentBase/ResourceBase classes.
Note that it is not possible to change the D-Bus names or the prefixed directories just in kdepimlibs, as the Akonadi server makes assumptions on where to find the directories and D-Bus services.