Wiki source code of Creating a Multi-tenant environment
Version 16.2 by Vincent Massol on 2011/12/14
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{box cssClass="floatinginfobox" title="**Contents**"}}{{toc/}}{{/box}} | ||
2 | |||
3 | A [[multi-tenant>>http://en.wikipedia.org/wiki/Multitenancy]] setup (a.k.a "virtual mode", "multi-wiki" or "farm mode") allows you to have several wikis running on the same XWiki instance (i.e. in the same JVM). | ||
4 | |||
5 | Each wiki has its own database schema, thus allowing for a complete data separation between the different wikis in the same instance. | ||
6 | |||
7 | The main advantage of multi-tenancy is performance optimization. A single XWiki instance on a physical machine (thus a single Servlet Container) will perform much better than having several XWiki instances running on the same machine, which wouldn't scale. As an example known XWiki multi-tenant instances hosts several thousands hundreds to several thousands wikis on a single XWiki instance. | ||
8 | |||
9 | = Requirements = | ||
10 | |||
11 | The multi-tenancy feature currently works only on some databases: | ||
12 | * Databases known to work are: MySQL and Oracle. | ||
13 | * PostgreSQL is currently not supported as the JDBC driver doesn't support setCatalog() for changing databases as PostgreSQL connections are pointed to a specific database at connection time. see jira issue [[XWIKI-1960>>http://jira.xwiki.org/jira/browse/XWIKI-1960]]. | ||
14 | * [[HSQLDB and Derby are currently not supported either>>http://jira.xwiki.org/jira/browse/XWIKI-1740]] | ||
15 | |||
16 | In addition to having a supported database you'll also need: | ||
17 | * Choose one instance of XWiki that has been installed on your network. The database name for this wiki should be ##xwiki##. If you've still got to install the XWiki instance, please refer to [[the installation guide>>AdminGuide.Installation]] and install a XWiki Enterprise first. | ||
18 | * Admin privileges on this XWiki instance | ||
19 | * You need to be sure that the ##xwiki## user used to the create the main database has the correct permissions to be able to create other schemas since each subwiki will create a new database schema. | ||
20 | * Able to restart the java container (e.g. Tomcat or Jetty), or can have this restarted on demand. | ||
21 | ** The ##xwiki.cfg## file will also have to be modified, so you will need to have write access to this file on the server. | ||
22 | |||
23 | = Set up = | ||
24 | |||
25 | * Stop your XWiki instance, edit the ##WEB-INF/xwiki.cfg## file, look for the ##xwiki.virtual## property and set it to ##1##: {{code}}xwiki.virtual=1{{/code}}. Restart your XWiki instance. | ||
26 | * Install the [[Wiki Manager Application Extension>>extensions:Extension.Wiki Manager Application]]. | ||
27 | |||
28 | Starting with XWiki Enterprise 3.3 you can easily install the Wiki Manager Application using the Extension Manager by following these steps: | ||
29 | * Go the Administration page, find the "Extension Manager" section and click on "Add Extension" | ||
30 | * Click on "Advanced Install", enter the following information and then click the "Install" button and then the "Apply" button to confirm the installation | ||
31 | ** extension id: ##org.xwiki.platform:xwiki-platform-wiki-manager-ui## | ||
32 | ** extension version: ##3.3## (adapt to use the version you wish to install, make it match the version of XWiki Enterprise you're using) | ||
33 | * Verify that the Wiki Manager extension is correctly installed by navigating to the ##WikiManager.WebHome## page which should now exist. | ||
34 | |||
35 | You now have a multi-tenant installation and can proceed to use the [[Wiki Manager Application>>extensions:Extension.Wiki Manager Application]] to create subwikis. |