Difference between revisions of "Projects/PIM/Akonadi/Multi-Instance"

< Projects‎ | PIM‎ | Akonadi
Jump to: navigation, search
(Created page with "== Akonadi Multi-Instance Setup == The multi-instance akonadi setup allows to run multiple akonadi-servers in parallel, using the same posix-user. DBus service names are postfix...")
 
(Missing Features)
Line 40: Line 40:
 
=== Missing Features ===
 
=== Missing Features ===
 
* Debugging facilities as mentioned above
 
* Debugging facilities as mentioned above
* Firstrun: This must be disabled by exporting AKONADI_DISABLE_AGENT_AUTOSTART, otherwise the firstrun code will crash (an assert prevents running the code since it is unsafe so far).
+
* Firstrun: Is disabled in servermanager.cpp, otherwise the firstrun code will crash (an assert prevents running the code since it is unsafe so far).
 +
* It is not safe to run a multi-instance setup without exporting AKONADI_DISABLE_AGENT_AUTOSTART first, because the default setup desktop files contain configs with hardcoded paths, which would result in every akonadi instance creating a resource for the same default path.
  
 
=== Development ===
 
=== Development ===

Revision as of 17:05, 10 July 2012

Contents

Akonadi Multi-Instance Setup

The multi-instance akonadi setup allows to run multiple akonadi-servers in parallel, using the same posix-user. DBus service names are postfixed with an instance identifier, so multiple instances can run on the same DBus. Also all relevant configuration files/direcories 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 --identifier IDENTIFIER start

You can run a normal akonadi instance (without --identifier) in parallel with multi-instance akonadi instances.

Each instance will run it's own mysql server.

Directories

The multi-instance setup puts it's files in the following directories:

  • .config/akonadi/instance/$IDENTIFIER
  • .local/share/akonadi/instance/$IDENTIFIER
  • .kde4/share/config/akonadi/akonadi_imap_resource_0_$IDENTIFIERrc

To cleanup an instance, just delete all the directories and configs above.

Akonadiconsole

To connect to an instance using akonadiconsole export the following environment variable first (with inst1 being the instance identifier):

export AKONADI_INSTANCE=inst1

A couple of features, such as the debugging facilities or the mysql console do not work, but managing agents and browsing the collection tree should work just fine. Note that you might get an error message on startup that your mysql database socket couldn't be found, this is safe to ignore.

You can 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-myhost2/mysql.socket

Missing Features

  • Debugging facilities as mentioned above
  • Firstrun: Is disabled in servermanager.cpp, otherwise the firstrun code will crash (an assert prevents running the code since it is unsafe so far).
  • It is not safe to run a multi-instance setup without exporting AKONADI_DISABLE_AGENT_AUTOSTART first, because the default setup desktop files contain configs with hardcoded paths, which would result in every akonadi instance creating a resource for the same default path.

Development

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:

  • dbus service names
  • configfile names
  • default directory paths

You only need to change these, if you add/use dbus interfaces, or access configfiles directly. Most things have already been taken care of using the agentbase/resourcebase classes.

  • kdepimlibs/akonad/servermanager.h contains a couple of helper functions to help with that.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal