<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.open-xchange.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Usman.ahmad</id>
	<title>Open-Xchange - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.open-xchange.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Usman.ahmad"/>
	<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Special:Contributions/Usman.ahmad"/>
	<updated>2026-06-30T23:11:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:DocumentConverterUpdate782&amp;diff=22379</id>
		<title>AppSuite:DocumentConverterUpdate782</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:DocumentConverterUpdate782&amp;diff=22379"/>
		<updated>2016-09-08T12:28:21Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Version|7.8.2}}&lt;br /&gt;
&lt;br /&gt;
== Update Documentconverter from earlier versions to 7.8.2 ==&lt;br /&gt;
&lt;br /&gt;
For a successful update to 7.8.2 some manual adjustments are necessary on the middleware node(s) as well as on the documentconverter node(s) after the package upgrade. For a single node deployment both sections have to be adhered to.&lt;br /&gt;
&lt;br /&gt;
Further details are available from the [[AppSuite:DocumentConverter_Installation_Guide|Installation Guide]].&lt;br /&gt;
&lt;br /&gt;
=== OX Documentconverter Service === &lt;br /&gt;
&lt;br /&gt;
After an upgrade the new package '''&amp;lt;tt&amp;gt;open-xchange-documentconverter-server&amp;lt;/tt&amp;gt;''' replaces '''&amp;lt;tt&amp;gt;open-xchange-documentconverter-webservice&amp;lt;/tt&amp;gt;'''. If &amp;lt;tt&amp;gt;open-xchange-documentconverter-server&amp;lt;/tt&amp;gt; is not automatically installed (e.g. in a single node deployment) it has to be be added manually.&lt;br /&gt;
&lt;br /&gt;
Changes to the configuration file documentconverter.properties need to be applied to the new one. For versions up to (including) 7.8.1 it was located at &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/opt/open-xchange/etc/documentconverter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Starting with 7.8.2 it's new home is&lt;br /&gt;
 /opt/open-xchange/documentconverter/etc/documentconverter.properties&lt;br /&gt;
&lt;br /&gt;
Note: If the file is moved from the old to the new location with all items the path settings in &lt;br /&gt;
'com.openexchange.documentconverter.blacklistFile' and 'com.openexchange.documentconverter.whitelistFile' have to be changed.&lt;br /&gt;
&lt;br /&gt;
Futhermore logging needs to be configured separately from the middleware setting. A logback.xml file dedicated to the document converter process can be found at&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 /opt/open-xchange/documentconverter/etc/logback.xml&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most notable changes are the listening ports (http 8008, https 8011 and JMX 9998) which have to be different from those reserved for the middleware. Apache and monitoring configurations have to be adapted accordingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
apache conf (if used): separate balancer entry required, port changed&lt;br /&gt;
Adapt /etc/munin/plugin-conf.d&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Don't forget to enable / (re)start open-xchange-documentconverter-server.service in addition to the OX App Suite middleware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== OX App Suite Middleware (aka Backend or Documentconverter Client) ===&lt;br /&gt;
&lt;br /&gt;
The property pointing to the documentconverter service has to be adjusted. It is now mandatory to set this entry – not only in the remote documentconverter setup but also if the documentconverter runs locally.&lt;br /&gt;
The property used changed from &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/opt/open-xchange/etc/documentconverter.properties:&lt;br /&gt;
com.openexchange.documentconverter.RemoteBaseUrl=&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/opt/open-xchange/etc/documentconverter-client.properties: com.openexchange.documentconverter.client.remoteDocumentConverterUrl=&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single-node deployment this reads (in one line)&lt;br /&gt;
&lt;br /&gt;
 com.openexchange.documentconverter.client.remoteDocumentConverterUrl = http://localhost:8008/documentconverterws&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
If the logging configuration has been changed for documentconverter entries the logger needs a small change. The new class is name=&amp;quot;com.openexchange.documentconverter&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:AppSuite]]&lt;br /&gt;
[[Category:Administrator]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=OXReportClient&amp;diff=21214</id>
		<title>OXReportClient</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=OXReportClient&amp;diff=21214"/>
		<updated>2016-01-07T13:43:31Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
* For customers who are using '''OX App Suite''' please [http://oxpedia.org/wiki/index.php?title=AppSuite:OXReportClient click here]&lt;br /&gt;
&lt;br /&gt;
Beginning with the release of Open-Xchange Server version 6.18, '''generating a report every month'''&lt;br /&gt;
is mandatory in order to have access to the maintenance updates available in the updates directory&lt;br /&gt;
on software.open-xchange.com.&lt;br /&gt;
&lt;br /&gt;
'''You have been blocked already?'''&lt;br /&gt;
&lt;br /&gt;
'''Don't panic''', you can still access http://software.open-xchange.com/OX6/stable, because that&lt;br /&gt;
is open for everyone.&lt;br /&gt;
So install the Report Client from stable instead of updates and once you're done, update to the latest version.&lt;br /&gt;
&lt;br /&gt;
The Open-Xchange Report Client extension of the Open-Xchange Server enables you to generate and send usage reports of your environment to Open-Xchange. The report will contain information of how many contexts and users have been created in the given Open-Xchange environment. This article will guide you through the installation of the  Open-Xchange Report Client. It describes the setup of the software extension itself, and which additional configurations need to be done to execute this extension.&lt;br /&gt;
&lt;br /&gt;
You will find further information at the Open-Xchange Frequent Asked Questions (FAQ)&lt;br /&gt;
* [http://sdb.open-xchange.com/faq/70 English]&lt;br /&gt;
* [http://sdb.open-xchange.com/category/1/71 German]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-report-client|sopath=6.22/updates/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
A requirement to execute the Open-Xchange Report Client is to have your Open-Xchange license key stored in one specific file on your Open-Xchange installation. The latest version of our [[Main_Page#Installation_based_on_packages | installation guide]] documentation will automatically enable you to store your license key on disk by using a new oxinstaller command.&lt;br /&gt;
&lt;br /&gt;
If you want to use the report client on an already installed environment you need to store your license key manually on disk. To do so create and edit the following file on your Open-Xchange server:&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/common/licensekeys.properties &lt;br /&gt;
&lt;br /&gt;
or on 6.22 or newer&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/licensekeys.properties &lt;br /&gt;
&lt;br /&gt;
 com.openexchange.licensekey.1=PUT_YOUR_OPEN-XCHANGE_LICENSE_KEY_HERE&lt;br /&gt;
&lt;br /&gt;
If you are behind a firewall and the report client needs to be configured using a HTTP proxy, please edit file:&lt;br /&gt;
  &lt;br /&gt;
 $ vim /opt/open-xchange/etc/groupware/reportclient.properties&lt;br /&gt;
&lt;br /&gt;
or on 6.22 or newer&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/reportclient.properties&lt;br /&gt;
&lt;br /&gt;
After editing this file accordingly to your proxy needs, try to start the report client again.&lt;br /&gt;
&lt;br /&gt;
== Using the Report tool ==&lt;br /&gt;
&lt;br /&gt;
Now as the package has been correctly installed and you provided your license key in the according properties file your are ready to launch the report client to generate a report. By default (if no option is given) the report client will display and send the generated report to an Open-Xchange service on activation.open-xchange.com. Note that only data that is displayed in the console will be transfered to Open-Xchange &lt;br /&gt;
&lt;br /&gt;
'''activation.open-xchange.com:443'''&lt;br /&gt;
&lt;br /&gt;
=== Report kinds ===&lt;br /&gt;
&lt;br /&gt;
In general there are two kinds of reports. Since 7.8.0 the default report has got the appsuite style format. If you would like to generate and display/save/send the formerly used style you have to add the option &amp;quot;-o&amp;quot; to every known parameter combination. &lt;br /&gt;
&lt;br /&gt;
=== Display data usage report ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -d&lt;br /&gt;
&lt;br /&gt;
If you want to know which data would be transfered, execute the report client with the option &amp;quot;-d&amp;quot; (display_only). If this option is given to the report client no data will be send:&lt;br /&gt;
&lt;br /&gt;
=== Send data usage report ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -s&lt;br /&gt;
&lt;br /&gt;
If you don't want to have the report displayed in the console (which might be the case for automated executions of the report client) execute the report client with the option -s (send_only). Now no report will be displayed after the report has been sent to activation.open-xchange.com.&lt;br /&gt;
&lt;br /&gt;
=== Available options ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -h&lt;br /&gt;
&lt;br /&gt;
lists all available options:&lt;br /&gt;
&lt;br /&gt;
 Usage: report&lt;br /&gt;
 -h,--help                                         Prints a help text          &lt;br /&gt;
    --environment                                  Show info about commandline environment&lt;br /&gt;
    --nonl                                         Remove all newlines (\n) from output&lt;br /&gt;
    --responsetimeout &amp;lt;responsetimeout&amp;gt;            response timeout in seconds for reading response from&lt;br /&gt;
                                                    the backend (default 0s; infinite)&lt;br /&gt;
 -H,--host &amp;lt;host&amp;gt;                                  specifies the host          &lt;br /&gt;
 -T,--timeout &amp;lt;timeout&amp;gt;                            timeout (in s) to conntect to the backend (default 15s)&lt;br /&gt;
 -J,--jmxauthuser &amp;lt;jmxauthuser&amp;gt;                    jmx username (when jmx authentication enabled)&lt;br /&gt;
 -P,--jmxauthpassword &amp;lt;jmxauthpassword&amp;gt;            jmx password (when jmx authentication enabled)&lt;br /&gt;
 -s,--sendonly                                     Send report without displaying it (Disables default)&lt;br /&gt;
 -d,--displayonly                                  Display report without sending it (Disables default)&lt;br /&gt;
 -c,--csv                                          Show output as CSV          &lt;br /&gt;
 -a,--advancedreport                               Run an advanced report&lt;br /&gt;
 -f,--savereport                                   Save the report as JSON String instead of sending it&lt;br /&gt;
 -b,--showaccesscombination &amp;lt;showaccesscombination&amp;gt;  Show access combination for bitmask&lt;br /&gt;
 -e,--run-appsuite-report                          Schedule an appsuite style report&lt;br /&gt;
 -t,--report-type &amp;lt;report-type&amp;gt;                    The type of the report to run&lt;br /&gt;
    --inspect-appsuite-reports                     Prints information about currently running reports&lt;br /&gt;
    --cancel-appsuite-reports                      Cancels pending reports     &lt;br /&gt;
 -g,--get-appsuite-report                          Retrieve the report that was generated&lt;br /&gt;
 -x,--run-and-deliver-report                       Create a new report and send it immediately&lt;br /&gt;
 -o,--run-and-deliver-old-report                   Run old report type. Used to have a backward compatibility.&lt;br /&gt;
&lt;br /&gt;
=== Explanation of the appsuite report console output ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -d&lt;br /&gt;
 Starting the Open-Xchange report client. Note that the report generation may take a little while.&lt;br /&gt;
&lt;br /&gt;
 f5f511d663ff462f8f963dfa41bd8cd2: 0/5 (0,00 %) &lt;br /&gt;
 UUID: f5f511d663ff462f8f963dfa41bd8cd2&lt;br /&gt;
 Type: default&lt;br /&gt;
 Total time: 389 milliseconds&lt;br /&gt;
 Avg. time per context: 77 milliseconds&lt;br /&gt;
 Report was finished: Wed Jul 08 13:42:25 CEST 2015&lt;br /&gt;
&lt;br /&gt;
 ------ report -------&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;macdetail&amp;quot; : {&lt;br /&gt;
     &amp;quot;capabilitySets&amp;quot; : [ {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 2,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 0,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     }, {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 11,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;active_sync&amp;quot;, &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;calendar&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;collect_email_addresses&amp;quot;, &amp;quot;conflict_handling&amp;quot;, &amp;quot;contacts&amp;quot;, &amp;quot;delegate_tasks&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;edit_password&amp;quot;, &amp;quot;edit_public_folders&amp;quot;, &amp;quot;edit_resource&amp;quot;, &amp;quot;filestore&amp;quot;, &amp;quot;freebusy&amp;quot;, &amp;quot;gab&amp;quot;, &amp;quot;groupware&amp;quot;, &amp;quot;ical&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;mobility&amp;quot;, &amp;quot;multiple_mail_accounts&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;olox20&amp;quot;, &amp;quot;participants_dialog&amp;quot;, &amp;quot;pim&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;portal&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publication&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;read_create_shared_folders&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;subscription&amp;quot;, &amp;quot;tasks&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;usm&amp;quot;, &amp;quot;vcard&amp;quot;, &amp;quot;webdav&amp;quot;, &amp;quot;webdav_xml&amp;quot;, &amp;quot;webmail&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 3,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     }, {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 6,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;active_sync&amp;quot;, &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;calendar&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;collect_email_addresses&amp;quot;, &amp;quot;conflict_handling&amp;quot;, &amp;quot;contacts&amp;quot;, &amp;quot;delegate_tasks&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;edit_password&amp;quot;, &amp;quot;edit_public_folders&amp;quot;, &amp;quot;edit_resource&amp;quot;, &amp;quot;freebusy&amp;quot;, &amp;quot;gab&amp;quot;, &amp;quot;groupware&amp;quot;, &amp;quot;ical&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;mobility&amp;quot;, &amp;quot;multiple_mail_accounts&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;olox20&amp;quot;, &amp;quot;participants_dialog&amp;quot;, &amp;quot;pim&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;portal&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publication&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;read_create_shared_folders&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;subscription&amp;quot;, &amp;quot;tasks&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;usm&amp;quot;, &amp;quot;vcard&amp;quot;, &amp;quot;webdav&amp;quot;, &amp;quot;webdav_xml&amp;quot;, &amp;quot;webmail&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 2,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     } ]&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;total&amp;quot; : {&lt;br /&gt;
     &amp;quot;guests&amp;quot; : 22,&lt;br /&gt;
     &amp;quot;links&amp;quot; : 10,&lt;br /&gt;
     &amp;quot;contexts&amp;quot; : 5,&lt;br /&gt;
     &amp;quot;users&amp;quot; : 19,&lt;br /&gt;
     &amp;quot;report-format&amp;quot; : &amp;quot;appsuite-short&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;clientlogincountyear&amp;quot; : {&lt;br /&gt;
     &amp;quot;appsuite&amp;quot; : &amp;quot;7&amp;quot;,&lt;br /&gt;
     &amp;quot;olox2&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;caldav&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;usm-eas&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;mobileapp&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;ox6&amp;quot; : &amp;quot;9&amp;quot;,&lt;br /&gt;
     &amp;quot;carddav&amp;quot; : &amp;quot;1&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;clientlogincount&amp;quot; : {&lt;br /&gt;
     &amp;quot;appsuite&amp;quot; : &amp;quot;4&amp;quot;,&lt;br /&gt;
     &amp;quot;olox2&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;caldav&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;usm-eas&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;mobileapp&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;ox6&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
     &amp;quot;carddav&amp;quot; : &amp;quot;1&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;uuid&amp;quot; : &amp;quot;f5f511d663ff462f8f963dfa41bd8cd2&amp;quot;,&lt;br /&gt;
   &amp;quot;reportType&amp;quot; : &amp;quot;default&amp;quot;,&lt;br /&gt;
   &amp;quot;timestamps&amp;quot; : {&lt;br /&gt;
     &amp;quot;start&amp;quot; : 1436355744714,&lt;br /&gt;
     &amp;quot;stop&amp;quot; : 1436355745103&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;version&amp;quot; : {&lt;br /&gt;
     &amp;quot;version&amp;quot; : &amp;quot;7.8.0-Rev0&amp;quot;,&lt;br /&gt;
     &amp;quot;buildDate&amp;quot; : &amp;quot;develop&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;configs&amp;quot; : {&lt;br /&gt;
     &amp;quot;com.openexchange.mail.adminMailLoginEnabled&amp;quot; : &amp;quot;true&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ------ end -------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''macdetail:'''&lt;br /&gt;
: detailed information about existing module access combinations and its usage &lt;br /&gt;
'''total:'''&lt;br /&gt;
: accumulated user, guest, link (anonymous share) and context count&lt;br /&gt;
'''clientlogincountyear:'''&lt;br /&gt;
: number of client logins for the last year&lt;br /&gt;
'''clientlogincount:'''&lt;br /&gt;
: number of client logins for the last month&lt;br /&gt;
'''uuid:'''&lt;br /&gt;
: a unique id for the report&lt;br /&gt;
'''reportType:'''&lt;br /&gt;
: given name for that report (normally 'default')&lt;br /&gt;
'''timestamps:'''&lt;br /&gt;
: timestamps of the start and end time of the report&lt;br /&gt;
'''versions:'''&lt;br /&gt;
: version and build date of the server&lt;br /&gt;
'''configs:'''&lt;br /&gt;
: server configuration (currently only for setting 'com.openexchange.mail.adminMailLoginEnabled')&lt;br /&gt;
&lt;br /&gt;
=== Explanation of the old console output ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -o -d&lt;br /&gt;
 Starting the Open-Xchange report client. Note that the report generation may take a little while.&lt;br /&gt;
 &lt;br /&gt;
 module    version    &lt;br /&gt;
 admin     6.20.5 Rev1&lt;br /&gt;
 groupware 6.20.5 Rev1&lt;br /&gt;
 &lt;br /&gt;
 '''contexts users guests links'''&lt;br /&gt;
 5        19    22     10 &lt;br /&gt;
 &lt;br /&gt;
 '''mac       count adm disabled'''&lt;br /&gt;
 268435455 6     1   0       &lt;br /&gt;
 237044501 48    0   0       &lt;br /&gt;
 5         2     2   0       &lt;br /&gt;
 &lt;br /&gt;
 '''key                                         value'''&lt;br /&gt;
 com.openexchange.mail.adminMailLoginEnabled true &lt;br /&gt;
 &lt;br /&gt;
 '''usmeas olox2 mobileapp carddav caldav'''&lt;br /&gt;
 1      0     0         0       0&lt;br /&gt;
 &lt;br /&gt;
 '''usmeasyear olox2year mobileappyear carddavyear caldavyear'''&lt;br /&gt;
 4          12        7             11          10        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''contexts:'''&lt;br /&gt;
:total number of contexts&lt;br /&gt;
'''users:'''&lt;br /&gt;
:total number of users&lt;br /&gt;
'''guests:'''&lt;br /&gt;
:total number of guests&lt;br /&gt;
'''linkss:'''&lt;br /&gt;
:total number of links shared to anonymous users&lt;br /&gt;
'''mac:'''&lt;br /&gt;
:decimal value of the module access. For conversion decimal to human readable permission please use &amp;lt;tt&amp;gt;report -b&amp;lt;/tt&amp;gt; as described below&lt;br /&gt;
'''count:'''&lt;br /&gt;
:amount of users with this module access&lt;br /&gt;
'''adm:'''&lt;br /&gt;
:amount of admin users with this specific module access&lt;br /&gt;
'''disabled:'''&lt;br /&gt;
:amount of users that are disabled&lt;br /&gt;
'''key:'''&lt;br /&gt;
:key of the configuration property&lt;br /&gt;
'''value:'''&lt;br /&gt;
:value of the configuration property&lt;br /&gt;
&lt;br /&gt;
The last rows show the amount of users that did login to Open-Xchange within the ''last 30 days'' and ''the last year'' using the specified OXtender/service.&lt;br /&gt;
&lt;br /&gt;
If you want to know the access permissions of a specific &amp;lt;tt&amp;gt;mac&amp;lt;/tt&amp;gt;, run e.g.&lt;br /&gt;
&lt;br /&gt;
 $  /opt/open-xchange/sbin/report -b 237044501&lt;br /&gt;
&lt;br /&gt;
'''usmeas:'''&lt;br /&gt;
:using mobile phone via active sync (OXtender for Business Mobility) within the last 30 days&lt;br /&gt;
'''olox2:'''&lt;br /&gt;
:using OXtender 2 for Microsoft Outlook within the last 30 days&lt;br /&gt;
'''mobileapp:'''&lt;br /&gt;
:using Open-Xchange Mobile Web Interface within the last 30 days&lt;br /&gt;
'''carddav/caldav:'''&lt;br /&gt;
:using the CalDAV/CardDAV feature within the last 30 days&lt;br /&gt;
'''usmeasyear:'''&lt;br /&gt;
:using mobile phone via active sync (OXtender for Business Mobility) within the last year&lt;br /&gt;
'''olox2:'''&lt;br /&gt;
:using OXtender 2 for Microsoft Outlook within the last year&lt;br /&gt;
'''mobileapp:'''&lt;br /&gt;
:using Open-Xchange Mobile Web Interface within the last year&lt;br /&gt;
'''carddav/caldav:'''&lt;br /&gt;
:using the CalDAV/CardDAV feature within the last year&lt;br /&gt;
&lt;br /&gt;
'''Example:''' a value of 7 below &amp;lt;tt&amp;gt;olox2&amp;lt;/tt&amp;gt; means, that within the last 30 days, 7 different users used the OXtender 2 for Microsoft Outlook to connect to Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== Automatic reports ==&lt;br /&gt;
&lt;br /&gt;
Creating a cron entry which will automatically execute the report client once a week saves a lot of work. To create this cron entry execute:&lt;br /&gt;
&lt;br /&gt;
 $ vim /etc/cron.d/open-xchange_report&lt;br /&gt;
 &lt;br /&gt;
 0 3 * * 7	open-xchange	/opt/open-xchange/sbin/report -s -x 1&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
== What will be reported using the send method? ==&lt;br /&gt;
&lt;br /&gt;
The report client will display and / or transfer the following information:&lt;br /&gt;
&lt;br /&gt;
# Version number of the Open-Xchange server package&lt;br /&gt;
# Version number of the Open-Xchange admin package&lt;br /&gt;
# Total user count&lt;br /&gt;
# Total context count&lt;br /&gt;
# Detailed context information: context age, creation date or date of creation, user count, context id, capability sets&lt;br /&gt;
# Detailed user information (per context): User access combination flags (which modules have been activated for the users)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=OXReportClient&amp;diff=21213</id>
		<title>OXReportClient</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=OXReportClient&amp;diff=21213"/>
		<updated>2016-01-07T13:40:34Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
* For customers who are using OX App Suite please [http://oxpedia.org/wiki/index.php?title=AppSuite:OXReportClient click here]&lt;br /&gt;
&lt;br /&gt;
Beginning with the release of Open-Xchange Server version 6.18, '''generating a report every month'''&lt;br /&gt;
is mandatory in order to have access to the maintenance updates available in the updates directory&lt;br /&gt;
on software.open-xchange.com.&lt;br /&gt;
&lt;br /&gt;
'''You have been blocked already?'''&lt;br /&gt;
&lt;br /&gt;
'''Don't panic''', you can still access http://software.open-xchange.com/OX6/stable, because that&lt;br /&gt;
is open for everyone.&lt;br /&gt;
So install the Report Client from stable instead of updates and once you're done, update to the latest version.&lt;br /&gt;
&lt;br /&gt;
The Open-Xchange Report Client extension of the Open-Xchange Server enables you to generate and send usage reports of your environment to Open-Xchange. The report will contain information of how many contexts and users have been created in the given Open-Xchange environment. This article will guide you through the installation of the  Open-Xchange Report Client. It describes the setup of the software extension itself, and which additional configurations need to be done to execute this extension.&lt;br /&gt;
&lt;br /&gt;
You will find further information at the Open-Xchange Frequent Asked Questions (FAQ)&lt;br /&gt;
* [http://sdb.open-xchange.com/faq/70 English]&lt;br /&gt;
* [http://sdb.open-xchange.com/category/1/71 German]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-report-client|sopath=updates}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-report-client|sopath=6.22/updates/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
A requirement to execute the Open-Xchange Report Client is to have your Open-Xchange license key stored in one specific file on your Open-Xchange installation. The latest version of our [[Main_Page#Installation_based_on_packages | installation guide]] documentation will automatically enable you to store your license key on disk by using a new oxinstaller command.&lt;br /&gt;
&lt;br /&gt;
If you want to use the report client on an already installed environment you need to store your license key manually on disk. To do so create and edit the following file on your Open-Xchange server:&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/common/licensekeys.properties &lt;br /&gt;
&lt;br /&gt;
or on 6.22 or newer&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/licensekeys.properties &lt;br /&gt;
&lt;br /&gt;
 com.openexchange.licensekey.1=PUT_YOUR_OPEN-XCHANGE_LICENSE_KEY_HERE&lt;br /&gt;
&lt;br /&gt;
If you are behind a firewall and the report client needs to be configured using a HTTP proxy, please edit file:&lt;br /&gt;
  &lt;br /&gt;
 $ vim /opt/open-xchange/etc/groupware/reportclient.properties&lt;br /&gt;
&lt;br /&gt;
or on 6.22 or newer&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/reportclient.properties&lt;br /&gt;
&lt;br /&gt;
After editing this file accordingly to your proxy needs, try to start the report client again.&lt;br /&gt;
&lt;br /&gt;
== Using the Report tool ==&lt;br /&gt;
&lt;br /&gt;
Now as the package has been correctly installed and you provided your license key in the according properties file your are ready to launch the report client to generate a report. By default (if no option is given) the report client will display and send the generated report to an Open-Xchange service on activation.open-xchange.com. Note that only data that is displayed in the console will be transfered to Open-Xchange &lt;br /&gt;
&lt;br /&gt;
'''activation.open-xchange.com:443'''&lt;br /&gt;
&lt;br /&gt;
=== Report kinds ===&lt;br /&gt;
&lt;br /&gt;
In general there are two kinds of reports. Since 7.8.0 the default report has got the appsuite style format. If you would like to generate and display/save/send the formerly used style you have to add the option &amp;quot;-o&amp;quot; to every known parameter combination. &lt;br /&gt;
&lt;br /&gt;
=== Display data usage report ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -d&lt;br /&gt;
&lt;br /&gt;
If you want to know which data would be transfered, execute the report client with the option &amp;quot;-d&amp;quot; (display_only). If this option is given to the report client no data will be send:&lt;br /&gt;
&lt;br /&gt;
=== Send data usage report ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -s&lt;br /&gt;
&lt;br /&gt;
If you don't want to have the report displayed in the console (which might be the case for automated executions of the report client) execute the report client with the option -s (send_only). Now no report will be displayed after the report has been sent to activation.open-xchange.com.&lt;br /&gt;
&lt;br /&gt;
=== Available options ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -h&lt;br /&gt;
&lt;br /&gt;
lists all available options:&lt;br /&gt;
&lt;br /&gt;
 Usage: report&lt;br /&gt;
 -h,--help                                         Prints a help text          &lt;br /&gt;
    --environment                                  Show info about commandline environment&lt;br /&gt;
    --nonl                                         Remove all newlines (\n) from output&lt;br /&gt;
    --responsetimeout &amp;lt;responsetimeout&amp;gt;            response timeout in seconds for reading response from&lt;br /&gt;
                                                    the backend (default 0s; infinite)&lt;br /&gt;
 -H,--host &amp;lt;host&amp;gt;                                  specifies the host          &lt;br /&gt;
 -T,--timeout &amp;lt;timeout&amp;gt;                            timeout (in s) to conntect to the backend (default 15s)&lt;br /&gt;
 -J,--jmxauthuser &amp;lt;jmxauthuser&amp;gt;                    jmx username (when jmx authentication enabled)&lt;br /&gt;
 -P,--jmxauthpassword &amp;lt;jmxauthpassword&amp;gt;            jmx password (when jmx authentication enabled)&lt;br /&gt;
 -s,--sendonly                                     Send report without displaying it (Disables default)&lt;br /&gt;
 -d,--displayonly                                  Display report without sending it (Disables default)&lt;br /&gt;
 -c,--csv                                          Show output as CSV          &lt;br /&gt;
 -a,--advancedreport                               Run an advanced report&lt;br /&gt;
 -f,--savereport                                   Save the report as JSON String instead of sending it&lt;br /&gt;
 -b,--showaccesscombination &amp;lt;showaccesscombination&amp;gt;  Show access combination for bitmask&lt;br /&gt;
 -e,--run-appsuite-report                          Schedule an appsuite style report&lt;br /&gt;
 -t,--report-type &amp;lt;report-type&amp;gt;                    The type of the report to run&lt;br /&gt;
    --inspect-appsuite-reports                     Prints information about currently running reports&lt;br /&gt;
    --cancel-appsuite-reports                      Cancels pending reports     &lt;br /&gt;
 -g,--get-appsuite-report                          Retrieve the report that was generated&lt;br /&gt;
 -x,--run-and-deliver-report                       Create a new report and send it immediately&lt;br /&gt;
 -o,--run-and-deliver-old-report                   Run old report type. Used to have a backward compatibility.&lt;br /&gt;
&lt;br /&gt;
=== Explanation of the appsuite report console output ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -d&lt;br /&gt;
 Starting the Open-Xchange report client. Note that the report generation may take a little while.&lt;br /&gt;
&lt;br /&gt;
 f5f511d663ff462f8f963dfa41bd8cd2: 0/5 (0,00 %) &lt;br /&gt;
 UUID: f5f511d663ff462f8f963dfa41bd8cd2&lt;br /&gt;
 Type: default&lt;br /&gt;
 Total time: 389 milliseconds&lt;br /&gt;
 Avg. time per context: 77 milliseconds&lt;br /&gt;
 Report was finished: Wed Jul 08 13:42:25 CEST 2015&lt;br /&gt;
&lt;br /&gt;
 ------ report -------&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;macdetail&amp;quot; : {&lt;br /&gt;
     &amp;quot;capabilitySets&amp;quot; : [ {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 2,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 0,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     }, {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 11,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;active_sync&amp;quot;, &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;calendar&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;collect_email_addresses&amp;quot;, &amp;quot;conflict_handling&amp;quot;, &amp;quot;contacts&amp;quot;, &amp;quot;delegate_tasks&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;edit_password&amp;quot;, &amp;quot;edit_public_folders&amp;quot;, &amp;quot;edit_resource&amp;quot;, &amp;quot;filestore&amp;quot;, &amp;quot;freebusy&amp;quot;, &amp;quot;gab&amp;quot;, &amp;quot;groupware&amp;quot;, &amp;quot;ical&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;mobility&amp;quot;, &amp;quot;multiple_mail_accounts&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;olox20&amp;quot;, &amp;quot;participants_dialog&amp;quot;, &amp;quot;pim&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;portal&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publication&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;read_create_shared_folders&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;subscription&amp;quot;, &amp;quot;tasks&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;usm&amp;quot;, &amp;quot;vcard&amp;quot;, &amp;quot;webdav&amp;quot;, &amp;quot;webdav_xml&amp;quot;, &amp;quot;webmail&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 3,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     }, {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 6,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;active_sync&amp;quot;, &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;calendar&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;collect_email_addresses&amp;quot;, &amp;quot;conflict_handling&amp;quot;, &amp;quot;contacts&amp;quot;, &amp;quot;delegate_tasks&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;edit_password&amp;quot;, &amp;quot;edit_public_folders&amp;quot;, &amp;quot;edit_resource&amp;quot;, &amp;quot;freebusy&amp;quot;, &amp;quot;gab&amp;quot;, &amp;quot;groupware&amp;quot;, &amp;quot;ical&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;mobility&amp;quot;, &amp;quot;multiple_mail_accounts&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;olox20&amp;quot;, &amp;quot;participants_dialog&amp;quot;, &amp;quot;pim&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;portal&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publication&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;read_create_shared_folders&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;subscription&amp;quot;, &amp;quot;tasks&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;usm&amp;quot;, &amp;quot;vcard&amp;quot;, &amp;quot;webdav&amp;quot;, &amp;quot;webdav_xml&amp;quot;, &amp;quot;webmail&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 2,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     } ]&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;total&amp;quot; : {&lt;br /&gt;
     &amp;quot;guests&amp;quot; : 22,&lt;br /&gt;
     &amp;quot;links&amp;quot; : 10,&lt;br /&gt;
     &amp;quot;contexts&amp;quot; : 5,&lt;br /&gt;
     &amp;quot;users&amp;quot; : 19,&lt;br /&gt;
     &amp;quot;report-format&amp;quot; : &amp;quot;appsuite-short&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;clientlogincountyear&amp;quot; : {&lt;br /&gt;
     &amp;quot;appsuite&amp;quot; : &amp;quot;7&amp;quot;,&lt;br /&gt;
     &amp;quot;olox2&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;caldav&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;usm-eas&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;mobileapp&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;ox6&amp;quot; : &amp;quot;9&amp;quot;,&lt;br /&gt;
     &amp;quot;carddav&amp;quot; : &amp;quot;1&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;clientlogincount&amp;quot; : {&lt;br /&gt;
     &amp;quot;appsuite&amp;quot; : &amp;quot;4&amp;quot;,&lt;br /&gt;
     &amp;quot;olox2&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;caldav&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;usm-eas&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;mobileapp&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;ox6&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
     &amp;quot;carddav&amp;quot; : &amp;quot;1&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;uuid&amp;quot; : &amp;quot;f5f511d663ff462f8f963dfa41bd8cd2&amp;quot;,&lt;br /&gt;
   &amp;quot;reportType&amp;quot; : &amp;quot;default&amp;quot;,&lt;br /&gt;
   &amp;quot;timestamps&amp;quot; : {&lt;br /&gt;
     &amp;quot;start&amp;quot; : 1436355744714,&lt;br /&gt;
     &amp;quot;stop&amp;quot; : 1436355745103&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;version&amp;quot; : {&lt;br /&gt;
     &amp;quot;version&amp;quot; : &amp;quot;7.8.0-Rev0&amp;quot;,&lt;br /&gt;
     &amp;quot;buildDate&amp;quot; : &amp;quot;develop&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;configs&amp;quot; : {&lt;br /&gt;
     &amp;quot;com.openexchange.mail.adminMailLoginEnabled&amp;quot; : &amp;quot;true&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ------ end -------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''macdetail:'''&lt;br /&gt;
: detailed information about existing module access combinations and its usage &lt;br /&gt;
'''total:'''&lt;br /&gt;
: accumulated user, guest, link (anonymous share) and context count&lt;br /&gt;
'''clientlogincountyear:'''&lt;br /&gt;
: number of client logins for the last year&lt;br /&gt;
'''clientlogincount:'''&lt;br /&gt;
: number of client logins for the last month&lt;br /&gt;
'''uuid:'''&lt;br /&gt;
: a unique id for the report&lt;br /&gt;
'''reportType:'''&lt;br /&gt;
: given name for that report (normally 'default')&lt;br /&gt;
'''timestamps:'''&lt;br /&gt;
: timestamps of the start and end time of the report&lt;br /&gt;
'''versions:'''&lt;br /&gt;
: version and build date of the server&lt;br /&gt;
'''configs:'''&lt;br /&gt;
: server configuration (currently only for setting 'com.openexchange.mail.adminMailLoginEnabled')&lt;br /&gt;
&lt;br /&gt;
=== Explanation of the old console output ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -o -d&lt;br /&gt;
 Starting the Open-Xchange report client. Note that the report generation may take a little while.&lt;br /&gt;
 &lt;br /&gt;
 module    version    &lt;br /&gt;
 admin     6.20.5 Rev1&lt;br /&gt;
 groupware 6.20.5 Rev1&lt;br /&gt;
 &lt;br /&gt;
 '''contexts users guests links'''&lt;br /&gt;
 5        19    22     10 &lt;br /&gt;
 &lt;br /&gt;
 '''mac       count adm disabled'''&lt;br /&gt;
 268435455 6     1   0       &lt;br /&gt;
 237044501 48    0   0       &lt;br /&gt;
 5         2     2   0       &lt;br /&gt;
 &lt;br /&gt;
 '''key                                         value'''&lt;br /&gt;
 com.openexchange.mail.adminMailLoginEnabled true &lt;br /&gt;
 &lt;br /&gt;
 '''usmeas olox2 mobileapp carddav caldav'''&lt;br /&gt;
 1      0     0         0       0&lt;br /&gt;
 &lt;br /&gt;
 '''usmeasyear olox2year mobileappyear carddavyear caldavyear'''&lt;br /&gt;
 4          12        7             11          10        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''contexts:'''&lt;br /&gt;
:total number of contexts&lt;br /&gt;
'''users:'''&lt;br /&gt;
:total number of users&lt;br /&gt;
'''guests:'''&lt;br /&gt;
:total number of guests&lt;br /&gt;
'''linkss:'''&lt;br /&gt;
:total number of links shared to anonymous users&lt;br /&gt;
'''mac:'''&lt;br /&gt;
:decimal value of the module access. For conversion decimal to human readable permission please use &amp;lt;tt&amp;gt;report -b&amp;lt;/tt&amp;gt; as described below&lt;br /&gt;
'''count:'''&lt;br /&gt;
:amount of users with this module access&lt;br /&gt;
'''adm:'''&lt;br /&gt;
:amount of admin users with this specific module access&lt;br /&gt;
'''disabled:'''&lt;br /&gt;
:amount of users that are disabled&lt;br /&gt;
'''key:'''&lt;br /&gt;
:key of the configuration property&lt;br /&gt;
'''value:'''&lt;br /&gt;
:value of the configuration property&lt;br /&gt;
&lt;br /&gt;
The last rows show the amount of users that did login to Open-Xchange within the ''last 30 days'' and ''the last year'' using the specified OXtender/service.&lt;br /&gt;
&lt;br /&gt;
If you want to know the access permissions of a specific &amp;lt;tt&amp;gt;mac&amp;lt;/tt&amp;gt;, run e.g.&lt;br /&gt;
&lt;br /&gt;
 $  /opt/open-xchange/sbin/report -b 237044501&lt;br /&gt;
&lt;br /&gt;
'''usmeas:'''&lt;br /&gt;
:using mobile phone via active sync (OXtender for Business Mobility) within the last 30 days&lt;br /&gt;
'''olox2:'''&lt;br /&gt;
:using OXtender 2 for Microsoft Outlook within the last 30 days&lt;br /&gt;
'''mobileapp:'''&lt;br /&gt;
:using Open-Xchange Mobile Web Interface within the last 30 days&lt;br /&gt;
'''carddav/caldav:'''&lt;br /&gt;
:using the CalDAV/CardDAV feature within the last 30 days&lt;br /&gt;
'''usmeasyear:'''&lt;br /&gt;
:using mobile phone via active sync (OXtender for Business Mobility) within the last year&lt;br /&gt;
'''olox2:'''&lt;br /&gt;
:using OXtender 2 for Microsoft Outlook within the last year&lt;br /&gt;
'''mobileapp:'''&lt;br /&gt;
:using Open-Xchange Mobile Web Interface within the last year&lt;br /&gt;
'''carddav/caldav:'''&lt;br /&gt;
:using the CalDAV/CardDAV feature within the last year&lt;br /&gt;
&lt;br /&gt;
'''Example:''' a value of 7 below &amp;lt;tt&amp;gt;olox2&amp;lt;/tt&amp;gt; means, that within the last 30 days, 7 different users used the OXtender 2 for Microsoft Outlook to connect to Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== Automatic reports ==&lt;br /&gt;
&lt;br /&gt;
Creating a cron entry which will automatically execute the report client once a week saves a lot of work. To create this cron entry execute:&lt;br /&gt;
&lt;br /&gt;
 $ vim /etc/cron.d/open-xchange_report&lt;br /&gt;
 &lt;br /&gt;
 0 3 * * 7	open-xchange	/opt/open-xchange/sbin/report -s -x 1&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
== What will be reported using the send method? ==&lt;br /&gt;
&lt;br /&gt;
The report client will display and / or transfer the following information:&lt;br /&gt;
&lt;br /&gt;
# Version number of the Open-Xchange server package&lt;br /&gt;
# Version number of the Open-Xchange admin package&lt;br /&gt;
# Total user count&lt;br /&gt;
# Total context count&lt;br /&gt;
# Detailed context information: context age, creation date or date of creation, user count, context id, capability sets&lt;br /&gt;
# Detailed user information (per context): User access combination flags (which modules have been activated for the users)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=OXReportClient&amp;diff=21212</id>
		<title>OXReportClient</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=OXReportClient&amp;diff=21212"/>
		<updated>2016-01-07T13:39:30Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
* For customers who are using OX App Suite please [http://oxpedia.org/wiki/index.php?title=AppSuite:OXReportClient click here]&lt;br /&gt;
&lt;br /&gt;
Beginning with the release of Open-Xchange Server version 6.18, '''generating a report every month'''&lt;br /&gt;
is mandatory in order to have access to the maintenance updates available in the updates directory&lt;br /&gt;
on software.open-xchange.com.&lt;br /&gt;
&lt;br /&gt;
'''You have been blocked already?'''&lt;br /&gt;
&lt;br /&gt;
'''Don't panic''', you can still access http://software.open-xchange.com/OX6/stable, because that&lt;br /&gt;
is open for everyone.&lt;br /&gt;
So install the Report Client from stable instead of updates and once you're done, update to the latest version.&lt;br /&gt;
&lt;br /&gt;
The Open-Xchange Report Client extension of the Open-Xchange Server enables you to generate and send usage reports of your environment to Open-Xchange. The report will contain information of how many contexts and users have been created in the given Open-Xchange environment. This article will guide you through the installation of the  Open-Xchange Report Client. It describes the setup of the software extension itself, and which additional configurations need to be done to execute this extension.&lt;br /&gt;
&lt;br /&gt;
You will find further information at the Open-Xchange Frequent Asked Questions (FAQ)&lt;br /&gt;
* [http://sdb.open-xchange.com/faq/70 English]&lt;br /&gt;
* [http://sdb.open-xchange.com/category/1/71 German]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-report-client|sopath=updates}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-report-client|sopath=6.22/updates/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
A requirement to execute the Open-Xchange Report Client is to have your Open-Xchange license key stored in one specific file on your Open-Xchange installation. The latest version of our [[Main_Page#Installation_based_on_packages | installation guide]] documentation will automatically enable you to store your license key on disk by using a new oxinstaller command.&lt;br /&gt;
&lt;br /&gt;
If you want to use the report client on an already installed environment you need to store your license key manually on disk. To do so create and edit the following file on your Open-Xchange server:&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/common/licensekeys.properties &lt;br /&gt;
&lt;br /&gt;
or on 6.22 or newer&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/licensekeys.properties &lt;br /&gt;
&lt;br /&gt;
 com.openexchange.licensekey.1=PUT_YOUR_OPEN-XCHANGE_LICENSE_KEY_HERE&lt;br /&gt;
&lt;br /&gt;
If you are behind a firewall and the report client needs to be configured using a HTTP proxy, please edit file:&lt;br /&gt;
  &lt;br /&gt;
 $ vim /opt/open-xchange/etc/groupware/reportclient.properties&lt;br /&gt;
&lt;br /&gt;
or on 6.22 or newer&lt;br /&gt;
&lt;br /&gt;
 $ vim /opt/open-xchange/etc/reportclient.properties&lt;br /&gt;
&lt;br /&gt;
After editing this file accordingly to your proxy needs, try to start the report client again.&lt;br /&gt;
&lt;br /&gt;
== Using the Report tool ==&lt;br /&gt;
&lt;br /&gt;
Now as the package has been correctly installed and you provided your license key in the according properties file your are ready to launch the report client to generate a report. By default (if no option is given) the report client will display and send the generated report to an Open-Xchange service on activation.open-xchange.com. Note that only data that is displayed in the console will be transfered to Open-Xchange &lt;br /&gt;
&lt;br /&gt;
'''activation.open-xchange.com:443'''&lt;br /&gt;
&lt;br /&gt;
=== Report kinds ===&lt;br /&gt;
&lt;br /&gt;
In general there are two kinds of reports. Since 7.8.0 the default report has got the appsuite style format. If you would like to generate and display/save/send the formerly used style you have to add the option &amp;quot;-o&amp;quot; to every known parameter combination. &lt;br /&gt;
&lt;br /&gt;
=== Display data usage report ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -d&lt;br /&gt;
&lt;br /&gt;
If you want to know which data would be transfered, execute the report client with the option &amp;quot;-d&amp;quot; (display_only). If this option is given to the report client no data will be send:&lt;br /&gt;
&lt;br /&gt;
=== Send data usage report ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -s&lt;br /&gt;
&lt;br /&gt;
If you don't want to have the report displayed in the console (which might be the case for automated executions of the report client) execute the report client with the option -s (send_only). Now no report will be displayed after the report has been sent to activation.open-xchange.com.&lt;br /&gt;
&lt;br /&gt;
=== Available options ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -h&lt;br /&gt;
&lt;br /&gt;
lists all available options:&lt;br /&gt;
&lt;br /&gt;
 Usage: report&lt;br /&gt;
 -h,--help                                         Prints a help text          &lt;br /&gt;
    --environment                                  Show info about commandline environment&lt;br /&gt;
    --nonl                                         Remove all newlines (\n) from output&lt;br /&gt;
    --responsetimeout &amp;lt;responsetimeout&amp;gt;            response timeout in seconds for reading response from&lt;br /&gt;
                                                    the backend (default 0s; infinite)&lt;br /&gt;
 -H,--host &amp;lt;host&amp;gt;                                  specifies the host          &lt;br /&gt;
 -T,--timeout &amp;lt;timeout&amp;gt;                            timeout (in s) to conntect to the backend (default 15s)&lt;br /&gt;
 -J,--jmxauthuser &amp;lt;jmxauthuser&amp;gt;                    jmx username (when jmx authentication enabled)&lt;br /&gt;
 -P,--jmxauthpassword &amp;lt;jmxauthpassword&amp;gt;            jmx password (when jmx authentication enabled)&lt;br /&gt;
 -s,--sendonly                                     Send report without displaying it (Disables default)&lt;br /&gt;
 -d,--displayonly                                  Display report without sending it (Disables default)&lt;br /&gt;
 -c,--csv                                          Show output as CSV          &lt;br /&gt;
 -a,--advancedreport                               Run an advanced report&lt;br /&gt;
 -f,--savereport                                   Save the report as JSON String instead of sending it&lt;br /&gt;
 -b,--showaccesscombination &amp;lt;showaccesscombination&amp;gt;  Show access combination for bitmask&lt;br /&gt;
 -e,--run-appsuite-report                          Schedule an appsuite style report&lt;br /&gt;
 -t,--report-type &amp;lt;report-type&amp;gt;                    The type of the report to run&lt;br /&gt;
    --inspect-appsuite-reports                     Prints information about currently running reports&lt;br /&gt;
    --cancel-appsuite-reports                      Cancels pending reports     &lt;br /&gt;
 -g,--get-appsuite-report                          Retrieve the report that was generated&lt;br /&gt;
 -x,--run-and-deliver-report                       Create a new report and send it immediately&lt;br /&gt;
 -o,--run-and-deliver-old-report                   Run old report type. Used to have a backward compatibility.&lt;br /&gt;
&lt;br /&gt;
=== Explanation of the appsuite report console output ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -d&lt;br /&gt;
 Starting the Open-Xchange report client. Note that the report generation may take a little while.&lt;br /&gt;
&lt;br /&gt;
 f5f511d663ff462f8f963dfa41bd8cd2: 0/5 (0,00 %) &lt;br /&gt;
 UUID: f5f511d663ff462f8f963dfa41bd8cd2&lt;br /&gt;
 Type: default&lt;br /&gt;
 Total time: 389 milliseconds&lt;br /&gt;
 Avg. time per context: 77 milliseconds&lt;br /&gt;
 Report was finished: Wed Jul 08 13:42:25 CEST 2015&lt;br /&gt;
&lt;br /&gt;
 ------ report -------&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;macdetail&amp;quot; : {&lt;br /&gt;
     &amp;quot;capabilitySets&amp;quot; : [ {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 2,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 0,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     }, {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 11,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;active_sync&amp;quot;, &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;calendar&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;collect_email_addresses&amp;quot;, &amp;quot;conflict_handling&amp;quot;, &amp;quot;contacts&amp;quot;, &amp;quot;delegate_tasks&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;edit_password&amp;quot;, &amp;quot;edit_public_folders&amp;quot;, &amp;quot;edit_resource&amp;quot;, &amp;quot;filestore&amp;quot;, &amp;quot;freebusy&amp;quot;, &amp;quot;gab&amp;quot;, &amp;quot;groupware&amp;quot;, &amp;quot;ical&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;mobility&amp;quot;, &amp;quot;multiple_mail_accounts&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;olox20&amp;quot;, &amp;quot;participants_dialog&amp;quot;, &amp;quot;pim&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;portal&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publication&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;read_create_shared_folders&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;subscription&amp;quot;, &amp;quot;tasks&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;usm&amp;quot;, &amp;quot;vcard&amp;quot;, &amp;quot;webdav&amp;quot;, &amp;quot;webdav_xml&amp;quot;, &amp;quot;webmail&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 3,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     }, {&lt;br /&gt;
       &amp;quot;total&amp;quot; : 6,&lt;br /&gt;
       &amp;quot;capabilities&amp;quot; : [ &amp;quot;active_sync&amp;quot;, &amp;quot;auto_publish_attachments&amp;quot;, &amp;quot;autologin&amp;quot;, &amp;quot;caldav&amp;quot;, &amp;quot;calendar&amp;quot;, &amp;quot;carddav&amp;quot;, &amp;quot;collect_email_addresses&amp;quot;, &amp;quot;conflict_handling&amp;quot;, &amp;quot;contacts&amp;quot;, &amp;quot;delegate_tasks&amp;quot;, &amp;quot;drive&amp;quot;, &amp;quot;edit_password&amp;quot;, &amp;quot;edit_public_folders&amp;quot;, &amp;quot;edit_resource&amp;quot;, &amp;quot;freebusy&amp;quot;, &amp;quot;gab&amp;quot;, &amp;quot;groupware&amp;quot;, &amp;quot;ical&amp;quot;, &amp;quot;infostore&amp;quot;, &amp;quot;mailfilter&amp;quot;, &amp;quot;mobility&amp;quot;, &amp;quot;multiple_mail_accounts&amp;quot;, &amp;quot;oauth&amp;quot;, &amp;quot;oauth-grants&amp;quot;, &amp;quot;olox20&amp;quot;, &amp;quot;participants_dialog&amp;quot;, &amp;quot;pim&amp;quot;, &amp;quot;pop3&amp;quot;, &amp;quot;portal&amp;quot;, &amp;quot;printing&amp;quot;, &amp;quot;publication&amp;quot;, &amp;quot;publish_mail_attachments&amp;quot;, &amp;quot;read_create_shared_folders&amp;quot;, &amp;quot;rss&amp;quot;, &amp;quot;search&amp;quot;, &amp;quot;subscription&amp;quot;, &amp;quot;tasks&amp;quot;, &amp;quot;twitter&amp;quot;, &amp;quot;usm&amp;quot;, &amp;quot;vcard&amp;quot;, &amp;quot;webdav&amp;quot;, &amp;quot;webdav_xml&amp;quot;, &amp;quot;webmail&amp;quot;, &amp;quot;xing&amp;quot;, &amp;quot;xingjson&amp;quot; ],&lt;br /&gt;
       &amp;quot;quota&amp;quot; : 1073741824,&lt;br /&gt;
       &amp;quot;admin&amp;quot; : 2,&lt;br /&gt;
       &amp;quot;disabled&amp;quot; : 0&lt;br /&gt;
     } ]&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;total&amp;quot; : {&lt;br /&gt;
     &amp;quot;guests&amp;quot; : 22,&lt;br /&gt;
     &amp;quot;links&amp;quot; : 10,&lt;br /&gt;
     &amp;quot;contexts&amp;quot; : 5,&lt;br /&gt;
     &amp;quot;users&amp;quot; : 19,&lt;br /&gt;
     &amp;quot;report-format&amp;quot; : &amp;quot;appsuite-short&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;clientlogincountyear&amp;quot; : {&lt;br /&gt;
     &amp;quot;appsuite&amp;quot; : &amp;quot;7&amp;quot;,&lt;br /&gt;
     &amp;quot;olox2&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;caldav&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;usm-eas&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;mobileapp&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;ox6&amp;quot; : &amp;quot;9&amp;quot;,&lt;br /&gt;
     &amp;quot;carddav&amp;quot; : &amp;quot;1&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;clientlogincount&amp;quot; : {&lt;br /&gt;
     &amp;quot;appsuite&amp;quot; : &amp;quot;4&amp;quot;,&lt;br /&gt;
     &amp;quot;olox2&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;caldav&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;usm-eas&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;mobileapp&amp;quot; : &amp;quot;0&amp;quot;,&lt;br /&gt;
     &amp;quot;ox6&amp;quot; : &amp;quot;2&amp;quot;,&lt;br /&gt;
     &amp;quot;carddav&amp;quot; : &amp;quot;1&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;uuid&amp;quot; : &amp;quot;f5f511d663ff462f8f963dfa41bd8cd2&amp;quot;,&lt;br /&gt;
   &amp;quot;reportType&amp;quot; : &amp;quot;default&amp;quot;,&lt;br /&gt;
   &amp;quot;timestamps&amp;quot; : {&lt;br /&gt;
     &amp;quot;start&amp;quot; : 1436355744714,&lt;br /&gt;
     &amp;quot;stop&amp;quot; : 1436355745103&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;version&amp;quot; : {&lt;br /&gt;
     &amp;quot;version&amp;quot; : &amp;quot;7.8.0-Rev0&amp;quot;,&lt;br /&gt;
     &amp;quot;buildDate&amp;quot; : &amp;quot;develop&amp;quot;&lt;br /&gt;
   },&lt;br /&gt;
   &amp;quot;configs&amp;quot; : {&lt;br /&gt;
     &amp;quot;com.openexchange.mail.adminMailLoginEnabled&amp;quot; : &amp;quot;true&amp;quot;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 ------ end -------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''macdetail:'''&lt;br /&gt;
: detailed information about existing module access combinations and its usage &lt;br /&gt;
'''total:'''&lt;br /&gt;
: accumulated user, guest, link (anonymous share) and context count&lt;br /&gt;
'''clientlogincountyear:'''&lt;br /&gt;
: number of client logins for the last year&lt;br /&gt;
'''clientlogincount:'''&lt;br /&gt;
: number of client logins for the last month&lt;br /&gt;
'''uuid:'''&lt;br /&gt;
: a unique id for the report&lt;br /&gt;
'''reportType:'''&lt;br /&gt;
: given name for that report (normally 'default')&lt;br /&gt;
'''timestamps:'''&lt;br /&gt;
: timestamps of the start and end time of the report&lt;br /&gt;
'''versions:'''&lt;br /&gt;
: version and build date of the server&lt;br /&gt;
'''configs:'''&lt;br /&gt;
: server configuration (currently only for setting 'com.openexchange.mail.adminMailLoginEnabled')&lt;br /&gt;
&lt;br /&gt;
=== Explanation of the old console output ===&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/report -o -d&lt;br /&gt;
 Starting the Open-Xchange report client. Note that the report generation may take a little while.&lt;br /&gt;
 &lt;br /&gt;
 module    version    &lt;br /&gt;
 admin     6.20.5 Rev1&lt;br /&gt;
 groupware 6.20.5 Rev1&lt;br /&gt;
 &lt;br /&gt;
 '''contexts users guests links'''&lt;br /&gt;
 5        19    22     10 &lt;br /&gt;
 &lt;br /&gt;
 '''mac       count adm disabled'''&lt;br /&gt;
 268435455 6     1   0       &lt;br /&gt;
 237044501 48    0   0       &lt;br /&gt;
 5         2     2   0       &lt;br /&gt;
 &lt;br /&gt;
 '''key                                         value'''&lt;br /&gt;
 com.openexchange.mail.adminMailLoginEnabled true &lt;br /&gt;
 &lt;br /&gt;
 '''usmeas olox2 mobileapp carddav caldav'''&lt;br /&gt;
 1      0     0         0       0&lt;br /&gt;
 &lt;br /&gt;
 '''usmeasyear olox2year mobileappyear carddavyear caldavyear'''&lt;br /&gt;
 4          12        7             11          10        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''contexts:'''&lt;br /&gt;
:total number of contexts&lt;br /&gt;
'''users:'''&lt;br /&gt;
:total number of users&lt;br /&gt;
'''guests:'''&lt;br /&gt;
:total number of guests&lt;br /&gt;
'''linkss:'''&lt;br /&gt;
:total number of links shared to anonymous users&lt;br /&gt;
'''mac:'''&lt;br /&gt;
:decimal value of the module access. For conversion decimal to human readable permission please use &amp;lt;tt&amp;gt;report -b&amp;lt;/tt&amp;gt; as described below&lt;br /&gt;
'''count:'''&lt;br /&gt;
:amount of users with this module access&lt;br /&gt;
'''adm:'''&lt;br /&gt;
:amount of admin users with this specific module access&lt;br /&gt;
'''disabled:'''&lt;br /&gt;
:amount of users that are disabled&lt;br /&gt;
'''key:'''&lt;br /&gt;
:key of the configuration property&lt;br /&gt;
'''value:'''&lt;br /&gt;
:value of the configuration property&lt;br /&gt;
&lt;br /&gt;
The last rows show the amount of users that did login to Open-Xchange within the ''last 30 days'' and ''the last year'' using the specified OXtender/service.&lt;br /&gt;
&lt;br /&gt;
If you want to know the access permissions of a specific &amp;lt;tt&amp;gt;mac&amp;lt;/tt&amp;gt;, run e.g.&lt;br /&gt;
&lt;br /&gt;
 $  /opt/open-xchange/sbin/report -b 237044501&lt;br /&gt;
&lt;br /&gt;
'''usmeas:'''&lt;br /&gt;
:using mobile phone via active sync (OXtender for Business Mobility) within the last 30 days&lt;br /&gt;
'''olox2:'''&lt;br /&gt;
:using OXtender 2 for Microsoft Outlook within the last 30 days&lt;br /&gt;
'''mobileapp:'''&lt;br /&gt;
:using Open-Xchange Mobile Web Interface within the last 30 days&lt;br /&gt;
'''carddav/caldav:'''&lt;br /&gt;
:using the CalDAV/CardDAV feature within the last 30 days&lt;br /&gt;
'''usmeasyear:'''&lt;br /&gt;
:using mobile phone via active sync (OXtender for Business Mobility) within the last year&lt;br /&gt;
'''olox2:'''&lt;br /&gt;
:using OXtender 2 for Microsoft Outlook within the last year&lt;br /&gt;
'''mobileapp:'''&lt;br /&gt;
:using Open-Xchange Mobile Web Interface within the last year&lt;br /&gt;
'''carddav/caldav:'''&lt;br /&gt;
:using the CalDAV/CardDAV feature within the last year&lt;br /&gt;
&lt;br /&gt;
'''Example:''' a value of 7 below &amp;lt;tt&amp;gt;olox2&amp;lt;/tt&amp;gt; means, that within the last 30 days, 7 different users used the OXtender 2 for Microsoft Outlook to connect to Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== Automatic reports ==&lt;br /&gt;
&lt;br /&gt;
Creating a cron entry which will automatically execute the report client once a week saves a lot of work. To create this cron entry execute:&lt;br /&gt;
&lt;br /&gt;
 $ vim /etc/cron.d/open-xchange_report&lt;br /&gt;
 &lt;br /&gt;
 0 3 * * 7	open-xchange	/opt/open-xchange/sbin/report -s -x 1&amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
== What will be reported using the send method? ==&lt;br /&gt;
&lt;br /&gt;
The report client will display and / or transfer the following information:&lt;br /&gt;
&lt;br /&gt;
# Version number of the Open-Xchange server package&lt;br /&gt;
# Version number of the Open-Xchange admin package&lt;br /&gt;
# Total user count&lt;br /&gt;
# Total context count&lt;br /&gt;
# Detailed context information: context age, creation date or date of creation, user count, context id, capability sets&lt;br /&gt;
# Detailed user information (per context): User access combination flags (which modules have been activated for the users)&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:GettingStarted_7.6.0&amp;diff=21070</id>
		<title>AppSuite:GettingStarted 7.6.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:GettingStarted_7.6.0&amp;diff=21070"/>
		<updated>2015-12-08T14:47:50Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;title&amp;quot;&amp;gt;Getting Started&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; padding: 10px;&amp;quot;&amp;gt;[[File:OX_AppSuite_UI_Development_Workflow.png]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Hello and welcome to the world of OX App Suite development. This document is designed to get you started with developing your first app for OX App Suite as quickly and simply as possible. However, along the way we will also tempt you to learn more by linking to some more in-depth documentation about the various topics we cover. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing the Development Tools ==&lt;br /&gt;
&lt;br /&gt;
First, you need to install some tools which are necessary for UI development.&lt;br /&gt;
&lt;br /&gt;
TL;DR version:&lt;br /&gt;
&lt;br /&gt;
 $ npm install -g grunt-cli bower yo generator-ox-ui-module&lt;br /&gt;
&lt;br /&gt;
Or if needed, there is a complete article about setting up an environment for [[AppSuite:GettingStartedWithGrunt#Node | grunt]].&lt;br /&gt;
&lt;br /&gt;
== Create a Workspace ==&lt;br /&gt;
&lt;br /&gt;
All your app development can take place inside one working directory. The examples will assume you have created a directory named &amp;lt;tt&amp;gt;myapp&amp;lt;/tt&amp;gt; inside your home directory:&lt;br /&gt;
&lt;br /&gt;
 $ mkdir ~/myapp&lt;br /&gt;
 $ cd ~/myapp&lt;br /&gt;
&lt;br /&gt;
It doesn't need to be in your home directory, and the actual name should reflect the name of your app. The main point is that all commands will be executed in this directory and all paths will be relative to this directory from now on.&lt;br /&gt;
&lt;br /&gt;
Now, you can generate a grunt configuration using:&lt;br /&gt;
&lt;br /&gt;
 $ yo ox-ui-module&lt;br /&gt;
&lt;br /&gt;
The source code of your app will reside in the subfolder named &amp;lt;tt&amp;gt;apps&amp;lt;/tt&amp;gt;. To avoid name collisions please pick a unique subfolder inside that. The easiest and recommended way is to use a domain name that you own. Typically, the domain elements are reversed, like in Java. &amp;lt;tt&amp;gt;example.com&amp;lt;/tt&amp;gt; becomes &amp;lt;tt&amp;gt;com.example&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p apps/com.example&lt;br /&gt;
&lt;br /&gt;
== Writing an App ==&lt;br /&gt;
&lt;br /&gt;
As an example, let's create the smallest possible app and test it. It requires only two files: &amp;lt;tt&amp;gt;apps/com.example/register.js&amp;lt;/tt&amp;gt; for the source code of the app:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
define('com.example/register', function () {&lt;br /&gt;
    'use strict';&lt;br /&gt;
    alert('Hello, World!');&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &amp;lt;tt&amp;gt;apps/com.example/manifest.json&amp;lt;/tt&amp;gt; for the [[AppSuite:UI_manifests_explained | manifest]] which tells the UI that your app exists and what to do with it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;{ &amp;quot;namespace&amp;quot;: &amp;quot;core&amp;quot; }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building an App ==&lt;br /&gt;
&lt;br /&gt;
The source code of your app can't be used by OX App Suite as it. It first has to be processed by the [[AppSuite:UI_build_system | build system]]. This step will check the source code for syntax errors, compress it, and depending on the structure of your code, many other things. The processed code is then written to a directory named &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; by default. Start the build with this command:&lt;br /&gt;
&lt;br /&gt;
 $ grunt&lt;br /&gt;
&lt;br /&gt;
If your editor supports it, you can configure it to call the build system after every file save. Take care to call it from the top directory of your app's workspace, not from the directory of the saved file.&lt;br /&gt;
&lt;br /&gt;
== Testing an App ==&lt;br /&gt;
&lt;br /&gt;
The freshly built code can now be tested. Instead of uploading your code to an OX App Suite server, you can use the [[AppSuite:Appserver|appserver]] proxy to inject your code into the UI code of any existing OX App Suite installation. For example, to start &amp;lt;tt&amp;gt;appserver&amp;lt;/tt&amp;gt; using [https://www.ox.io/ www.ox.io] as the server, you will need a local configuration pointing to that server. You can register for a free user account on [https://www.ox.io/ www.ox.io]. &lt;br /&gt;
&lt;br /&gt;
You can generate it with this command:&lt;br /&gt;
&lt;br /&gt;
 $ grunt show-config:local --output grunt/local.conf.json&lt;br /&gt;
&lt;br /&gt;
To use the remote www.ox.io AppSuite server, open up the file &amp;lt;tt&amp;gt;grunt/local.conf.json&amp;lt;/tt&amp;gt; in your editor and add &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;&amp;quot;https://www.ox.io/appsuite/&amp;quot;&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt; to the &amp;lt;tt&amp;gt;server&amp;lt;/tt&amp;gt; setting of the appserver section. Also make sure that the &amp;lt;tt&amp;gt;protocol&amp;lt;/tt&amp;gt; setting is set to &amp;lt;tt&amp;gt;https&amp;lt;/tt&amp;gt;. Else you will get https redirect errors in your browser. &lt;br /&gt;
&lt;br /&gt;
INFO: If you are using a locally installed AppSuite server (in a VM or similar in your local network), just modify the server + protocol accordingly.&lt;br /&gt;
&lt;br /&gt;
Then start the development server:&lt;br /&gt;
&lt;br /&gt;
 $ grunt dev&lt;br /&gt;
&lt;br /&gt;
This command will serve your app from the local directory &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt;, and get everything else from the URL specified in the &amp;lt;tt&amp;gt;server&amp;lt;/tt&amp;gt; setting.&lt;br /&gt;
&lt;br /&gt;
Once appserver is running, you can access OX App Suite by opening your browser using this address:&lt;br /&gt;
&lt;br /&gt;
 https://localhost:8337/appsuite&lt;br /&gt;
&lt;br /&gt;
After logging in, the app should be loaded and display the &amp;lt;tt&amp;gt;alert&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
=== Development cycle ===&lt;br /&gt;
&lt;br /&gt;
Once you are sure that your setup works, you can extend the example and write the actual code for your app. The &amp;lt;tt&amp;gt;dev&amp;lt;/tt&amp;gt; task will detect any changes and rebuild your app and even reload all browsers connected to&lt;br /&gt;
&amp;lt;tt&amp;gt;https://localhost:8337/appsuite&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
While developing always keep in mind, that there is an [[AppSuite:Debugging_the_UI | article about debugging the user interface]] which helps you avoid and fix typical errors.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
Together with our ox-ui-module generator (from version 0.8.0), we provide you with generators for packaging information.&lt;br /&gt;
&lt;br /&gt;
To enable some grunt tasks to help you, you can optionally install (with npm install) &amp;lt;tt&amp;gt;grunt-contrib-compress&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;grunt-exec&amp;lt;/tt&amp;gt;. You will need those to run the grunt tasks described below.&lt;br /&gt;
&lt;br /&gt;
=== Generating a source tarball ===&lt;br /&gt;
&lt;br /&gt;
There is a grunt tasks to create source packages. You can use it to create a tar.gz file containing all sources needed to build the project. This source package should contain all dependencies that are installed during &amp;lt;tt&amp;gt;bower install&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;npm install&amp;lt;/tt&amp;gt; (basically containing your &amp;lt;tt&amp;gt;bower_components&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;node_modules&amp;lt;/tt&amp;gt; directories). To generate this file, run:&lt;br /&gt;
&lt;br /&gt;
 $ grunt dist:source --include-dependencies&lt;br /&gt;
&lt;br /&gt;
This file (can be found in the &amp;lt;tt&amp;gt;dist/&amp;lt;/tt&amp;gt; directory) together with the distribution specific packaging information will be needed to build the package.&lt;br /&gt;
&lt;br /&gt;
=== RPM packages ===&lt;br /&gt;
&lt;br /&gt;
In order to generate a spec file for your project, run:&lt;br /&gt;
&lt;br /&gt;
 $ yo ox-ui-module:rpm-pkg&lt;br /&gt;
&lt;br /&gt;
Will generate a spec file, with some default values read from your &amp;lt;tt&amp;gt;package.json&amp;lt;/tt&amp;gt; file. So you might want to make this file as complete as possible. However, yeoman will ask you about the information missing.&lt;br /&gt;
&lt;br /&gt;
''Please remember, that the generated spec file is only a scaffold for a real one. It will work for very simple cases, but as soon as your package gets more complicated, you will have to adjust it to your needs.''&lt;br /&gt;
&lt;br /&gt;
Once you have the spec file in your project, you can use&lt;br /&gt;
&lt;br /&gt;
 $ grunt rpm-build --include-dependencies # or rpm-build if you are on shared-grunt-config-0.6.0&lt;br /&gt;
&lt;br /&gt;
=== DEB packages ===&lt;br /&gt;
&lt;br /&gt;
Creating packages for the Debian distribution works similar to rpm packages. Just run:&lt;br /&gt;
&lt;br /&gt;
 $ yo ox-ui-module:deb-pkg&lt;br /&gt;
&lt;br /&gt;
This will generate a debian directory containing all needed files. Some default values will be read from your &amp;lt;tt&amp;gt;package.json&amp;lt;/tt&amp;gt; file. So you might want to make this file as complete as possible. However, yeoman will ask you about the information missing.&lt;br /&gt;
&lt;br /&gt;
''Please remember, that the generated spec file is only a scaffold for a real one. It will work for very simple cases, but as soon as your package gets more complicated, you will have to adjust it to your needs.''&lt;br /&gt;
&lt;br /&gt;
Once you have a debian/ directory for your project, you can go on. Now you can run:&lt;br /&gt;
&lt;br /&gt;
 $ grunt dpkg-buildpackage --include-dependencies&lt;br /&gt;
&lt;br /&gt;
== i18n ==&lt;br /&gt;
&lt;br /&gt;
To use the proven way to translate your AppSuite application, you should now check out the [[AppSuite:I18n | documentation]] about all [[AppSuite:I18n | i18n]] tasks. Please browse to the [[AppSuite:I18n | i18n]] page.&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* Congratulations you have just built your first app for OX App Suite, but please keep in mind that there are [[AppSuite:Developing for the UI#What_can_i_build.3F | quite a few options]] for developing for OX App Suite.&lt;br /&gt;
* In case you want to upgrade your existing app for OX App Suite, read [[Appsuite:Upgrade_app_using_yo | the upgrade guide]].&lt;br /&gt;
* More information on the build system can be found on github:&lt;br /&gt;
** [https://github.com/Open-Xchange-Frontend/shared-grunt-config See all available grunt tasks]&lt;br /&gt;
** [https://github.com/Open-Xchange-Frontend/generator-ox-ui-module Documentation of all generator tasks]&lt;br /&gt;
* If you're stuck somewhere, the article about [[AppSuite:Debugging_the_UI | debugging the UI]] might help you.&lt;br /&gt;
* You can read this to get a better overview of [[AppSuite:Developing for the UI | developing the user inferface]].&lt;br /&gt;
&lt;br /&gt;
[[Category: OX7]]&lt;br /&gt;
[[Category: AppSuite]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20211</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20211"/>
		<updated>2015-08-12T14:18:39Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20210</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20210"/>
		<updated>2015-08-12T14:18:16Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-56 Percona-XtraDB-Cluster-client-56&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=User:Usman.ahmad&amp;diff=20209</id>
		<title>User:Usman.ahmad</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=User:Usman.ahmad&amp;diff=20209"/>
		<updated>2015-08-12T14:14:20Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: Undo revision 20208 by Usman.ahmad (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=User:Usman.ahmad&amp;diff=20208</id>
		<title>User:Usman.ahmad</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=User:Usman.ahmad&amp;diff=20208"/>
		<updated>2015-08-12T14:13:38Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
test2&lt;br /&gt;
&lt;br /&gt;
ewerw3&lt;br /&gt;
r&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=User:Usman.ahmad&amp;diff=20207</id>
		<title>User:Usman.ahmad</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=User:Usman.ahmad&amp;diff=20207"/>
		<updated>2015-08-12T14:13:27Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: Created page with &amp;quot;test&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;test&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20200</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20200"/>
		<updated>2015-08-12T09:04:16Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6 and CentOS 7.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
 yum localinstall percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
For those who are using CentOS 7, the localinstall option is not longer available. Therefore do the following:&lt;br /&gt;
&lt;br /&gt;
 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
Then run the following commands regardless of the O.S. you are using.&lt;br /&gt;
&lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-56 Percona-XtraDB-Cluster-client-56&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20199</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20199"/>
		<updated>2015-08-12T09:03:12Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6 and CentOS 7.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
 yum localinstall percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
 For those who are using CentOS 7, the localinstall option is not longer available. Therefore do the following:&lt;br /&gt;
&lt;br /&gt;
 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-56 Percona-XtraDB-Cluster-client-56&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20198</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20198"/>
		<updated>2015-08-12T09:02:05Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6 and CentOS 7.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
 yum localinstall percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
For those who are using CentOS 7, the localinstall option is not longer available. Therefore do the following:&lt;br /&gt;
&lt;br /&gt;
 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-56 Percona-XtraDB-Cluster-client-56&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20197</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20197"/>
		<updated>2015-08-12T09:01:40Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6 and CentOS 7.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
 yum localinstall percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
For those who are using CentOS 7, the localinstall option is not longer available. Therefore do the following:&lt;br /&gt;
&lt;br /&gt;
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-56 Percona-XtraDB-Cluster-client-56&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20196</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=20196"/>
		<updated>2015-08-12T08:43:28Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
 yum install socat&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19998</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19998"/>
		<updated>2015-07-20T08:23:45Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 # Note that xtraback-v2 is the latest version and is the new default,&lt;br /&gt;
 # while xtrabackup will also work but will be soon deprecated.&lt;br /&gt;
 wsrep_sst_method=xtrabackup-v2&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19746</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19746"/>
		<updated>2015-06-25T12:53:00Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19744</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19744"/>
		<updated>2015-06-25T09:28:21Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Pre-requisite for RPM based distributions ===&lt;br /&gt;
&lt;br /&gt;
For RPM-based distributions, such as (RHEL, CentOS, Suse) if you have an existing MySQL or related database server and Postfix installed on your system, you need to remove Postfix before you can install Galera Cluster.&lt;br /&gt;
&lt;br /&gt;
When you install Galera Cluster over an existing MySQL installation, yum removes the existing database server package and replaces it with a new one that was built using the wsrep API patch. However, Postfix registers the database server package as a dependency. Meaning that, if you try to install the mysql-wsrep-server package from Codership without removing Postfix, yum fails since Postfix’s dependency on MySQL-server blocks the installation.&lt;br /&gt;
&lt;br /&gt;
To remove Postfix, run the following command:&lt;br /&gt;
&lt;br /&gt;
 yum remove postfix&lt;br /&gt;
&lt;br /&gt;
This removes Postfix from your system. If you still want to use Postfix, you can reinstall it after you finish installing Galera Cluster.&lt;br /&gt;
&lt;br /&gt;
 yum install postfix&lt;br /&gt;
&lt;br /&gt;
Postfix now uses Galera Cluster as its database server backend.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default_storage_engine=InnoDB&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=My.cnf&amp;diff=19334</id>
		<title>My.cnf</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=My.cnf&amp;diff=19334"/>
		<updated>2015-04-13T09:28:31Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page lists some parameters (MySQL 5.1) which might be worth to adjust on a MySQL instance running the Open-Xchange databases.&lt;br /&gt;
&lt;br /&gt;
This is NOT a reference configuration but shows some possible settings. Please check the MySQL documentation for your version to understand the settings and test local changes carefully.&lt;br /&gt;
&lt;br /&gt;
=== Configuration items ===&lt;br /&gt;
&lt;br /&gt;
* You should adjust the &amp;lt;code&amp;gt;innodb_buffer_pool_size&amp;lt;/code&amp;gt; parameter for better memory usage. This is where all the memory of large DB machines should go. For example, on a 32 GB RAM machine, this can go up to 24 GB.&lt;br /&gt;
&lt;br /&gt;
* On bigger installations you should use &amp;lt;code&amp;gt;innodb_file_per_table = 1&amp;lt;/code&amp;gt;, which is creating single files instead of one big blob. If you change this parameter after the database initialization you have to recreate (like dump/drop and re-import) the tables.&lt;br /&gt;
&lt;br /&gt;
* Some benchmarks indicate that actually switching off the query cache helps performance. You may want to experiment with this. To switch it off, use &amp;lt;code&amp;gt;query_cache_size=0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;query_cache_type=0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* It can help to put different parts of the mysql datadir (iblog, ibdata) on different filesystems / storage devices. This depends on your infrastructure. Settings herefore are &amp;lt;code&amp;gt;datadir&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;innodb_data_home_dir&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;innodb_log_group_home_dir&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If your storage is fast, thus it can handle a lot of IOPS, you may want to adjust the &amp;lt;code&amp;gt;innodb_io_capacity&amp;lt;/code&amp;gt; setting, which defines a limit for the IOPS MySQL will create. The default is 200, which is sensible for single spindle disks. But if you have storage appliances with a lot of fast SAS drives, or even SSDs, this limit can be increased greatly.&lt;br /&gt;
&lt;br /&gt;
=== Sample my.cnf file ===&lt;br /&gt;
&lt;br /&gt;
This file does not contain all the configuration items discussed in the previous section. Use this as a starting point and adjust it, particularly considering the configuration items discussed in the previous section.&lt;br /&gt;
&lt;br /&gt;
 #&lt;br /&gt;
 [client]&lt;br /&gt;
 port            = 3306&lt;br /&gt;
 socket          = /var/run/mysqld/mysqld.sock&lt;br /&gt;
 &lt;br /&gt;
 [mysqld]&lt;br /&gt;
 socket          = /var/run/mysqld/mysqld.sock&lt;br /&gt;
 port            = 3306&lt;br /&gt;
 user                           = mysql&lt;br /&gt;
 # applies only when running as root&lt;br /&gt;
 #memlock                        = 1&lt;br /&gt;
 &lt;br /&gt;
 table_open_cache               = 3072&lt;br /&gt;
 table_definition_cache         = 4096&lt;br /&gt;
 max_heap_table_size            = 64M&lt;br /&gt;
 tmp_table_size                 = 64M&lt;br /&gt;
 max_connections                = 505&lt;br /&gt;
 max_user_connections           = 500&lt;br /&gt;
 max_allowed_packet             = 16M&lt;br /&gt;
 thread_cache_size              = 32&lt;br /&gt;
 query_cache_size               = 64M&lt;br /&gt;
 &lt;br /&gt;
 # InnoDB&lt;br /&gt;
 default_table_type             = InnoDB&lt;br /&gt;
 &lt;br /&gt;
 # 80% of ram that is dedicated for the database (this needs to be adjusted to your system)&lt;br /&gt;
 innodb_buffer_pool_size        = 14G&lt;br /&gt;
 # number of CPU cores dedicated to the MySQL InnoDB backend &lt;br /&gt;
 innodb_buffer_pool_instances = 16 &lt;br /&gt;
 &lt;br /&gt;
 innodb_data_file_path          = ibdata1:128M:autoextend&lt;br /&gt;
 innodb_file_per_table          = 1&lt;br /&gt;
 innodb_log_file_size           = 512M&lt;br /&gt;
 innodb_log_files_in_group      = 2&lt;br /&gt;
 &lt;br /&gt;
 # MyISAM&lt;br /&gt;
 myisam_recover                 = backup,force&lt;br /&gt;
 &lt;br /&gt;
 # Logging&lt;br /&gt;
 log_warnings                   = 2&lt;br /&gt;
 log_error                      = /var/log/mysql/error.log&lt;br /&gt;
 &lt;br /&gt;
 slow_query_log                 = 1&lt;br /&gt;
 slow_query_log_file            = /var/log/mysql/mysql-slow.log&lt;br /&gt;
 long_query_time                = 1&lt;br /&gt;
 log_queries_not_using_indexes  = 0&lt;br /&gt;
 min_examined_row_limit         = 20&lt;br /&gt;
 &lt;br /&gt;
 # Binary Log / Replication&lt;br /&gt;
 server_id                      = 1&lt;br /&gt;
 log-bin                        = mysql-bin&lt;br /&gt;
 binlog_cache_size              = 1M &lt;br /&gt;
 sync_binlog                    = 8&lt;br /&gt;
 binlog_format                  = row&lt;br /&gt;
 expire_logs_days               = 7&lt;br /&gt;
 max_binlog_size                = 128M &lt;br /&gt;
 relay-log                      = /var/log/mysql/slave-relay.log&lt;br /&gt;
 relay-log-index                = /var/log/mysql/slave-relay-log.index &lt;br /&gt;
 &lt;br /&gt;
 [mysqldump]&lt;br /&gt;
 quick&lt;br /&gt;
 single-transaction&lt;br /&gt;
 max_allowed_packet             = 16M&lt;br /&gt;
 &lt;br /&gt;
 [mysql]&lt;br /&gt;
 no_auto_rehash&lt;br /&gt;
 &lt;br /&gt;
 [myisamchk]&lt;br /&gt;
 key_buffer                     = 512M&lt;br /&gt;
 sort_buffer_size               = 512M&lt;br /&gt;
 read_buffer                    = 8M&lt;br /&gt;
 write_buffer                   = 8M&lt;br /&gt;
 &lt;br /&gt;
 [mysqld_safe]&lt;br /&gt;
 open-files-limit               = 8192&lt;br /&gt;
 log-error                      = /var/log/mysql/error.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Note for MySQL version 5.5 or higher ===&lt;br /&gt;
&lt;br /&gt;
A small change for the above sample configuration file needed when using MySQL ver. 5.5.x or higher, e.g. used by Percona XtraDB Cluster / Galera.&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
&lt;br /&gt;
 default_table_type             = InnoDB&lt;br /&gt;
&lt;br /&gt;
With&lt;br /&gt;
&lt;br /&gt;
 default_storage_engine         = InnoDB&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19333</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19333"/>
		<updated>2015-04-10T14:43:45Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* my.cnf configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux/SLES Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19332</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19332"/>
		<updated>2015-04-10T14:39:46Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Cluster startup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file) for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19331</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19331"/>
		<updated>2015-04-10T14:39:32Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Cluster startup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user (we will use the same username and password as we defined in the previous section when setting up wsrep.cnf file)for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19330</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19330"/>
		<updated>2015-04-10T14:32:29Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
Once this is all done, don't forget to run the update command to get the latest Percona packages.&lt;br /&gt;
&lt;br /&gt;
 yum update&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19329</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19329"/>
		<updated>2015-04-10T14:27:44Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* wsrep.cnf configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''''/etc/mysql/conf.d/wsrep.cnf''''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19328</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19328"/>
		<updated>2015-04-10T14:27:17Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* wsrep.cnf configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample '''/etc/mysql/conf.d/wsrep.cnf''' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19327</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19327"/>
		<updated>2015-04-10T14:26:53Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* my.cnf configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''!includedir /etc/mysql/conf.d''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
'''Caveat''': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample ''/etc/mysql/conf.d/wsrep.cnf'' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19326</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19326"/>
		<updated>2015-04-10T14:26:19Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* my.cnf configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like '''''!includedir /etc/mysql/conf.d''''', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
''Caveat'': we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample ''/etc/mysql/conf.d/wsrep.cnf'' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19325</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19325"/>
		<updated>2015-04-10T14:25:15Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* my.cnf configuration file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a '''my.cnf''' configuration file. Usually MySQL expects this file to be located at '''''/etc/mysql/my.cnf'''''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Default location for my.cnf file based on different Linux Distros.&lt;br /&gt;
&lt;br /&gt;
* If you are using Debian Linux file is located at /etc/mysql/my.cnf location&lt;br /&gt;
* If you are using Red Hat Linux/Centos Linux file is located at /etc/my.cnf location&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like ''!includedir /etc/mysql/conf.d'', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
Caveat: we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample ''/etc/mysql/conf.d/wsrep.cnf'' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19324</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19324"/>
		<updated>2015-04-10T14:20:56Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on '''''socat''''' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a ''my.cnf'' configuration file. Usually MySQL expects this file to be located at ''/etc/mysql/my.cnf''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like ''!includedir /etc/mysql/conf.d'', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
Caveat: we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample ''/etc/mysql/conf.d/wsrep.cnf'' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19323</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19323"/>
		<updated>2015-04-10T14:20:25Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on ''socat'' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
 yum install epel-release&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a ''my.cnf'' configuration file. Usually MySQL expects this file to be located at ''/etc/mysql/my.cnf''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like ''!includedir /etc/mysql/conf.d'', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
Caveat: we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample ''/etc/mysql/conf.d/wsrep.cnf'' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19322</id>
		<title>Template:OXLoadBalancingClustering Database</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Template:OXLoadBalancingClustering_Database&amp;diff=19322"/>
		<updated>2015-04-10T14:18:31Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* RHEL 6 systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
You can choose between Galera or two-sided Master/Slave (&amp;quot;Master/Master&amp;quot;) replication.&lt;br /&gt;
&lt;br /&gt;
== Galera database setup ==&lt;br /&gt;
&lt;br /&gt;
OX only supports the &amp;quot;Percona XtraDB Cluster 5.5&amp;quot; flavor of the Galera database.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
==== Debian systems ====&lt;br /&gt;
&lt;br /&gt;
The following has been adjusted to work with Wheezy, but works similar with Squeeze, only the repo paths need adjustments.&lt;br /&gt;
&lt;br /&gt;
To install the software, we first need to configure the repository and its build key, update our sources lists and install the packages:&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver  hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A&lt;br /&gt;
 gpg -a --export CD2EFD2A | apt-key add -&lt;br /&gt;
 &lt;br /&gt;
 cat &amp;gt;/etc/apt/sources.list.d/percona.list &amp;lt;&amp;lt;EOF&lt;br /&gt;
 deb http://repo.percona.com/apt wheezy main&lt;br /&gt;
 deb-src http://repo.percona.com/apt wheezy main&lt;br /&gt;
 EOF&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install percona-xtradb-cluster-client-5.5 percona-xtradb-cluster-server-5.5 percona-xtrabackup&lt;br /&gt;
&lt;br /&gt;
==== RHEL 6 systems ====&lt;br /&gt;
&lt;br /&gt;
Should also apply to CentOS 6.&lt;br /&gt;
&lt;br /&gt;
First, disable '''''selinux, iptables, ip6tables'''''. (Galera does not run with selinux. Using iptables and ip6tables should work if you configure it correctly, but documentation thereof is out of scope of this document.) Reboot.&lt;br /&gt;
&lt;br /&gt;
Percona XtraDB Cluster relies on ''socat'' which is not shipped by RHEL. We need to install from a different source. The ''epel'' repository can be used for that.&lt;br /&gt;
&lt;br /&gt;
The installation command itself needs to be a composite ''remove'', ''install'' command since yum is not clever enough to resolve the conflicts itself, so we need to tell it how.&lt;br /&gt;
&lt;br /&gt;
 wget http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 yum localinstall percona-release-0.0-1.x86_64.rpm&lt;br /&gt;
 &lt;br /&gt;
 yum shell&lt;br /&gt;
 remove mysql-libs&lt;br /&gt;
 install Percona-XtraDB-Cluster-server-55 Percona-XtraDB-Cluster-client-55&lt;br /&gt;
 run&lt;br /&gt;
 quit&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
==== ''my.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
Galera needs also a ''my.cnf'' configuration file. Usually MySQL expects this file to be located at ''/etc/mysql/my.cnf''. But the Percona packages don't ship any; on purpose: https://bugs.launchpad.net/percona-server/+bug/673844&lt;br /&gt;
&lt;br /&gt;
Thus, you need to obtain / install / create one on your own. Make sure it has no settings which are forbidden for Galera. This includes the ''query_cache'' (it must not be enabled with Galera) and probably other settings which would contradict the settings explained in the next section.&lt;br /&gt;
&lt;br /&gt;
Make sure you apply standard tunings for your memory size, number of allowed connections, and stuff.&lt;br /&gt;
&lt;br /&gt;
We assume in the following that the ''my.cnf'' file has a directive like ''!includedir /etc/mysql/conf.d'', such that you can put additional config files ending with ''.cnf'' there.&lt;br /&gt;
&lt;br /&gt;
A sample ''my.cnf'' file serving as a starting point is provided here: [[My.cnf]]. Make sure you read the whole article and adjust that file to suit your needs before actually using it.&lt;br /&gt;
&lt;br /&gt;
Caveat: we found out that Galera performs suboptimal when using ''innodb_flush_log_at_trx_commit=1''. We leave up to you to assess whether this is a no-go for your environment or not. For Galera reasonable values for this parameter are ''innodb_flush_log_at_trx_commit=2'' or ''...=0''. Make sure to read the documentataion of this parameter and that you understand its implication before using it.&lt;br /&gt;
&lt;br /&gt;
Furthermore, you need to set the &amp;quot;datadir&amp;quot; configurable in the ''my.cnf'' file, even if you are on the default and do not want to change it. Some SST methods depend the setting being explicitly present in the configuration file.&lt;br /&gt;
&lt;br /&gt;
==== ''wsrep.cnf'' configuration file ====&lt;br /&gt;
&lt;br /&gt;
The Galera configuration then happens in a section called &amp;quot;wsrep&amp;quot;, &amp;quot;write set replication&amp;quot;, which is the internal name for the replication mechanism Galera is based on. A sample ''/etc/mysql/conf.d/wsrep.cnf'' file looks like:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 # the following lines are required for galera:&lt;br /&gt;
 binlog_format=ROW&lt;br /&gt;
 default-storage-engine=innodb&lt;br /&gt;
 innodb_autoinc_lock_mode=2&lt;br /&gt;
 innodb_locks_unsafe_for_binlog=1&lt;br /&gt;
 query_cache_size=0&lt;br /&gt;
 query_cache_type=0&lt;br /&gt;
 bind-address=0.0.0.0&lt;br /&gt;
 wsrep_provider=/usr/lib64/libgalera_smm.so&lt;br /&gt;
 # NOTE: on Wheezy, use this path:&lt;br /&gt;
 # wsrep_provider=/usr/lib/libgalera_smm.so&lt;br /&gt;
 # the following lines need to be adjusted to your environment ... CHANGE THE PASSWORD! :-)&lt;br /&gt;
 wsrep_cluster_name=&amp;quot;my_wsrep_cluster&amp;quot;&lt;br /&gt;
 wsrep_cluster_address=&amp;quot;gcomm://&amp;lt;GALERA_NODE1_IP&amp;gt;,&amp;lt;GALERA_NODE2_IP&amp;gt;,&amp;lt;GALERA_NODE3_IP&amp;gt;&amp;quot;&lt;br /&gt;
 wsrep_sst_method=xtrabackup&lt;br /&gt;
 wsrep_sst_auth=wsrep:5ojijmedUg8&lt;br /&gt;
 # It is recommended to run Galera in synchronous mode, which makes it possible&lt;br /&gt;
 # to disable the OX builtin database replication monitor.&lt;br /&gt;
 # Default is semi-synchronous mode. To enable synchronous mode, use&lt;br /&gt;
 wsrep_causal_reads=1&lt;br /&gt;
&lt;br /&gt;
When you adjusted those files, make sure they are identical on all nodes.&lt;br /&gt;
&lt;br /&gt;
The replication user will be created later when the DB is running on the first node.&lt;br /&gt;
&lt;br /&gt;
=== Cluster startup ===&lt;br /&gt;
&lt;br /&gt;
Whenever not all nodes of a Galera cluster are running (like before starting the cluster for the very first time), the first Galera node needs to get started with the ''wsrep_cluster_address'' parameter overridden to the value &amp;quot;gcomm://&amp;quot; in order to denote that the node shall not try to join an existing cluster (which would inevitably fail now, because no other cluster nodes are running yet), but to bootstrap the cluster instead. This override can most conveniently done on the command line, instead of editing to wsrep.cnf file to and fro.&lt;br /&gt;
&lt;br /&gt;
So, for the first node, the startup command is&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe --wsrep_cluster_address=gcomm:// &amp;amp;&lt;br /&gt;
&lt;br /&gt;
You should then verify the Galera module is loaded properly using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You should verify some settings like&lt;br /&gt;
&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                               |&lt;br /&gt;
 | wsrep_cluster_size         | 1                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                              |&lt;br /&gt;
 | wsrep_connected            | ON                                   |&lt;br /&gt;
 | wsrep_provider_name        | Galera                               |&lt;br /&gt;
 | wsrep_provider_vendor      | Codership Oy &amp;lt;info@codership.com&amp;gt;    |&lt;br /&gt;
 | wsrep_provider_version     | 2.8(r162)                            |&lt;br /&gt;
 | wsrep_ready                | ON                                   |&lt;br /&gt;
&lt;br /&gt;
Now you need to create the database user for the replication on this first node:&lt;br /&gt;
&lt;br /&gt;
 # create wsrep user: in mysql shell:&lt;br /&gt;
 CREATE USER 'wsrep'@'localhost' IDENTIFIED BY '5ojijmedUg8';&lt;br /&gt;
 GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'wsrep'@'localhost';&lt;br /&gt;
 FLUSH PRIVILEGES;&lt;br /&gt;
&lt;br /&gt;
The Galera peers can then be started on the nodes 2 and 3 using&lt;br /&gt;
&lt;br /&gt;
 mysqld_safe &amp;amp;&lt;br /&gt;
&lt;br /&gt;
Since the standard service startup scripts cannot account for this special treatment, we recomment not to use them.&lt;br /&gt;
&lt;br /&gt;
You can check the status of the Galera cluster using&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;show status like 'wsrep%';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The output is lengthy. The most relevant fields are given as follows:&lt;br /&gt;
&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | Variable_name              | Value                                                                |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
 | wsrep_local_state_comment  | Synced                                                               |&lt;br /&gt;
 | wsrep_incoming_addresses   | &amp;lt;GALERA_NODE1_IP&amp;gt;:3306,&amp;lt;GALERA_NODE2_IP&amp;gt;:3306,&amp;lt;GALERA_NODE3_IP&amp;gt;:3306 |&lt;br /&gt;
 | wsrep_cluster_size         | 3                                                                    |&lt;br /&gt;
 | wsrep_cluster_status       | Primary                                                              |&lt;br /&gt;
 | wsrep_connected            | ON                                                                   |&lt;br /&gt;
 | wsrep_ready                | ON                                                                   |&lt;br /&gt;
 +----------------------------+----------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
&lt;br /&gt;
The logs are helpful. Always.&lt;br /&gt;
&lt;br /&gt;
Common mistakes are listed below.&lt;br /&gt;
&lt;br /&gt;
If the Galera module does not get loaded at all:&lt;br /&gt;
* Configuration settings in ''my.cnf'' which are incompatible to Galera&lt;br /&gt;
* Wrong path of the shared object providing the Galera plugin in wsrep.cnf (wsrep_provider)&lt;br /&gt;
&lt;br /&gt;
If the first node starts, but the second / third nodes can not be added to the cluster:&lt;br /&gt;
* User for the replication not created correctly on the first Galera node&lt;br /&gt;
&lt;br /&gt;
=== Notes about configuring OX for use with Galera ===&lt;br /&gt;
&lt;br /&gt;
==== Write requests ====&lt;br /&gt;
&lt;br /&gt;
Open-Xchange supports Galera as database backend only in the configuration where all writes are directed to one Galera node. For availability, it makes sense to configure a floating IP as write IP for OX, which can be transferred from one Galera to another Galera node if needed. We recommend putting the control of such a floating IP under the control of some HA cluster software like pacemaker/corosync.&lt;br /&gt;
&lt;br /&gt;
==== Read requests ====&lt;br /&gt;
&lt;br /&gt;
You can chose between using a load balancer, using a floating IP for the read requests, or use the write requests floating IP.&lt;br /&gt;
&lt;br /&gt;
* Load balancer based setup: Read requests get distributed aribtrarily between the Galera nodes. You require a load balancer for this. See next section. Then, in this configuration, you have two alternatives: &lt;br /&gt;
** The Galera option wsrep_causal_reads=1 option enables you to configure OX with its replication monitor disabled (com.openexchange.database.replicationMonitor=false in configdb.properties).&lt;br /&gt;
** Alternatively, you can run Galera with wsrep_causal_reads=0 when switching on OX builtin replication monitor. This setup however seems to be inferior from the performance point of view.&lt;br /&gt;
* Use a designated floating IP for the read requests: This eliminates the need of a load balancer. Since read requests do not seem to be performance-limiting, we expect to perform this option on par with the loadbalancer option.&lt;br /&gt;
* Use the floating IP for the writes also for the reads: In this scenario, you direct all database queries only to one Galera node, and the other two nodes are only getting queries in case of a failure of that node. In this case, you can even use wsrep_causal_reads=0 wile still having OX builtin replication monitor switched off.&lt;br /&gt;
&lt;br /&gt;
=== Loadbalancer options ===&lt;br /&gt;
&lt;br /&gt;
While the JDBC driver has some round-robin load balancing capabilities built-in, we don't recommend it for production use since it lacks possibilities to check the Galera nodes health states.&lt;br /&gt;
&lt;br /&gt;
For most productions setup customers use enterprise-grade loadbalancing appliances. Those should get configured to check node availability not only on the TCP level, but to query the Galera sync status periodically. For an example of such an health check, see the our documentation for setting up a software loadbalancer using keepalived (next paragraph).&lt;br /&gt;
&lt;br /&gt;
It is possible to use Keepalived to create a software loadbalancer on a therefore dedicated linux node. Documentation is available [[Keepalived|here]]. This implements the round-robin part for the read requests. For the single-node write behavior, we recommend to use a floating IP then.&lt;br /&gt;
&lt;br /&gt;
In case where the Keepalived based approach is not feasible due to its requirements on the infrastructure, it is also possible to use a HAproxy based solution where HAproxy processes run on each of the OX nodes, configured for one round-robin and one active/passive instance. OX is then connecting to the local HAproxy instances. It is vital to configure HAproxy timeouts different from the defaults, otherwise HAproxy will kill active DB connections, causing errors. Some configuration hints for HAproxy are available [[HAproxy|here]].&lt;br /&gt;
&lt;br /&gt;
== Master/Master database setup ==&lt;br /&gt;
This section describes the setup process &amp;quot;Master/Master replication&amp;quot; for new Open-Xchange  database cluster. During configuration and initialization, other database operations must be prohibited.&lt;br /&gt;
&lt;br /&gt;
The Master/Master replication is a vice versa setup of Master/Slave configurations. This means each server is afterwards the slave of the other. &lt;br /&gt;
&lt;br /&gt;
Server IPs in the example are 1.1.1.1 and 9.9.9.9&lt;br /&gt;
&lt;br /&gt;
Startup both database machines and install the mysql server packages&lt;br /&gt;
 $ apt-get install mysql-server&lt;br /&gt;
&lt;br /&gt;
During the installation, a dialog will show up to set a password for the MySQL 'root' user.&lt;br /&gt;
&lt;br /&gt;
Open the MySQL configuration file on both servers:&lt;br /&gt;
 $ vim /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Modify or enable the following configuration options in the mysqld-section, use 1 as ${unique Number} on the server 1.1.1.1 and 2 for 9.9.9.9: &lt;br /&gt;
 bind-address            = 0.0.0.0&lt;br /&gt;
 server-id               = ${unique Number}&lt;br /&gt;
 log_bin                 = /var/log/mysql/mysql-bin.log&lt;br /&gt;
 binlog_format           = statement&lt;br /&gt;
 max_allowed_packet      = 16M&lt;br /&gt;
&lt;br /&gt;
* ''bindaddress'' specifies the network address where MySQL is listening for network connections. Since the MySQL slave and both Open-Xchange Servers are dedicated machines it is required to have the master accessible through the network.&lt;br /&gt;
* ''server-id'' is just a unique number within a environment with multiple MySQL servers. It needs to be unique for each server in a replication cluster.&lt;br /&gt;
* ''log-bin'' enables the MySQL binary log which is required for Master/Master replication. In general every statement triggered at the database is stored there to get distributed through the database cluster.&lt;br /&gt;
&lt;br /&gt;
To apply the configuration changes, restart the MySQL servers.&lt;br /&gt;
 $ /etc/init.d/mysql restart&lt;br /&gt;
&lt;br /&gt;
Then login to MySQL with the credentials given at the MySQL installation process&lt;br /&gt;
 $ mysql -u root -p&lt;br /&gt;
 Enter password:&lt;br /&gt;
&lt;br /&gt;
=== First Master configuration ===&lt;br /&gt;
Choose one server to start with as the first Master (here we use 1.1.1.1).&lt;br /&gt;
&lt;br /&gt;
Create a MySQL user with rights &amp;quot;REPLICATION&amp;quot;. This account is used by the MySQL slave to fetch database updates. In this example, the username is &amp;quot;replication&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'9.9.9.9' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and note the log Position and File name:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000001 |     1111 |              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== First Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
On 9.9.9.9, set the MySQL system user as owner of the binary log that has just been copied to the slave.&lt;br /&gt;
 $ chown mysql:adm /var/log/mysql/*&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 9.9.9.9 to use 1.1.1.1 as Master Server. (Use the actual log File name and Position which you just obtained with the command SHOW MASTER STATUS  on 1.1.1.1. as explained above.)&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='1.1.1.1', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=1111;&lt;br /&gt;
&lt;br /&gt;
Start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
And check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
=== Second Master configuration ===&lt;br /&gt;
&lt;br /&gt;
This means, the first Master/Slave Replication is working and the &amp;quot;reverse&amp;quot; replication needs to be prepared. Please now create the replication user on 9.9.9.9:&lt;br /&gt;
&lt;br /&gt;
  mysql&amp;gt; GRANT REPLICATION SLAVE ON *.* TO 'replication'@'1.1.1.1' IDENTIFIED BY 'secret';&lt;br /&gt;
&lt;br /&gt;
Verify that the MySQL daemon writes a binary log and remember the log Position:&lt;br /&gt;
 mysql&amp;gt; SHOW MASTER STATUS;&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
 | mysql-bin.000009 |      9999|              |                  |&lt;br /&gt;
 +------------------+----------+--------------+------------------+&lt;br /&gt;
&lt;br /&gt;
=== Second Slave configuration ===&lt;br /&gt;
&lt;br /&gt;
1.1.1.1 is now the slave in this context and 9.9.9.9 is the master. Log in to 1.1.1.1&lt;br /&gt;
&lt;br /&gt;
Configure MySQL on 1.1.1.1 to use 9.9.9.9 as Master Server. Use the remembered log and file position from 1.1.1.1.&lt;br /&gt;
 mysql&amp;gt; CHANGE MASTER TO MASTER_HOST='9.9.9.9', MASTER_USER='replication', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=9999;&lt;br /&gt;
&lt;br /&gt;
start the MySQL slave replication&lt;br /&gt;
 mysql&amp;gt; START SLAVE;&lt;br /&gt;
&lt;br /&gt;
and check the status&lt;br /&gt;
 mysql&amp;gt; SHOW SLAVE STATUS\G;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slave_IO_Running&amp;quot; and &amp;quot;Slave_SQL_Running&amp;quot; should be set to &amp;quot;yes&amp;quot;. Furthermore  &amp;quot;Read_Master_Log_Pos&amp;quot; should be counting and &amp;quot;Seconds_Behind_Master&amp;quot; should be approaching the 0 mark.&lt;br /&gt;
&lt;br /&gt;
Also check the syslog if the replication has been sucessfully started&lt;br /&gt;
 $ tail -fn20 /var/log/syslog&lt;br /&gt;
 Jul 26 19:03:45 dbslave mysqld[4718]: 090726 19:03:45 [Note] Slave I/O thread: connected to master 'replication@1.1.1.17:3306',  replication started in log 'mysql-bin.000001' at position 10000&lt;br /&gt;
&lt;br /&gt;
=== Testing Master/Master ===&lt;br /&gt;
&lt;br /&gt;
On 1.1.1.1, create a new database in MySQL:&lt;br /&gt;
 mysql&amp;gt; CREATE DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Verify the database to als be available on 9.9.9.9 afterwards:&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | foo                |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
Delete the new database on 9.9.9.9:&lt;br /&gt;
 mysql&amp;gt; DROP DATABASE foo;&lt;br /&gt;
&lt;br /&gt;
Check if the database has also been removed on 1.1.1.1&lt;br /&gt;
 mysql&amp;gt; SHOW DATABASES;&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | Database           |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
 | information_schema |&lt;br /&gt;
 | mysql              |&lt;br /&gt;
 +--------------------+&lt;br /&gt;
&lt;br /&gt;
== Creating Open-Xchange user ==&lt;br /&gt;
&lt;br /&gt;
Now setup access for the Open-Xchange Server database user 'openexchange' to configdb and the oxdb for both groupware server addresses. These databases do not exist yet, but will be created during the Open-Xchange Server installation.&lt;br /&gt;
&lt;br /&gt;
Note: The IPs in this example belong to the two different Open-Xchange Servers, please adjust them accordingly.&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.213' IDENTIFIED BY 'secret';&lt;br /&gt;
 mysql&amp;gt; GRANT ALL PRIVILEGES ON *.* TO 'openexchange'@'10.20.30.215' IDENTIFIED BY 'secret';&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:OX_System_Requirements&amp;diff=19321</id>
		<title>AppSuite:OX System Requirements</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:OX_System_Requirements&amp;diff=19321"/>
		<updated>2015-04-10T14:14:10Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Installation-, Hardware-, Software-Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= OX App Suite Requirements - Open-Xchange supported components overview =&lt;br /&gt;
&lt;br /&gt;
The following table provides an overview about the supported components at the OX User Front-End, Connector for Microsoft Outlook and Connector for Business Mobility. This overview makes no claim to be complete.&lt;br /&gt;
&lt;br /&gt;
Open-Xchange Server 6 overview tables about the supported components at the OX User Front-End, Connector for Microsoft Outlook and Connector for Business Mobility are available at [[OX_System_Requirements|OX 6 Requirements - Open-Xchange supported components overview]]&lt;br /&gt;
&lt;br /&gt;
Information about Maintenance expiries of components, versions and browser support, can be found in the [[AppSuite:Versioning_and_Numbering#Maintenance_expires|Maintenance Expires Table]]&lt;br /&gt;
&lt;br /&gt;
== Installation-, Hardware-, Software-Requirements ==&lt;br /&gt;
&lt;br /&gt;
Please note: Installation and administration of the OX App Suite requires basic knowledge of E-Mail systems under Linux, Apache and MySQL as well as experience in the command line administration of Linux systems.&lt;br /&gt;
&lt;br /&gt;
'''OX App Suite:''' &lt;br /&gt;
* Memory 8 GB - 12 GB &amp;lt;br&amp;gt; '''Please Note: If you want to install OX in a VM memory needs to be allocated exclusively to that installation (and not shared with other VM's). This also applies to the database and other related systems or components.'''&lt;br /&gt;
* Disk 500 MB plus User Data&lt;br /&gt;
* Supported Platform Architecture: 64 bit Operation Systems (x84_64)&lt;br /&gt;
* Supported IMAP Server: Cyrus or Courier or Dovecot or UW IMAP (To some extent)&lt;br /&gt;
&lt;br /&gt;
== Desktop Browser (Minimum display resolution: 1024 x 768)==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Browser'''&lt;br /&gt;
  |'''OX App Suite User Front-End'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Microsoft Internet Explorer 10/11&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
 |-&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
 |-&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
 |-&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
 |-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mobile Device Support==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Mobile Device'''&lt;br /&gt;
  |'''Supported Browser'''&lt;br /&gt;
  |'''OX App Suite User Front-End'''&lt;br /&gt;
  |'''Minimum Speed Requirements'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |iPhone on iOS 7 / iOS 8&lt;br /&gt;
  |Safari&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
  |3G connections (512/256kBit/s, 350ms latency)&lt;br /&gt;
 |-&lt;br /&gt;
  |Smartphone on Android 4.1 or later&lt;br /&gt;
  |Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
  |3G connections (512/256kBit/s, 350ms latency)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tablet Support==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Tablet'''&lt;br /&gt;
  |'''Supported Browser'''&lt;br /&gt;
  |'''OX App Suite User Front-End'''&lt;br /&gt;
  |'''Minimum Speed Requirements'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Apple iPad (all devices) on iOS 7 / iOS 8&lt;br /&gt;
  |Safari&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
  |3G connections (512/256kBit/s, 350ms latency)&lt;br /&gt;
 |-&lt;br /&gt;
  |Tablets on Android 4.1 or later&lt;br /&gt;
  |Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |v7.6.1; v7.6.2&lt;br /&gt;
  |3G connections (512/256kBit/s, 350ms latency)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== MS Windows / MS Outlook® / OX Notifier / OX Updater ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Requirement'''&lt;br /&gt;
  |[http://oxpedia.org/wiki/index.php?title=AppSuite:Connector_for_Microsoft_Outlook '''Connector 2 for Microsoft Outlook''']&lt;br /&gt;
  |[http://oxpedia.org/wiki/index.php?title=Open-Xchange_Installation_Guide_for_OX_Notifier '''OX Notifier v1.0.0''']&lt;br /&gt;
  |'''OX Updater'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |OX App Suite&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
 |-&lt;br /&gt;
  |Client PC operating system&lt;br /&gt;
  |Latest versions of Windows 7, latest versions of Windows 8 (no support of Mac OS X clients with emulators and Windows RT)&lt;br /&gt;
  |Latest Versions of Windows 7 (each with 32 + 64 bit) (no support of Mac OS X clients with emulators), latest versions of Windows 8 (no support of start screen tiles)&lt;br /&gt;
  |Latest Versions of Windows 7 (each with 32 + 64 bit) (no support of Mac OS X clients with emulators), latest versions of Windows 8 (no support of start screen tiles)&lt;br /&gt;
 |-&lt;br /&gt;
  |Supported Outlook versions&lt;br /&gt;
  |Latest Versions of Microsoft Outlook 2007, Outlook 2010, Outlook 2013 (no support of &amp;quot;Office 2010 Click-to-Run&amp;quot;, &amp;quot;Office Home and Business 2010 Testversion&amp;quot;)&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Calendar/Contact synchronization Apple Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Requirement'''&lt;br /&gt;
  |Calendar synchronization with CalDAV&lt;br /&gt;
  |Contacts synchronization with CardDAV&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
  |Mac OS X 10.9 (Mavericks)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Mac OS X 10.10 (Yosemite)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Calendar/Contact synchronization Apple iOS ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Requirement'''&lt;br /&gt;
  |Calendar synchronization with CalDAV&lt;br /&gt;
  |Contacts synchronization with CardDAV&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
  |Apple iOS 7&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Apple iOS 8&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mobility Solution - Supported-  Platforms, Features and Devices ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Feature/Technology/Device'''&lt;br /&gt;
  |[http://oxpedia.org/wiki/index.php?title=OXtender_for_Business_Mobility '''OXtender for Business Mobility'''] (availalble for App Suite, OXHE, OXSE)&lt;br /&gt;
  |[http://oxpedia.org/wiki/index.php?title=OX_Mobile_Web_Interface '''Open-Xchange Mobile Web Interface'''] (availalble for AppSuite, OXHE, OXSE)&amp;lt;br&amp;gt;The web interface is optimized for a display size of 320 x 480 pixels. Smaller resolutions may result displaying issues of some UI elements.&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Exchange Active Sync 2.5&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
 |-&lt;br /&gt;
  |Exchange Active Sync 12.1&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Access and creation of emails&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Personal PIM folder&lt;br /&gt;
  |[[File:check.gif]] &lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Public and Shared PIM folder&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Global address book&lt;br /&gt;
  |[[File:check.gif]] &lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Push E-Mail&lt;br /&gt;
  |[[File:check.gif]] &lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Windows Phone 7, Windows Phone 8 (latest &amp;amp; previous minor versions)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
 |-&lt;br /&gt;
  |iPhone iOS 7, iOS 8 (latest &amp;amp; previous minor versions)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
 |-&lt;br /&gt;
  |HTC Devices&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
 |-&lt;br /&gt;
  |Android 2.3 or later&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OX Drive for Clients ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Requirement'''&lt;br /&gt;
  |'''System / Platform'''&lt;br /&gt;
  |'''Tested Devices'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |OX App Suite&lt;br /&gt;
  |OX App Suite v7.6.1; v7.6.2&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Supported Platforms&lt;br /&gt;
  |Debian GNU/Linux 6.0 (Squeeze), Debian GNU/Linux 7.0 (Wheezy), SUSE Linux Enterprise Server 11, RedHat Enterprise Linux 6, CentOS 6&amp;lt;br&amp;gt;Univention Corporate Server (planned for Q4)&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |OX Drive for Windows&lt;br /&gt;
  |Latest Versions of Windows 7, Windows 8 (no support of Mac OS X clients with emulators and Windows RT)&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |OX Drive for Mac OS&lt;br /&gt;
  |Mac OS X 10.9 (Mavericks), Mac OS X 10.10 (Yosemite)&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |OX Drive for iOS&lt;br /&gt;
  |Apple Apple iOS 7, Apple iOS 8&lt;br /&gt;
  |Apple iPhone 5, Apple iPhone 5s&lt;br /&gt;
 |-&lt;br /&gt;
  |OX Drive for Android&lt;br /&gt;
  |Smartphone on Android 4.1 or later with Chrome (latest &amp;amp; previous version), Tablets on Android 4.1 or later with Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |Samsung Galaxy S3 mini, Samsung Galaxy S4, Nexus 4&lt;br /&gt;
 |-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OX Guard ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Requirement'''&lt;br /&gt;
  |'''System / Platform / User Interface'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |OX App Suite&lt;br /&gt;
  |OX App Suite v7.6.1; v7.6.2&lt;br /&gt;
 |-&lt;br /&gt;
  |Desktop Browser (Minimum display resolution: 1024 x 768)&lt;br /&gt;
  |Microsoft Internet Explorer 10/11&amp;lt;br&amp;gt;Mozilla Firefox (latest &amp;amp; previous version)&amp;lt;br&amp;gt;Google Chrome (latest &amp;amp; previous version)&amp;lt;br&amp;gt;Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
 |-&lt;br /&gt;
  |Mobile Device and Tablet Support&lt;br /&gt;
  |Apple iPhone on iOS 7 / iOS 8: Safari (latest version &amp;amp; previous version)&amp;lt;br&amp;gt;Smartphone on Android 4.1 or later: Chrome (latest &amp;amp; previous version)&amp;lt;br&amp;gt;Apple iPad (all devices) on iOS 7 / iOS 8: Safari Safari (latest version &amp;amp; previous version)&amp;lt;br&amp;gt;Tablets on Android 4.1 or later: Chrome (latest &amp;amp; previous version)&lt;br /&gt;
 |-&lt;br /&gt;
  |Server Platforms&lt;br /&gt;
  |Suse Linux Enterprise Server (SLES 11)&amp;lt;br&amp;gt;Red Hat Enterprise Linux 6 (RHEL6)&amp;lt;br&amp;gt;Debian 7&amp;lt;br&amp;gt;CentOS 6&amp;lt;br&amp;gt;Univention Corporate Server&lt;br /&gt;
 |-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== OX Messenger ==&lt;br /&gt;
&lt;br /&gt;
=== Desktop Browser Support (Chat 1-1 &amp;amp; Group) ===&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Chat 1-1 &amp;amp; Group'''&lt;br /&gt;
  |Microsoft IE 10&lt;br /&gt;
  |Microsoft IE 11&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
  |PSTN&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;   &lt;br /&gt;
|-&lt;br /&gt;
  |Microsoft IE 10&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Microsoft IE 11&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]              &lt;br /&gt;
|-&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]] &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Desktop Browser Support (Audio/Video) ===&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Audio 1-1'''&lt;br /&gt;
  |Microsoft IE 10&lt;br /&gt;
  |Microsoft IE 11&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
  |PSTN&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;   &lt;br /&gt;
|-&lt;br /&gt;
  |Microsoft IE 10&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Microsoft IE 11&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]               &lt;br /&gt;
|-&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]](but stream ID's aren't correct (FMS!))&lt;br /&gt;
  |[[File:check.gif]]  &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Video 1-1'''&lt;br /&gt;
  |Microsoft IE 10&lt;br /&gt;
  |Microsoft IE 11&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
  |Microsoft IE 10&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Microsoft IE 11&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Google Chrome (latest &amp;amp; previous version)&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
  |Mozilla Firefox (latest &amp;amp; previous version)&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]           &lt;br /&gt;
|-&lt;br /&gt;
  |Apple Safari (latest version &amp;amp; previous version. Mac OS X only)&lt;br /&gt;
  |[[File:cross.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Additional Requirements ===&lt;br /&gt;
&lt;br /&gt;
* XMPP Server&lt;br /&gt;
* OS: Debian “Wheezy” 7.3&lt;br /&gt;
* JVM: Oracle JVM&lt;br /&gt;
* JBoss AS&lt;br /&gt;
* Mobiscents (JAIN SLEE)&lt;br /&gt;
* DB: MYSQL&lt;br /&gt;
&lt;br /&gt;
== Server Platforms ==&lt;br /&gt;
&lt;br /&gt;
 {|border=&amp;quot;2&amp;quot; rules=&amp;quot;all&amp;quot; align=&amp;quot;left&amp;quot;&amp;gt;&lt;br /&gt;
  |'''Platforms'''&lt;br /&gt;
  |'''OX App Suite'''&lt;br /&gt;
  |'''Supported Java Versions'''&lt;br /&gt;
  |'''Supported MySQL Versions'''&lt;br /&gt;
 |- &lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
  |&amp;amp;nbsp;&lt;br /&gt;
 |-&lt;br /&gt;
  |Suse Linux Enterprise Server (SLES 11)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |IBM Java 7&lt;br /&gt;
  |MySQL 5.5.x (for SP3)&lt;br /&gt;
|-&lt;br /&gt;
  |Red Hat Enterprise Linux 6 (RHEL6)&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |OpenJDK 7&lt;br /&gt;
  |MySQL v5.1.x&lt;br /&gt;
 |-&lt;br /&gt;
  |Debian 6&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |SUN Java 6, OpenJDK 6 or Oracle Java 7&lt;br /&gt;
  |MySQL v5.1.x&lt;br /&gt;
 |-&lt;br /&gt;
  |Debian 7&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |OpenJDK 7 or Oracle Java 7&lt;br /&gt;
  |MySQL v5.5.x&lt;br /&gt;
 |-&lt;br /&gt;
  |CentOS 6&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |OpenJDK 7&lt;br /&gt;
  |MySQL v5.1.x&lt;br /&gt;
 |-&lt;br /&gt;
  |Univention Corporate Server 3.x, 4.x&lt;br /&gt;
  |[[File:check.gif]]&lt;br /&gt;
  |OpenJDK 1.6&lt;br /&gt;
  |MySQL v5.1.x&lt;br /&gt;
 |-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Please Note: To gain higher availability a setup based on Percona XtraDB 5.5 is supported like described in this article: [http://oxpedia.org/wiki/index.php?title=OXLoadBalancingClustering_Database Galera database setup] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: OX7]]&lt;br /&gt;
[[Category: AppSuite]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18315</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18315"/>
		<updated>2014-08-25T15:10:19Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* SpamAssassin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for SpamAssassin to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c contextID -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;br /&gt;
[[Category: AppSuite]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Spamhandling]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Basic Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
1. Make sure that you configure your Firewall to allow ports e.g. '''Port 4190''' for Sieve and '''Port 783''' for SpamAssassin in your Server environment.&lt;br /&gt;
&lt;br /&gt;
2. Check '''/var/log/maillog''' for any issues as well. Also can turn the mail Debug logging for Dovecot e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ vi /etc/dovecot/conf.d/10-logging.conf &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and change the config parameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mail_debug = yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. For SpamAssassin, you can also check the Open-Xchange Server logs to make sure that the settings are loaded correctly.&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18309</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18309"/>
		<updated>2014-08-22T14:31:47Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange. &lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c contextID -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;br /&gt;
[[Category: AppSuite]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Spamhandling]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Basic Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
1. Make sure that you configure your Firewall to allow ports e.g. '''Port 4190''' for Sieve and '''Port 783''' for SpamAssassin in your Server environment.&lt;br /&gt;
&lt;br /&gt;
2. Check '''/var/log/maillog''' for any issues as well. Also can turn the mail Debug logging for Dovecot e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ vi /etc/dovecot/conf.d/10-logging.conf &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and change the config parameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mail_debug = yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. For SpamAssassin, you can also check the Open-Xchange Server logs to make sure that the settings are loaded correctly.&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18308</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18308"/>
		<updated>2014-08-22T14:31:26Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange. &lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c contextID -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;br /&gt;
[[Category: AppSuite]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Spamhandling]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
1. Make sure that you configure your Firewall to allow ports e.g. '''Port 4190''' for Sieve and '''Port 783''' for SpamAssassin in your Server environment.&lt;br /&gt;
&lt;br /&gt;
2. Check '''/var/log/maillog''' for any issues as well. Also can turn the mail Debug logging for Dovecot e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ vi /etc/dovecot/conf.d/10-logging.conf &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and change the config parameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mail_debug = yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. For SpamAssassin, you can also check the Open-Xchange Server logs to make sure that the settings are loaded correctly.&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18307</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18307"/>
		<updated>2014-08-22T14:30:32Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange. &lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c contextID -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;br /&gt;
[[Category: AppSuite]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Spamhandling]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
1. Make sure that you configure your Firewall to allow ports e.g. Port 4190 for Sieve and Port 783 for SpamAssassin in your Server environment.&lt;br /&gt;
&lt;br /&gt;
2. Check /var/log/maillog for any issues as well. Also can turn the mail Debug logging for Dovecot e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ vi /etc/dovecot/conf.d/10-logging.conf &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and change the config parameter&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mail_debug = yes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. For SpamAssassin, you can also check the Open-Xchange Server logs to make sure that the settings are loaded correctly.&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18306</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18306"/>
		<updated>2014-08-22T14:22:52Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* For SpamAssassin */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange. &lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c contextID -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;br /&gt;
[[Category: AppSuite]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Spamhandling]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18304</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18304"/>
		<updated>2014-08-21T13:42:43Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange. &lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c 1 -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;br /&gt;
[[Category: AppSuite]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Spamhandling]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18303</id>
		<title>Spamassassin</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=Spamassassin&amp;diff=18303"/>
		<updated>2014-08-21T13:15:11Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: Created page with &amp;quot;= Introduction =  This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange. It allows accessing your SpamAssa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This OXpedia article describes, how to connect the [http://spamassassin.apache.org/ SpamAssassin] system with Open-Xchange.&lt;br /&gt;
It allows accessing your SpamAssassin settings from within Open-Xchange and use the spam- and ham&lt;br /&gt;
Learning mechanisms of SpamAssassin directly from within the Open-Xchange UI.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
== Sieve ==&lt;br /&gt;
&lt;br /&gt;
You will need to install and configure the [http://sieve.info/ SIEVE] Mail filter program on your mail server. Since we will '''not''' cover the installation part of Sieve in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange.&lt;br /&gt;
&lt;br /&gt;
== SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
You will also need to install and configure the [http://spamassassin.apache.org/ SpamAssassin]. Since we will '''not''' cover the installation part of SpamAssassin in this article, therefore we will only tell the important configuration settings needed for Sieve to get integrated with Open-Xchange. &lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
We will need to install the following two packages on the Open-Xchange server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|sopath=6.22/backend|version=v6.22.x}}&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-spamhandler-spamassassin open-xchange-mailfilter|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== For Sieve ==&lt;br /&gt;
&lt;br /&gt;
As we have now already installed the needed package '''open-xchange-mailfilter'''. Now we need to configure the setting the configuration file so that Open-Xchange can be integrated with Sieve.&lt;br /&gt;
&lt;br /&gt;
Open the following file in your Linux editor.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/mailfilter.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following lines&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SIEVE_SERVER=localhost //your sieve server name, localhost is default for single machine&lt;br /&gt;
 &lt;br /&gt;
SIEVE_PORT=4190 //this port should be same as the one you define during the installation of Sieve.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes and reboot Open-Xchange service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Verify that the mailfilter bundle has started properly and should be ACTIVE.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ listbundles | grep filter &lt;br /&gt;
&lt;br /&gt;
bundlename: com.openexchange.mail.filter status: ACTIVE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For SpamAssassin ==&lt;br /&gt;
&lt;br /&gt;
Open the following file in Linux editor&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/etc/imap.properties&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the following parameter to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
com.openexchange.imap.spamHandler=SpamAssassin &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done then reboot the OX Service&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /etc/init.d/open-xchange restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure that SpamAssassin port is also open Port 783 (by default). Also verify that spam bundles loaded successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /opt/open-xchange/sbin/listbundles | grep spam &lt;br /&gt;
bundlename: com.openexchange.spamhandler.spamassassin status: ACTIVE &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, we will need to enable the GUI Capabilities for SPAM. To do this we have to run the following command for e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ changeuser -A oxadmin -P admin_password -c 1 -u username --gui_spam_filter_capabilities_enabled true &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Debugging_the_UI&amp;diff=18225</id>
		<title>AppSuite:Debugging the UI</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Debugging_the_UI&amp;diff=18225"/>
		<updated>2014-08-01T14:50:34Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Finding the version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;title&amp;quot;&amp;gt;Debugging the UI&amp;lt;/div&amp;gt;&lt;br /&gt;
'''Synopsis:''' A collection of hints to debug during UI development. See also [[AppSuite:UI FAQ]]. Sister page: [[AppSuite:Debugging_the_server|Debugging the server]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== What capabilities are available? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
_(ox.serverConfig.capabilities).pluck(&amp;quot;id&amp;quot;).sort();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Is a specific capability set? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
require(['io.ox/core/capabilities'], function (cap) {&lt;br /&gt;
    console.log(cap.has('certain_cap'));&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Which files failed to load? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
requirejs.s.contexts._.registry&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What portal widgets are available? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
require(['io.ox/portal/widgets'], function (widgets) {&lt;br /&gt;
  console.log(widgets.getAvailablePlugins().sort());&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Check settings ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
// check core settings&lt;br /&gt;
require('settings!io.ox/core').get();&lt;br /&gt;
// check mail settings&lt;br /&gt;
require('settings!io.ox/mail').get();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clear all persistent caches ==&lt;br /&gt;
Please mind that this does not clear the regular browser cache! It clears localStorage, IndexedDB, and WebSQL.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
ox.cache.clear();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clear all portal widgets ==&lt;br /&gt;
Sometimes you manage to build a portal widgets that messes up all kinds of things when a user adds it. This is a rather blunt way of solving the problem:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
require(['settings!io.ox/portal'], function(settings) {&lt;br /&gt;
 settings.set('widgets/user', '').save();&lt;br /&gt;
}); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debug relogin ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
ox.autoLogoutRestartDebug();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enable/disable capability via URL hash ==&lt;br /&gt;
Just add the parameter &amp;quot;cap&amp;quot; to URL hash. A leading minus disables a capability. Multiple capabilities separated by comma. Example:&lt;br /&gt;
&amp;lt;pre language=&amp;quot;none&amp;quot;&amp;gt; &lt;br /&gt;
...&amp;amp;cap=emoji,-calendar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes do not apply while developing ==&lt;br /&gt;
You did changes in your code and they don't simply don't apply?&lt;br /&gt;
There are several possibilites, you should check in order to find a solution.&lt;br /&gt;
&lt;br /&gt;
* Reload AppSuite with cleared Browser Cache. Using Firefox on Linux-Distributions you can simply press &amp;lt;tt&amp;gt;Ctrl+F5&amp;lt;/tt&amp;gt;. Please check the documentation of your Browser for Shortcuts and how to clear the cache.&lt;br /&gt;
* Disable Source Caching. Therefor add the parameter &amp;lt;tt&amp;gt;&amp;quot;debug-js=true&amp;quot;&amp;lt;/tt&amp;gt; to URL hash. Example:&lt;br /&gt;
&amp;lt;pre language=&amp;quot;none&amp;quot;&amp;gt;...&amp;amp;debug-js=true&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debug a specific folder ==&lt;br /&gt;
If you want to get details of a specific folder, just inspect it via dev tools and look for data-obj-id=&amp;quot;...&amp;quot;. Copy the id and run the following in console:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
void require('io.ox/core/api/folder').get({ folder: 'default0/INBOX' }).always(_.inspect);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the version ==&lt;br /&gt;
If you want to know the backend and frontend versions with revision numbers, specifically when you simply cannot find it from the WebUI's About button as some customer hides it, then you can use the following command:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
&amp;quot;Server version: &amp;quot; + ox.serverConfig.serverVersion + &amp;quot;, UI version: &amp;quot; + ox.version&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:AppSuite]]&lt;br /&gt;
[[Category:UI]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Debugging_the_UI&amp;diff=18204</id>
		<title>AppSuite:Debugging the UI</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Debugging_the_UI&amp;diff=18204"/>
		<updated>2014-07-31T09:38:35Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;title&amp;quot;&amp;gt;Debugging the UI&amp;lt;/div&amp;gt;&lt;br /&gt;
'''Synopsis:''' A collection of hints to debug during UI development. See also [[AppSuite:UI FAQ]]. Sister page: [[AppSuite:Debugging_the_server|Debugging the server]].&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== What capabilities are available? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
_(ox.serverConfig.capabilities).pluck(&amp;quot;id&amp;quot;).sort();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Is a specific capability set? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
require(['io.ox/core/capabilities'], function (cap) {&lt;br /&gt;
    console.log(cap.has('certain_cap'));&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Which files failed to load? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
requirejs.s.contexts._.registry&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What portal widgets are available? ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt;&lt;br /&gt;
require(['io.ox/portal/widgets'], function (widgets) {&lt;br /&gt;
  console.log(widgets.getAvailablePlugins().sort());&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Check settings ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
// check core settings&lt;br /&gt;
require('settings!io.ox/core').get();&lt;br /&gt;
// check mail settings&lt;br /&gt;
require('settings!io.ox/mail').get();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clear all persistent caches ==&lt;br /&gt;
Please mind that this does not clear the regular browser cache! It clears localStorage, IndexedDB, and WebSQL.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
ox.cache.clear();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Clear all portal widgets ==&lt;br /&gt;
Sometimes you manage to build a portal widgets that messes up all kinds of things when a user adds it. This is a rather blunt way of solving the problem:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
require(['settings!io.ox/portal'], function(settings) {&lt;br /&gt;
 settings.set('widgets/user', '').save();&lt;br /&gt;
}); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debug relogin ==&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
ox.autoLogoutRestartDebug();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enable/disable capability via URL hash ==&lt;br /&gt;
Just add the parameter &amp;quot;cap&amp;quot; to URL hash. A leading minus disables a capability. Multiple capabilities separated by comma. Example:&lt;br /&gt;
&amp;lt;pre language=&amp;quot;none&amp;quot;&amp;gt; &lt;br /&gt;
...&amp;amp;cap=emoji,-calendar&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Changes do not apply while developing ==&lt;br /&gt;
You did changes in your code and they don't simply don't apply?&lt;br /&gt;
There are several possibilites, you should check in order to find a solution.&lt;br /&gt;
&lt;br /&gt;
* Reload AppSuite with cleared Browser Cache. Using Firefox on Linux-Distributions you can simply press &amp;lt;tt&amp;gt;Ctrl+F5&amp;lt;/tt&amp;gt;. Please check the documentation of your Browser for Shortcuts and how to clear the cache.&lt;br /&gt;
* Disable Source Caching. Therefor add the parameter &amp;lt;tt&amp;gt;&amp;quot;debug-js=true&amp;quot;&amp;lt;/tt&amp;gt; to URL hash. Example:&lt;br /&gt;
&amp;lt;pre language=&amp;quot;none&amp;quot;&amp;gt;...&amp;amp;debug-js=true&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Debug a specific folder ==&lt;br /&gt;
If you want to get details of a specific folder, just inspect it via dev tools and look for data-obj-id=&amp;quot;...&amp;quot;. Copy the id and run the following in console:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
void require('io.ox/core/api/folder').get({ folder: 'default0/INBOX' }).always(_.inspect);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Finding the version ==&lt;br /&gt;
If you want to the backend and the frontend version with revision numbers, specifically when you simply cannot find it from the WebUI's About button as some customer hides it, then you can use the following command:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;language-javascript&amp;quot;&amp;gt; &lt;br /&gt;
&amp;quot;Server version: &amp;quot; + ox.serverConfig.serverVersion + &amp;quot;, UI version: &amp;quot; + ox.version&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:AppSuite]]&lt;br /&gt;
[[Category:UI]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=ChangePasswordExternal&amp;diff=17481</id>
		<title>ChangePasswordExternal</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=ChangePasswordExternal&amp;diff=17481"/>
		<updated>2014-04-29T07:32:45Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The package &amp;lt;tt&amp;gt;open-xchange-passwordchange-script&amp;lt;/tt&amp;gt; allows you to run a command to change a password in an external subsystem like e.g. LDAP.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-passwordchange-script|sopath=stable}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;/opt/open-xchange/etc/change_pwd_script.properties&amp;lt;/tt&amp;gt; add this line:&lt;br /&gt;
&lt;br /&gt;
 com.openexchange.passwordchange.script.shellscript=/bin/pwchange.pl&lt;br /&gt;
&lt;br /&gt;
=== Example Script 1 ===&lt;br /&gt;
&lt;br /&gt;
This example script calls &amp;lt;tt&amp;gt;saslpasswd&amp;lt;/tt&amp;gt; to change the password in the sasldb:&lt;br /&gt;
&lt;br /&gt;
 #! /usr/bin/perl -w -T&lt;br /&gt;
 #&lt;br /&gt;
 # perlsec(1) for security related perl programming&lt;br /&gt;
 #&lt;br /&gt;
 use Getopt::Long;&lt;br /&gt;
 use strict;&lt;br /&gt;
 &lt;br /&gt;
 my $user;&lt;br /&gt;
 my $pw;&lt;br /&gt;
 my $result;&lt;br /&gt;
 my $cid;&lt;br /&gt;
 my $oldpassword;&lt;br /&gt;
 my $userid;&lt;br /&gt;
 &lt;br /&gt;
 open(LOG, '&amp;gt;&amp;gt;/var/log/pw.log'); &lt;br /&gt;
 &lt;br /&gt;
 sub log_error {&lt;br /&gt;
        my $errorstring=$_[0];&lt;br /&gt;
        print LOG &amp;quot;Error: $errorstring\n&amp;quot;;&lt;br /&gt;
        die &amp;quot;$errorstring&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
 # secure env&lt;br /&gt;
 $ENV{'PATH'} = &amp;quot;&amp;quot;;&lt;br /&gt;
 $ENV{'ENV'} = &amp;quot;&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 $result = GetOptions (&amp;quot;username=s&amp;quot; =&amp;gt; \$user,&lt;br /&gt;
                      &amp;quot;cid&amp;quot; =&amp;gt; \$cid,&lt;br /&gt;
                      &amp;quot;userid&amp;quot; =&amp;gt; \$userid,&lt;br /&gt;
                      &amp;quot;oldpassword&amp;quot; =&amp;gt; \$oldpassword,&lt;br /&gt;
                      &amp;quot;newpassword=s&amp;quot; =&amp;gt; \$pw);&lt;br /&gt;
 &lt;br /&gt;
 $user || &amp;amp;log_error(&amp;quot;missing parameter username&amp;quot;);&lt;br /&gt;
 print LOG &amp;quot;changing password for user $user\n&amp;quot;;&lt;br /&gt;
 $pw || &amp;amp;log_error(&amp;quot;missing parameter newpassword&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
 my $usersav = $user;&lt;br /&gt;
 &lt;br /&gt;
 # add a taint check&lt;br /&gt;
 if ($user =~ /^([-\@\w.]+)$/) {&lt;br /&gt;
  $user = $1;                     # $data now untainted&lt;br /&gt;
 } else {&lt;br /&gt;
  &amp;amp;log_error(&amp;quot;Bad data in '$user'&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 die &amp;quot;Can't fork: $!&amp;quot; unless defined(my $pid = open(KID, &amp;quot;|-&amp;quot;));&lt;br /&gt;
 if ($pid) {           # parent&lt;br /&gt;
  print KID $pw;&lt;br /&gt;
  close KID;&lt;br /&gt;
 } else {&lt;br /&gt;
  exec '/usr/bin/sudo', '/usr/sbin/saslpasswd2', '-p', &amp;quot;$user&amp;quot;&lt;br /&gt;
    or &amp;amp;log_error(&amp;quot;can't exec myprog: $!&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 close(LOG);&lt;br /&gt;
&lt;br /&gt;
=== Example Script 2 ===&lt;br /&gt;
&lt;br /&gt;
The following script uses ldappasswd to change the password in an LDAP server.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 ldappasswd -h my_ldap_server -D &amp;quot;uid=$4,ou=people,dc=example,dc=com&amp;quot; -w $8 \&lt;br /&gt;
    -s ${10} &amp;quot;uid=$4,ou=people,dc=example,dc=com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Example Script 3 ===&lt;br /&gt;
&lt;br /&gt;
The following script uses open-xchange-passwordchange-script data to change the password within LDAP&lt;br /&gt;
&lt;br /&gt;
 #!/usr/bin/perl -w     &lt;br /&gt;
 # Begin LDAP Stuff&lt;br /&gt;
        use Net::LDAP;&lt;br /&gt;
        use Net::LDAP::Extension::SetPassword;&lt;br /&gt;
 my $cid = $ARGV[1];&lt;br /&gt;
 my $userid = $ARGV[5];&lt;br /&gt;
 my $oldpw = $ARGV[7];&lt;br /&gt;
 my $hostname= 'localhost';&lt;br /&gt;
 my $rootdn= 'cn=Administrator,dc=example,dc=com';&lt;br /&gt;
 my $userbind= 'ou=People,dc=example,dc=com';&lt;br /&gt;
 my $adminpasswd='system';&lt;br /&gt;
 my $name= $ARGV[3];&lt;br /&gt;
 my $newpasswd= $ARGV[9];&lt;br /&gt;
 my $ldap = Net::LDAP-&amp;gt;new(&amp;quot;$hostname&amp;quot;)&lt;br /&gt;
 or die &amp;quot;Host not found: $!&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 open(LOG, '&amp;gt;&amp;gt;/var/log/open-xchange/pw.log');  &lt;br /&gt;
  &lt;br /&gt;
 sub log_error {&lt;br /&gt;
       my $errorstring=$_[0];&lt;br /&gt;
       print LOG &amp;quot;Error: $errorstring\n&amp;quot;;&lt;br /&gt;
       die &amp;quot;$errorstring&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
  &lt;br /&gt;
 $name || &amp;amp;log_error(&amp;quot;missing parameter username&amp;quot;);&lt;br /&gt;
 print LOG &amp;quot;changing password for $ARGV[2]: $name with $ARGV[0]: $cid and $ARGV[4]: $userid\n&amp;quot;;&lt;br /&gt;
 $newpasswd || &amp;amp;log_error(&amp;quot;missing parameter newpassword&amp;quot;);&lt;br /&gt;
  &lt;br /&gt;
  $ldap-&amp;gt;bind( &amp;quot;$rootdn&amp;quot;, password =&amp;gt; &amp;quot;$adminpasswd&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 my $mesg = $ldap-&amp;gt;set_password(&lt;br /&gt;
    newpasswd =&amp;gt; &amp;quot;$newpasswd&amp;quot;,&lt;br /&gt;
    user      =&amp;gt; &amp;quot;uid=$name,$userbind&amp;quot;&lt;br /&gt;
    );&lt;br /&gt;
  &lt;br /&gt;
   die &amp;quot;error: &amp;quot;, $mesg-&amp;gt;code(), &amp;quot;: &amp;quot;, $mesg-&amp;gt;error() if ( $mesg-&amp;gt;code() );&lt;br /&gt;
   close(LOG);&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17252</id>
		<title>AppSuite:Connector for Business Mobility Installation Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17252"/>
		<updated>2014-03-12T08:52:04Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Connector for Business Mobility =&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
With the Connector for Business Mobility, Open-Xchange also introduces the Universal Synchronization Module (USM). This module provides a framework for synchronization protocols such as Microsoft Exchange ActiveSync (EAS) or other services building on this foundation. USM acts as a layer between the Open-Xchange HTTP API and the synchronization protocol. It handles synchronization specific tasks like conflict management.&lt;br /&gt;
The synchronization stack (USM) and protocol implementation (EAS) are shipped as OSGi bundles and run as a plug-in of an Open-Xchange instance.&lt;br /&gt;
&lt;br /&gt;
=== Component Overview ===&lt;br /&gt;
USM, EAS and OX work together as components. This is a general outline about how these components interact.&lt;br /&gt;
&lt;br /&gt;
When the device initiates a synchronization through ActiveSync, it contacts the webserver using the URL /Microsoft-Server-ActiveSync via HTTP/s. This URL is forwarded to the Open-Xchange application server where the corresponding servlet is offered by the EAS component. The EAS component then uses USM to initiate a connection to the OX HTTP API and exchanges groupware data. In all cases, USM works as an client to the Open-Xchange HTTP API. It also uses some database tables which are accessed through the Open-Xchange SQL interface to store metadata like synchronization status. The same component stack is used to transport groupware data back to the device.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
Since the Connector for Business Mobility is a server plug-in based on the OSGi Framework it can be added to an existing Open-Xchange installation very easily. '''OX App Suite v7.0 or later is required to operate this extension.''' The Connector for Business Mobility uses the resources and services offered by the Open-Xchange server, no additional software or configuration is required.&lt;br /&gt;
&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_Debian_6.0 | Debian 6.0 (Squeeze)]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_SLES11 | SLES11]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_RHEL6 | RHEL6]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_CentOS_6 | CentOS 6]]&lt;br /&gt;
&lt;br /&gt;
'''Please Note:''' To get in favor of the latest minor features and bugfixes, you need to have a valid license.  The article [[AppSuite:UpdatingOXPackages | Updating OX-Packages]] explains how that can be done.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Redhat Enterprise Linux 6 or CentOS 6 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange yum configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=YUMRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=rhelname|pc2v=RHEL6|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ yum install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== Debian GNU/Linux 6.0 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange apt configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=APTRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=debianname|pc2v=DebianSqueeze|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ apt-get update&lt;br /&gt;
 $ apt-get install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=SUSERepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=susename|pc2v=SLES11|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ zypper ref&lt;br /&gt;
 $ zypper install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the Open-Xchange service needs to be restarted:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/open-xchange restart&lt;br /&gt;
&lt;br /&gt;
On the first login after the restart, all required database tables will be created.&lt;br /&gt;
&lt;br /&gt;
== Download and Installation OX Server Edition / App Suite for UCS ==&lt;br /&gt;
&lt;br /&gt;
If you have purchased the OX Server Edition / App Suite for UCS, the Connector is part of the offering. Installation of the Connector with the following steps:&lt;br /&gt;
&lt;br /&gt;
* The new license is already registered at the LDB after purchase&lt;br /&gt;
* Click on &amp;quot;Online Updates&amp;quot; at the Univention Management Console &lt;br /&gt;
* The Connector for Business Mobility is available at the &amp;quot;Open-Xchange Components&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Mail Push ===&lt;br /&gt;
&lt;br /&gt;
In order to get mail push, either install and configure the package open-xchange-push-malpoll, which is not recommended on large deployments or if you're using cyrus-imap, read the [[MailNotify Bundle‎‎]] instructions on how to set up real mail push with cyrus.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange configuration ===&lt;br /&gt;
The configuration for USM and the EAS protocol can be found in these two configuration files:&lt;br /&gt;
 /opt/open-xchange/etc/usm.properties&lt;br /&gt;
 /opt/open-xchange/etc/eas.properties&lt;br /&gt;
&lt;br /&gt;
Make sure that the Open-Xchange Server URL is set properly in usm.properties. This needs to be the machine which provides the web interface. Usually, this is localhost, as the webserver and Open-Xchange run on the same machine.&lt;br /&gt;
 com.openexchange.usm.ox.url=http://localhost/ajax/&lt;br /&gt;
&lt;br /&gt;
in case webserver and Open-Xchange aren't running on the same machine:&lt;br /&gt;
 com.openexchange.usm.ox.url=http://$FQDN/ajax/&lt;br /&gt;
(Where $FQDN is the fully qualified domain name of your frontend system)&lt;br /&gt;
&lt;br /&gt;
On clustered setups, adjust the file&lt;br /&gt;
/opt/open-xchange/etc/groupware/noipcheck.cnf&lt;br /&gt;
to include the range of IP addresses of the servers on which USM is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Documentation about the configuration parameters can be found inside the configuration files. If you change any attribute at the configuration files, the Open-Xchange groupware service needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
=== Apache Configuration ===&lt;br /&gt;
Mobile devices supporting ActiveSync use a special URL to communicate with an ActiveSync enabled Open-Xchange Server. This URL needs to be forwarded to the Open-Xchange ActiveSync servlet. The required configuration options are already part of the default Open-Xchange installation instructions.&lt;br /&gt;
&lt;br /&gt;
The example assumes that Open-Xchange Server is running on the same machine like the webserver. Please refer the Open-Xchange administration documentation for more information about Apache configuration. Please restart apache after performing the configuration change.&lt;br /&gt;
 /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
=== Enabling ActiveSync for user accounts ===&lt;br /&gt;
In order to use synchronization through ActiveSync, this feature needs to be activated for user accounts. You can either activate it for specific users or a whole context.&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for specific users:&lt;br /&gt;
 /opt/open-xchange/sbin/changeuser -c 1 -A oxadmin -P admin_password -u testuser --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for a whole context:&lt;br /&gt;
 /opt/open-xchange/sbin/changecontext -c 1 -A oxadminmaster -P admin_master_password --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
== Log files and issue tracking ==&lt;br /&gt;
When facing problems with synchronization, there are several ways to get more information than provided via device or platform specific error codes.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange Server logfile ===&lt;br /&gt;
By default, the log output is non verbose. Only severe errors will be logged. To enable a more detailed log output, the logging mechanism needs to be configured. This depends on the used mechanism.&lt;br /&gt;
&lt;br /&gt;
=== Commons Logging ===&lt;br /&gt;
This is the default logging mechanism. If the Open-Xchange Server log output is written to ''var/log/open-xchange/open-xchange.log'' it's an indicator that this mechanism is in use. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/file-logging.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.level=FINE&lt;br /&gt;
&lt;br /&gt;
This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Log4j ===&lt;br /&gt;
If the package ''open-xchange-log4j'' is installed, Open-Xchange Server will log via a UDP network socket. In most cases a syslog daemon is listening to this socket and will write the log data to a platform specif file like ''/var/log/syslog''. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/log4j.xml&lt;br /&gt;
 [...]&lt;br /&gt;
    &amp;lt;category name=&amp;quot;com.openexchange.usm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;level value=&amp;quot;DEBUG&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;appender-ref ref=&amp;quot;SERVER_LOG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the XML syntax must be correct. This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== EAS debug logfile ===&lt;br /&gt;
While the generic Open-Xchange Server log file will keep track on errors reported by the software components, the EAS debug log file will print all data transfered to the device as XML. Please note: this log file may contain confidential data about the users personal groupware objects. Make sure that no unauthorized access to those log files is possible in order to maintain privacy. Change the configuration file accordingly and set a output path which can only accessed by authorized persons.&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/eas.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.eas.debug_log=/tmp/EAS-debug.log&lt;br /&gt;
&lt;br /&gt;
This will enable a XML based debug log for all EAS connections, after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Network traffic ===&lt;br /&gt;
When using unencrypted connections between the device and USM and USM and Open-Xchange Server (not recommended), it's possible to analyze the network traffic with tools like ngrep or wireshark. When using encrypted data connections using SSL, the transfered data can be decrypted using the corresponding private key. Please note that there are two network streams, one from the device to USM (external) and one from USM to OX (internal).&lt;br /&gt;
&lt;br /&gt;
== Bug-Reporting == &lt;br /&gt;
Please report bugs via the Open-Xchange Bugzilla:&lt;br /&gt;
&lt;br /&gt;
[https://bugs.open-xchange.com/ Direct link to Open-Xchange Bugzilla]&lt;br /&gt;
&lt;br /&gt;
* Product: Connector for Business Mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Client configuration =&lt;br /&gt;
&lt;br /&gt;
Information about the client configuration for the different devices is available at the [http://software.open-xchange.com/products/appsuite/doc/mobilityconnector/ User Guides].&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
* The Exchange Active Sync protocol does not support the synchronization of client email drafts-folder to the server. Synchronization from server drafts-folder to the client will work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AppSuite]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17251</id>
		<title>AppSuite:Connector for Business Mobility Installation Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17251"/>
		<updated>2014-03-12T08:46:19Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Commons Logging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Connector for Business Mobility =&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
With the Connector for Business Mobility, Open-Xchange also introduces the Universal Synchronization Module (USM). This module provides a framework for synchronization protocols such as Microsoft Exchange ActiveSync (EAS) or other services building on this foundation. USM acts as a layer between the Open-Xchange HTTP API and the synchronization protocol. It handles synchronization specific tasks like conflict management.&lt;br /&gt;
The synchronization stack (USM) and protocol implementation (EAS) are shipped as OSGi bundles and run as a plug-in of an Open-Xchange instance.&lt;br /&gt;
&lt;br /&gt;
=== Component Overview ===&lt;br /&gt;
USM, EAS and OX work together as components. This is a general outline about how these components interact.&lt;br /&gt;
&lt;br /&gt;
When the device initiates a synchronization through ActiveSync, it contacts the webserver using the URL /Microsoft-Server-ActiveSync via HTTP/s. This URL is forwarded to the Open-Xchange application server where the corresponding servlet is offered by the EAS component. The EAS component then uses USM to initiate a connection to the OX HTTP API and exchanges groupware data. In all cases, USM works as an client to the Open-Xchange HTTP API. It also uses some database tables which are accessed through the Open-Xchange SQL interface to store metadata like synchronization status. The same component stack is used to transport groupware data back to the device.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
Since the Connector for Business Mobility is a server plug-in based on the OSGi Framework it can be added to an existing Open-Xchange installation very easily. '''OX App Suite v7.0 or later is required to operate this extension.''' The Connector for Business Mobility uses the resources and services offered by the Open-Xchange server, no additional software or configuration is required.&lt;br /&gt;
&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_Debian_6.0 | Debian 6.0 (Squeeze)]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_SLES11 | SLES11]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_RHEL6 | RHEL6]]&lt;br /&gt;
&lt;br /&gt;
'''Please Note:''' To get in favor of the latest minor features and bugfixes, you need to have a valid license.  The article [[AppSuite:UpdatingOXPackages | Updating OX-Packages]] explains how that can be done.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Redhat Enterprise Linux 6 or CentOS 6 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange yum configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=YUMRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=rhelname|pc2v=RHEL6|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ yum install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== Debian GNU/Linux 6.0 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange apt configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=APTRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=debianname|pc2v=DebianSqueeze|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ apt-get update&lt;br /&gt;
 $ apt-get install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=SUSERepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=susename|pc2v=SLES11|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ zypper ref&lt;br /&gt;
 $ zypper install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the Open-Xchange service needs to be restarted:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/open-xchange restart&lt;br /&gt;
&lt;br /&gt;
On the first login after the restart, all required database tables will be created.&lt;br /&gt;
&lt;br /&gt;
== Download and Installation OX Server Edition / App Suite for UCS ==&lt;br /&gt;
&lt;br /&gt;
If you have purchased the OX Server Edition / App Suite for UCS, the Connector is part of the offering. Installation of the Connector with the following steps:&lt;br /&gt;
&lt;br /&gt;
* The new license is already registered at the LDB after purchase&lt;br /&gt;
* Click on &amp;quot;Online Updates&amp;quot; at the Univention Management Console &lt;br /&gt;
* The Connector for Business Mobility is available at the &amp;quot;Open-Xchange Components&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Mail Push ===&lt;br /&gt;
&lt;br /&gt;
In order to get mail push, either install and configure the package open-xchange-push-malpoll, which is not recommended on large deployments or if you're using cyrus-imap, read the [[MailNotify Bundle‎‎]] instructions on how to set up real mail push with cyrus.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange configuration ===&lt;br /&gt;
The configuration for USM and the EAS protocol can be found in these two configuration files:&lt;br /&gt;
 /opt/open-xchange/etc/usm.properties&lt;br /&gt;
 /opt/open-xchange/etc/eas.properties&lt;br /&gt;
&lt;br /&gt;
Make sure that the Open-Xchange Server URL is set properly in usm.properties. This needs to be the machine which provides the web interface. Usually, this is localhost, as the webserver and Open-Xchange run on the same machine.&lt;br /&gt;
 com.openexchange.usm.ox.url=http://localhost/ajax/&lt;br /&gt;
&lt;br /&gt;
in case webserver and Open-Xchange aren't running on the same machine:&lt;br /&gt;
 com.openexchange.usm.ox.url=http://$FQDN/ajax/&lt;br /&gt;
(Where $FQDN is the fully qualified domain name of your frontend system)&lt;br /&gt;
&lt;br /&gt;
On clustered setups, adjust the file&lt;br /&gt;
/opt/open-xchange/etc/groupware/noipcheck.cnf&lt;br /&gt;
to include the range of IP addresses of the servers on which USM is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Documentation about the configuration parameters can be found inside the configuration files. If you change any attribute at the configuration files, the Open-Xchange groupware service needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
=== Apache Configuration ===&lt;br /&gt;
Mobile devices supporting ActiveSync use a special URL to communicate with an ActiveSync enabled Open-Xchange Server. This URL needs to be forwarded to the Open-Xchange ActiveSync servlet. The required configuration options are already part of the default Open-Xchange installation instructions.&lt;br /&gt;
&lt;br /&gt;
The example assumes that Open-Xchange Server is running on the same machine like the webserver. Please refer the Open-Xchange administration documentation for more information about Apache configuration. Please restart apache after performing the configuration change.&lt;br /&gt;
 /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
=== Enabling ActiveSync for user accounts ===&lt;br /&gt;
In order to use synchronization through ActiveSync, this feature needs to be activated for user accounts. You can either activate it for specific users or a whole context.&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for specific users:&lt;br /&gt;
 /opt/open-xchange/sbin/changeuser -c 1 -A oxadmin -P admin_password -u testuser --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for a whole context:&lt;br /&gt;
 /opt/open-xchange/sbin/changecontext -c 1 -A oxadminmaster -P admin_master_password --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
== Log files and issue tracking ==&lt;br /&gt;
When facing problems with synchronization, there are several ways to get more information than provided via device or platform specific error codes.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange Server logfile ===&lt;br /&gt;
By default, the log output is non verbose. Only severe errors will be logged. To enable a more detailed log output, the logging mechanism needs to be configured. This depends on the used mechanism.&lt;br /&gt;
&lt;br /&gt;
=== Commons Logging ===&lt;br /&gt;
This is the default logging mechanism. If the Open-Xchange Server log output is written to ''var/log/open-xchange/open-xchange.log'' it's an indicator that this mechanism is in use. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/file-logging.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.level=FINE&lt;br /&gt;
&lt;br /&gt;
This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Log4j ===&lt;br /&gt;
If the package ''open-xchange-log4j'' is installed, Open-Xchange Server will log via a UDP network socket. In most cases a syslog daemon is listening to this socket and will write the log data to a platform specif file like ''/var/log/syslog''. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/log4j.xml&lt;br /&gt;
 [...]&lt;br /&gt;
    &amp;lt;category name=&amp;quot;com.openexchange.usm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;level value=&amp;quot;DEBUG&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;appender-ref ref=&amp;quot;SERVER_LOG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the XML syntax must be correct. This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== EAS debug logfile ===&lt;br /&gt;
While the generic Open-Xchange Server log file will keep track on errors reported by the software components, the EAS debug log file will print all data transfered to the device as XML. Please note: this log file may contain confidential data about the users personal groupware objects. Make sure that no unauthorized access to those log files is possible in order to maintain privacy. Change the configuration file accordingly and set a output path which can only accessed by authorized persons.&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/eas.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.eas.debug_log=/tmp/EAS-debug.log&lt;br /&gt;
&lt;br /&gt;
This will enable a XML based debug log for all EAS connections, after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Network traffic ===&lt;br /&gt;
When using unencrypted connections between the device and USM and USM and Open-Xchange Server (not recommended), it's possible to analyze the network traffic with tools like ngrep or wireshark. When using encrypted data connections using SSL, the transfered data can be decrypted using the corresponding private key. Please note that there are two network streams, one from the device to USM (external) and one from USM to OX (internal).&lt;br /&gt;
&lt;br /&gt;
== Bug-Reporting == &lt;br /&gt;
Please report bugs via the Open-Xchange Bugzilla:&lt;br /&gt;
&lt;br /&gt;
[https://bugs.open-xchange.com/ Direct link to Open-Xchange Bugzilla]&lt;br /&gt;
&lt;br /&gt;
* Product: Connector for Business Mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Client configuration =&lt;br /&gt;
&lt;br /&gt;
Information about the client configuration for the different devices is available at the [http://software.open-xchange.com/products/appsuite/doc/mobilityconnector/ User Guides].&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
* The Exchange Active Sync protocol does not support the synchronization of client email drafts-folder to the server. Synchronization from server drafts-folder to the client will work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AppSuite]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17250</id>
		<title>AppSuite:Connector for Business Mobility Installation Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17250"/>
		<updated>2014-03-12T08:46:07Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* Log4j */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Connector for Business Mobility =&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
With the Connector for Business Mobility, Open-Xchange also introduces the Universal Synchronization Module (USM). This module provides a framework for synchronization protocols such as Microsoft Exchange ActiveSync (EAS) or other services building on this foundation. USM acts as a layer between the Open-Xchange HTTP API and the synchronization protocol. It handles synchronization specific tasks like conflict management.&lt;br /&gt;
The synchronization stack (USM) and protocol implementation (EAS) are shipped as OSGi bundles and run as a plug-in of an Open-Xchange instance.&lt;br /&gt;
&lt;br /&gt;
=== Component Overview ===&lt;br /&gt;
USM, EAS and OX work together as components. This is a general outline about how these components interact.&lt;br /&gt;
&lt;br /&gt;
When the device initiates a synchronization through ActiveSync, it contacts the webserver using the URL /Microsoft-Server-ActiveSync via HTTP/s. This URL is forwarded to the Open-Xchange application server where the corresponding servlet is offered by the EAS component. The EAS component then uses USM to initiate a connection to the OX HTTP API and exchanges groupware data. In all cases, USM works as an client to the Open-Xchange HTTP API. It also uses some database tables which are accessed through the Open-Xchange SQL interface to store metadata like synchronization status. The same component stack is used to transport groupware data back to the device.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
Since the Connector for Business Mobility is a server plug-in based on the OSGi Framework it can be added to an existing Open-Xchange installation very easily. '''OX App Suite v7.0 or later is required to operate this extension.''' The Connector for Business Mobility uses the resources and services offered by the Open-Xchange server, no additional software or configuration is required.&lt;br /&gt;
&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_Debian_6.0 | Debian 6.0 (Squeeze)]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_SLES11 | SLES11]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_RHEL6 | RHEL6]]&lt;br /&gt;
&lt;br /&gt;
'''Please Note:''' To get in favor of the latest minor features and bugfixes, you need to have a valid license.  The article [[AppSuite:UpdatingOXPackages | Updating OX-Packages]] explains how that can be done.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Redhat Enterprise Linux 6 or CentOS 6 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange yum configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=YUMRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=rhelname|pc2v=RHEL6|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ yum install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== Debian GNU/Linux 6.0 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange apt configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=APTRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=debianname|pc2v=DebianSqueeze|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ apt-get update&lt;br /&gt;
 $ apt-get install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=SUSERepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=susename|pc2v=SLES11|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ zypper ref&lt;br /&gt;
 $ zypper install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the Open-Xchange service needs to be restarted:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/open-xchange restart&lt;br /&gt;
&lt;br /&gt;
On the first login after the restart, all required database tables will be created.&lt;br /&gt;
&lt;br /&gt;
== Download and Installation OX Server Edition / App Suite for UCS ==&lt;br /&gt;
&lt;br /&gt;
If you have purchased the OX Server Edition / App Suite for UCS, the Connector is part of the offering. Installation of the Connector with the following steps:&lt;br /&gt;
&lt;br /&gt;
* The new license is already registered at the LDB after purchase&lt;br /&gt;
* Click on &amp;quot;Online Updates&amp;quot; at the Univention Management Console &lt;br /&gt;
* The Connector for Business Mobility is available at the &amp;quot;Open-Xchange Components&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Mail Push ===&lt;br /&gt;
&lt;br /&gt;
In order to get mail push, either install and configure the package open-xchange-push-malpoll, which is not recommended on large deployments or if you're using cyrus-imap, read the [[MailNotify Bundle‎‎]] instructions on how to set up real mail push with cyrus.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange configuration ===&lt;br /&gt;
The configuration for USM and the EAS protocol can be found in these two configuration files:&lt;br /&gt;
 /opt/open-xchange/etc/usm.properties&lt;br /&gt;
 /opt/open-xchange/etc/eas.properties&lt;br /&gt;
&lt;br /&gt;
Make sure that the Open-Xchange Server URL is set properly in usm.properties. This needs to be the machine which provides the web interface. Usually, this is localhost, as the webserver and Open-Xchange run on the same machine.&lt;br /&gt;
 com.openexchange.usm.ox.url=http://localhost/ajax/&lt;br /&gt;
&lt;br /&gt;
in case webserver and Open-Xchange aren't running on the same machine:&lt;br /&gt;
 com.openexchange.usm.ox.url=http://$FQDN/ajax/&lt;br /&gt;
(Where $FQDN is the fully qualified domain name of your frontend system)&lt;br /&gt;
&lt;br /&gt;
On clustered setups, adjust the file&lt;br /&gt;
/opt/open-xchange/etc/groupware/noipcheck.cnf&lt;br /&gt;
to include the range of IP addresses of the servers on which USM is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Documentation about the configuration parameters can be found inside the configuration files. If you change any attribute at the configuration files, the Open-Xchange groupware service needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
=== Apache Configuration ===&lt;br /&gt;
Mobile devices supporting ActiveSync use a special URL to communicate with an ActiveSync enabled Open-Xchange Server. This URL needs to be forwarded to the Open-Xchange ActiveSync servlet. The required configuration options are already part of the default Open-Xchange installation instructions.&lt;br /&gt;
&lt;br /&gt;
The example assumes that Open-Xchange Server is running on the same machine like the webserver. Please refer the Open-Xchange administration documentation for more information about Apache configuration. Please restart apache after performing the configuration change.&lt;br /&gt;
 /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
=== Enabling ActiveSync for user accounts ===&lt;br /&gt;
In order to use synchronization through ActiveSync, this feature needs to be activated for user accounts. You can either activate it for specific users or a whole context.&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for specific users:&lt;br /&gt;
 /opt/open-xchange/sbin/changeuser -c 1 -A oxadmin -P admin_password -u testuser --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for a whole context:&lt;br /&gt;
 /opt/open-xchange/sbin/changecontext -c 1 -A oxadminmaster -P admin_master_password --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
== Log files and issue tracking ==&lt;br /&gt;
When facing problems with synchronization, there are several ways to get more information than provided via device or platform specific error codes.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange Server logfile ===&lt;br /&gt;
By default, the log output is non verbose. Only severe errors will be logged. To enable a more detailed log output, the logging mechanism needs to be configured. This depends on the used mechanism.&lt;br /&gt;
&lt;br /&gt;
=== Commons Logging ===&lt;br /&gt;
This is the default logging mechanism. If the Open-Xchange Server log output is written to ''var/log/open-xchange/open-xchange.log'' it's an indicator that this mechanism is in use. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/groupware/file-logging.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.level=FINE&lt;br /&gt;
&lt;br /&gt;
This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Log4j ===&lt;br /&gt;
If the package ''open-xchange-log4j'' is installed, Open-Xchange Server will log via a UDP network socket. In most cases a syslog daemon is listening to this socket and will write the log data to a platform specif file like ''/var/log/syslog''. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/log4j.xml&lt;br /&gt;
 [...]&lt;br /&gt;
    &amp;lt;category name=&amp;quot;com.openexchange.usm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;level value=&amp;quot;DEBUG&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;appender-ref ref=&amp;quot;SERVER_LOG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the XML syntax must be correct. This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== EAS debug logfile ===&lt;br /&gt;
While the generic Open-Xchange Server log file will keep track on errors reported by the software components, the EAS debug log file will print all data transfered to the device as XML. Please note: this log file may contain confidential data about the users personal groupware objects. Make sure that no unauthorized access to those log files is possible in order to maintain privacy. Change the configuration file accordingly and set a output path which can only accessed by authorized persons.&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/eas.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.eas.debug_log=/tmp/EAS-debug.log&lt;br /&gt;
&lt;br /&gt;
This will enable a XML based debug log for all EAS connections, after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Network traffic ===&lt;br /&gt;
When using unencrypted connections between the device and USM and USM and Open-Xchange Server (not recommended), it's possible to analyze the network traffic with tools like ngrep or wireshark. When using encrypted data connections using SSL, the transfered data can be decrypted using the corresponding private key. Please note that there are two network streams, one from the device to USM (external) and one from USM to OX (internal).&lt;br /&gt;
&lt;br /&gt;
== Bug-Reporting == &lt;br /&gt;
Please report bugs via the Open-Xchange Bugzilla:&lt;br /&gt;
&lt;br /&gt;
[https://bugs.open-xchange.com/ Direct link to Open-Xchange Bugzilla]&lt;br /&gt;
&lt;br /&gt;
* Product: Connector for Business Mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Client configuration =&lt;br /&gt;
&lt;br /&gt;
Information about the client configuration for the different devices is available at the [http://software.open-xchange.com/products/appsuite/doc/mobilityconnector/ User Guides].&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
* The Exchange Active Sync protocol does not support the synchronization of client email drafts-folder to the server. Synchronization from server drafts-folder to the client will work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AppSuite]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17249</id>
		<title>AppSuite:Connector for Business Mobility Installation Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Connector_for_Business_Mobility_Installation_Guide&amp;diff=17249"/>
		<updated>2014-03-12T08:45:51Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* EAS debug logfile */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Connector for Business Mobility =&lt;br /&gt;
&lt;br /&gt;
== Components ==&lt;br /&gt;
&lt;br /&gt;
With the Connector for Business Mobility, Open-Xchange also introduces the Universal Synchronization Module (USM). This module provides a framework for synchronization protocols such as Microsoft Exchange ActiveSync (EAS) or other services building on this foundation. USM acts as a layer between the Open-Xchange HTTP API and the synchronization protocol. It handles synchronization specific tasks like conflict management.&lt;br /&gt;
The synchronization stack (USM) and protocol implementation (EAS) are shipped as OSGi bundles and run as a plug-in of an Open-Xchange instance.&lt;br /&gt;
&lt;br /&gt;
=== Component Overview ===&lt;br /&gt;
USM, EAS and OX work together as components. This is a general outline about how these components interact.&lt;br /&gt;
&lt;br /&gt;
When the device initiates a synchronization through ActiveSync, it contacts the webserver using the URL /Microsoft-Server-ActiveSync via HTTP/s. This URL is forwarded to the Open-Xchange application server where the corresponding servlet is offered by the EAS component. The EAS component then uses USM to initiate a connection to the OX HTTP API and exchanges groupware data. In all cases, USM works as an client to the Open-Xchange HTTP API. It also uses some database tables which are accessed through the Open-Xchange SQL interface to store metadata like synchronization status. The same component stack is used to transport groupware data back to the device.&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
&lt;br /&gt;
Since the Connector for Business Mobility is a server plug-in based on the OSGi Framework it can be added to an existing Open-Xchange installation very easily. '''OX App Suite v7.0 or later is required to operate this extension.''' The Connector for Business Mobility uses the resources and services offered by the Open-Xchange server, no additional software or configuration is required.&lt;br /&gt;
&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_Debian_6.0 | Debian 6.0 (Squeeze)]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_SLES11 | SLES11]]&lt;br /&gt;
* [[AppSuite:Open-Xchange_Installation_Guide_for_RHEL6 | RHEL6]]&lt;br /&gt;
&lt;br /&gt;
'''Please Note:''' To get in favor of the latest minor features and bugfixes, you need to have a valid license.  The article [[AppSuite:UpdatingOXPackages | Updating OX-Packages]] explains how that can be done.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Redhat Enterprise Linux 6 or CentOS 6 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange yum configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=YUMRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=rhelname|pc2v=RHEL6|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ yum install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== Debian GNU/Linux 6.0 ===&lt;br /&gt;
&lt;br /&gt;
Add the following repositories to your Open-Xchange apt configuration:&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=APTRepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=debianname|pc2v=DebianSqueeze|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ apt-get update&lt;br /&gt;
 $ apt-get install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
=== SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
&lt;br /&gt;
 {{for loop||call=SUSERepo|pv=reponame|pc1n=path|pc1v=products/appsuite/stable|pc2n=susename|pc2v=SLES11|pc3n=ldbaccount|pc3v=LDBUSER:LDBPASSWORD|usm|mobilityconnector}}&lt;br /&gt;
&lt;br /&gt;
 $ zypper ref&lt;br /&gt;
 $ zypper install open-xchange-meta-mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the Open-Xchange service needs to be restarted:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/open-xchange restart&lt;br /&gt;
&lt;br /&gt;
On the first login after the restart, all required database tables will be created.&lt;br /&gt;
&lt;br /&gt;
== Download and Installation OX Server Edition / App Suite for UCS ==&lt;br /&gt;
&lt;br /&gt;
If you have purchased the OX Server Edition / App Suite for UCS, the Connector is part of the offering. Installation of the Connector with the following steps:&lt;br /&gt;
&lt;br /&gt;
* The new license is already registered at the LDB after purchase&lt;br /&gt;
* Click on &amp;quot;Online Updates&amp;quot; at the Univention Management Console &lt;br /&gt;
* The Connector for Business Mobility is available at the &amp;quot;Open-Xchange Components&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Mail Push ===&lt;br /&gt;
&lt;br /&gt;
In order to get mail push, either install and configure the package open-xchange-push-malpoll, which is not recommended on large deployments or if you're using cyrus-imap, read the [[MailNotify Bundle‎‎]] instructions on how to set up real mail push with cyrus.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange configuration ===&lt;br /&gt;
The configuration for USM and the EAS protocol can be found in these two configuration files:&lt;br /&gt;
 /opt/open-xchange/etc/usm.properties&lt;br /&gt;
 /opt/open-xchange/etc/eas.properties&lt;br /&gt;
&lt;br /&gt;
Make sure that the Open-Xchange Server URL is set properly in usm.properties. This needs to be the machine which provides the web interface. Usually, this is localhost, as the webserver and Open-Xchange run on the same machine.&lt;br /&gt;
 com.openexchange.usm.ox.url=http://localhost/ajax/&lt;br /&gt;
&lt;br /&gt;
in case webserver and Open-Xchange aren't running on the same machine:&lt;br /&gt;
 com.openexchange.usm.ox.url=http://$FQDN/ajax/&lt;br /&gt;
(Where $FQDN is the fully qualified domain name of your frontend system)&lt;br /&gt;
&lt;br /&gt;
On clustered setups, adjust the file&lt;br /&gt;
/opt/open-xchange/etc/groupware/noipcheck.cnf&lt;br /&gt;
to include the range of IP addresses of the servers on which USM is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Documentation about the configuration parameters can be found inside the configuration files. If you change any attribute at the configuration files, the Open-Xchange groupware service needs to be restarted.&lt;br /&gt;
&lt;br /&gt;
=== Apache Configuration ===&lt;br /&gt;
Mobile devices supporting ActiveSync use a special URL to communicate with an ActiveSync enabled Open-Xchange Server. This URL needs to be forwarded to the Open-Xchange ActiveSync servlet. The required configuration options are already part of the default Open-Xchange installation instructions.&lt;br /&gt;
&lt;br /&gt;
The example assumes that Open-Xchange Server is running on the same machine like the webserver. Please refer the Open-Xchange administration documentation for more information about Apache configuration. Please restart apache after performing the configuration change.&lt;br /&gt;
 /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
=== Enabling ActiveSync for user accounts ===&lt;br /&gt;
In order to use synchronization through ActiveSync, this feature needs to be activated for user accounts. You can either activate it for specific users or a whole context.&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for specific users:&lt;br /&gt;
 /opt/open-xchange/sbin/changeuser -c 1 -A oxadmin -P admin_password -u testuser --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
Activating ActiveSync for a whole context:&lt;br /&gt;
 /opt/open-xchange/sbin/changecontext -c 1 -A oxadminmaster -P admin_master_password --access-usm on --access-active-sync on&lt;br /&gt;
&lt;br /&gt;
== Log files and issue tracking ==&lt;br /&gt;
When facing problems with synchronization, there are several ways to get more information than provided via device or platform specific error codes.&lt;br /&gt;
&lt;br /&gt;
=== Open-Xchange Server logfile ===&lt;br /&gt;
By default, the log output is non verbose. Only severe errors will be logged. To enable a more detailed log output, the logging mechanism needs to be configured. This depends on the used mechanism.&lt;br /&gt;
&lt;br /&gt;
=== Commons Logging ===&lt;br /&gt;
This is the default logging mechanism. If the Open-Xchange Server log output is written to ''var/log/open-xchange/open-xchange.log'' it's an indicator that this mechanism is in use. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/groupware/file-logging.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.level=FINE&lt;br /&gt;
&lt;br /&gt;
This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Log4j ===&lt;br /&gt;
If the package ''open-xchange-log4j'' is installed, Open-Xchange Server will log via a UDP network socket. In most cases a syslog daemon is listening to this socket and will write the log data to a platform specif file like ''/var/log/syslog''. To make the log output more verbose, add the following parameter:&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/groupware/log4j.xml&lt;br /&gt;
 [...]&lt;br /&gt;
    &amp;lt;category name=&amp;quot;com.openexchange.usm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;level value=&amp;quot;DEBUG&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;appender-ref ref=&amp;quot;SERVER_LOG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/category&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the XML syntax must be correct. This will enable a software debug log for all components using USM, including EAS after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== EAS debug logfile ===&lt;br /&gt;
While the generic Open-Xchange Server log file will keep track on errors reported by the software components, the EAS debug log file will print all data transfered to the device as XML. Please note: this log file may contain confidential data about the users personal groupware objects. Make sure that no unauthorized access to those log files is possible in order to maintain privacy. Change the configuration file accordingly and set a output path which can only accessed by authorized persons.&lt;br /&gt;
&lt;br /&gt;
 vim /opt/open-xchange/etc/eas.properties&lt;br /&gt;
 [...]&lt;br /&gt;
 com.openexchange.usm.eas.debug_log=/tmp/EAS-debug.log&lt;br /&gt;
&lt;br /&gt;
This will enable a XML based debug log for all EAS connections, after restarting Open-Xchange Server.&lt;br /&gt;
&lt;br /&gt;
=== Network traffic ===&lt;br /&gt;
When using unencrypted connections between the device and USM and USM and Open-Xchange Server (not recommended), it's possible to analyze the network traffic with tools like ngrep or wireshark. When using encrypted data connections using SSL, the transfered data can be decrypted using the corresponding private key. Please note that there are two network streams, one from the device to USM (external) and one from USM to OX (internal).&lt;br /&gt;
&lt;br /&gt;
== Bug-Reporting == &lt;br /&gt;
Please report bugs via the Open-Xchange Bugzilla:&lt;br /&gt;
&lt;br /&gt;
[https://bugs.open-xchange.com/ Direct link to Open-Xchange Bugzilla]&lt;br /&gt;
&lt;br /&gt;
* Product: Connector for Business Mobility&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Client configuration =&lt;br /&gt;
&lt;br /&gt;
Information about the client configuration for the different devices is available at the [http://software.open-xchange.com/products/appsuite/doc/mobilityconnector/ User Guides].&lt;br /&gt;
&lt;br /&gt;
= Known Issues =&lt;br /&gt;
&lt;br /&gt;
* The Exchange Active Sync protocol does not support the synchronization of client email drafts-folder to the server. Synchronization from server drafts-folder to the client will work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AppSuite]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=OX6:Open-Xchange_Installation_Guide_for_CentOS_6_622&amp;diff=17140</id>
		<title>OX6:Open-Xchange Installation Guide for CentOS 6 622</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=OX6:Open-Xchange_Installation_Guide_for_CentOS_6_622&amp;diff=17140"/>
		<updated>2014-02-24T14:50:28Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* MySQL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Open-Xchange Server 6 (v6.22) on CentOS6 Linux =&lt;br /&gt;
&lt;br /&gt;
{{QuickInstIntro|release=6}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Important: This installation guide will only work for v6.22. If you want to install v6.20 please use the [http://oxpedia.org/wiki/index.php?title=Open-Xchange_Installation_Guide_for_CentOS_6 installation guide for earlier versions].'''&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
&lt;br /&gt;
* Plain installed CentOS6 with latest updates&lt;br /&gt;
* A configured internet connection&lt;br /&gt;
* httpd - Apache web server&lt;br /&gt;
&lt;br /&gt;
{{AddReposRHEL|rhelname=RHEL6|release=6.22}}&lt;br /&gt;
&lt;br /&gt;
= Updating repositories and installing packages =&lt;br /&gt;
&lt;br /&gt;
Reload the package index. This will download the package descriptions available at the software repositories:&lt;br /&gt;
&lt;br /&gt;
 $ yum update&lt;br /&gt;
&lt;br /&gt;
The following command starts the download and installation process of all required package for Open-Xchange deployment:&lt;br /&gt;
&lt;br /&gt;
{{OXPackageInstallation|installer=yum|mysql=mysql-server|javavendor=sun|release=6.22}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{OXConfiguration|mysqlstart=/etc/init.d/mysqld start}}&lt;br /&gt;
&lt;br /&gt;
{{oxinstaller|connector=http}}&lt;br /&gt;
&lt;br /&gt;
After initializing the configuration, start the Open-Xchange service by executing:&lt;br /&gt;
&lt;br /&gt;
 $ /etc/init.d/open-xchange start&lt;br /&gt;
&lt;br /&gt;
{{OXRegister}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Configure services =&lt;br /&gt;
Now as the Open-Xchange Server has been set up and the database is running, we have to configure the Apache webserver and the mod_proxy_ajp module to access the groupware frontend. To gain better GUI performance, the usage of ''mod_expires'' and ''mod_deflate'' is strongly recommended. Those modules will limit the amount of client requests and compress the delivered content. The default installation of the Apache webserver on CentOS provides a welcome screen which is not necessary for server operation, it can be removed by deleting the corresponding configuration file:&lt;br /&gt;
&lt;br /&gt;
 $ rm /etc/httpd/conf.d/welcome.conf&lt;br /&gt;
&lt;br /&gt;
{{Template:ApacheOXConf|connector=http|connectorConf=/etc/httpd/conf.d/proxy_http.conf|apacheconf= /etc/httpd/conf.d/ox.conf|docroot=/var/www/html|release=6.22|loadmodule=LoadModule proxy_http_module modules/mod_proxy_http.so|easProxyName=eas_oxcluster}}&lt;br /&gt;
&lt;br /&gt;
After the configuration is done, restart the Apache webserver&lt;br /&gt;
&lt;br /&gt;
 $ /etc/init.d/httpd restart&lt;br /&gt;
&lt;br /&gt;
= Adding services to runlevels =&lt;br /&gt;
&lt;br /&gt;
The new services are now installed and configured, but to make them start up on a server boot, they need to be added to some runlevels:&lt;br /&gt;
&lt;br /&gt;
 $ chkconfig --level 345 mysqld on&lt;br /&gt;
 $ chkconfig --level 345 httpd on&lt;br /&gt;
 $ chkconfig --level 345 open-xchange on&lt;br /&gt;
&lt;br /&gt;
= Creating contexts and users =&lt;br /&gt;
Now as the whole setup is complete and you already should get a login screen when accessing the server with a webbrowser, we have to setup a context and a default user as the last step of this tutorial.&lt;br /&gt;
&lt;br /&gt;
The mapping ''defaultcontext'' will allow you to set this context as the default one of the entire system so that users which will be created within this context can login into Open-Xchange Server without specifying their domain at the login screen. Only one context can be specified as ''defaultcontext''. The ''oxadmin'' user that will be created by this command is the default admin of the created context. This account will gather additional functions that are also described in the administration manual. The ''context id'' parameter must to be unique and numeric, otherwise the server will complain when you try to create a context. New contexts must be created by the ''oxadminmaster'' user, user accounts inside a context are created with the credentials of the contexts ''oxadmin'' account. The ''access-combination-name'' property defines the set of available modules and functions for users of the context.&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/createcontext -A oxadminmaster -P admin_master_password -c 1 \&lt;br /&gt;
 -u oxadmin -d &amp;quot;Context Admin&amp;quot; -g Admin -s User -p secret -L defaultcontext \&lt;br /&gt;
 -e oxadmin@example.com -q 1024 --access-combination-name=all&lt;br /&gt;
&lt;br /&gt;
Create a user for testing purposes:&lt;br /&gt;
&lt;br /&gt;
 $ /opt/open-xchange/sbin/createuser -c 1 -A oxadmin -P secret -u testuser \&lt;br /&gt;
 -d &amp;quot;Test User&amp;quot; -g Test -s User -p secret -e testuser@example.com \&lt;br /&gt;
 --imaplogin testuser --imapserver 127.0.0.1 --smtpserver 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
Now connect to the server with a webbrowser and login using the credentials testuser / secret.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Log files and issue tracking =&lt;br /&gt;
&lt;br /&gt;
Whenever unexpected or erroneous behavior takes place, it will be logged depending on the configured loglevel. All logfiles are stored at the operating systems default location. Events triggered by the Open-Xchange Groupware services are logged to a rotating file ''open-xchange.log'', events triggered by the Open-Xchange Administration service are logged to ''open-xchange-admin.log''. Those files are the very first place to monitor.&lt;br /&gt;
 &lt;br /&gt;
 $ tail -f -n200 /var/log/open-xchange/open-xchange.log.0&lt;br /&gt;
&lt;br /&gt;
= Performance &amp;amp; Tuning Tips =&lt;br /&gt;
Depending on your setup and the user accounts, it´s often helpful to know, how to get a better performance from the complete system. This section will try to assist you, how to tune the components within an OX setup, before you need to install a second server, add more RAM, add new CPU to existing servers. &lt;br /&gt;
&lt;br /&gt;
== MySQL ==&lt;br /&gt;
Since OX itself used very specific features from MySQL like InnoDB instead of MyISAM as DB Engine, it´s often needed, how to increase performance of the OX databases. In general, you should always monitor your MySQL system via tools like &amp;quot;munin&amp;quot;, to see when your system reaches it´s limits. Once, you recognized, the system responds more and more slowly, you start to read and research on the internet how to change your mysql configuration, specially, the my.cnf file. But due to the fact, that nearly every system is different in regards of hardware etc. you cannot just copy&amp;amp;paste existing configurations. At this point, a tool called &amp;quot;mysqltuner.pl&amp;quot; can help you. MySQLTuner is a script written in Perl that will assist you with your MySQL configuration and make recommendations for increased performance and stability. Within seconds, it will display statistics about your MySQL installation and the areas where it can be improved. To work with this tool, you need unrestricted read access to the MySQL server (OS root access is recommended). Just download and execute as shown below, and modify your existing my.cnf configuration file. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT INFO: The MySQL system must run for several days, to gather statistics and informations about queries etc. from OX. After these days, you should execute mysqltuner.pl script. It does not work if you run it directly after installing an OX/MySQL setup. You can force traffic to OX while writing automatic testcases or jmeter plans. &lt;br /&gt;
&lt;br /&gt;
As already said, this is just ONE way to analyze MySQL systems. You can also check MYSQL.com for a consultant service or similar.&lt;br /&gt;
&lt;br /&gt;
 $ wget https://raw.github.com/major/MySQLTuner-perl/master/mysqltuner.pl&lt;br /&gt;
&lt;br /&gt;
Make the PERL script executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ chmod +x mysqltuner.pl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Execute the PERL script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $ ./mysqltuner.pl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If prompted, enter your MySQL credentials and read carefully through the complete output of the script. Now you have very good informations, how to change your mysql system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Syslog_Configuration&amp;diff=12903</id>
		<title>AppSuite:Syslog Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Syslog_Configuration&amp;diff=12903"/>
		<updated>2013-02-15T15:30:34Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* SUSE Linux Enterprise Server 11 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Open-Xchange Syslog Configuration=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
Open-Xchange provides OSGi packages (''open-xchange-log4j'' and ''open-xchange-commons-logging-log4j'') to enable remote logging via syslog. This is useful for distributed setups or if a logging strategy is already present at the environments the servers are running. If you choose syslog to be the logging mechanism, the syslog service needs some configuration to accept remote logging, even if the service is running on localhost.&lt;br /&gt;
&lt;br /&gt;
The syslog remote logging will open port 514/udp, so don't forget to firewall it properly if it's a security risk for you. The default logging facility of Open-Xchange is defined at the ''/opt/open-xchange/{groupware,admindaemon}/etc/log4j.xml'' file. For more granular log filtering this facility can be changed. Please refer to the syslog and syslog-ng documentation for further information.&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-log4j|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
Please note, there are numerous syslog daemons available and the configuration may also differ between Linux distributions. To make open-xchange-log4j running in collaboration with the syslog&lt;br /&gt;
daemon of your choice, you have to enable logging via UDP protocol and listening port 514. Please&lt;br /&gt;
read for details the documentation of your running syslog service. &lt;br /&gt;
=== For RHEL and CentOS ===&lt;br /&gt;
Here are the documentation steps for the popular rsyslod service.&lt;br /&gt;
The parameter configuration is now completely done at a configuration file at ''/etc/rsyslog.conf''&lt;br /&gt;
&lt;br /&gt;
 # provides UDP syslog reception&lt;br /&gt;
 $ModLoad imudp&lt;br /&gt;
 $UDPServerRun 514&lt;br /&gt;
&lt;br /&gt;
Then restart the rsyslog service to enable remote logging.&lt;br /&gt;
 $ /etc/init.d/rsyslog restart&lt;br /&gt;
&lt;br /&gt;
By default, all Open-Xchange log messages are put to ''/var/log/syslog''.&lt;br /&gt;
&lt;br /&gt;
===For SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
SLES11 comes up with syslog-ng, modify the configuration at ''/etc/syslog-ng/syslog-ng.conf'':&lt;br /&gt;
&lt;br /&gt;
 source src {&lt;br /&gt;
        #&lt;br /&gt;
        # include internal syslog-ng messages&lt;br /&gt;
        # note: the internal() soure is required!&lt;br /&gt;
        #&lt;br /&gt;
        internal();&lt;br /&gt;
 &lt;br /&gt;
        #&lt;br /&gt;
        # the default log socket for local logging:&lt;br /&gt;
        #&lt;br /&gt;
        unix-dgram(&amp;quot;/dev/log&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        #&lt;br /&gt;
        # uncomment to process log messages from network:&lt;br /&gt;
        #&lt;br /&gt;
        udp(ip(&amp;quot;0.0.0.0&amp;quot;) port(514));&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Uncomment the last statement of the src definition and restart the syslog service to enable logging.&lt;br /&gt;
 $ /etc/init.d/syslog restart&lt;br /&gt;
&lt;br /&gt;
By default, all Open-Xchange log messages are put to ''/var/log/messages''.&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Syslog_Configuration&amp;diff=12902</id>
		<title>AppSuite:Syslog Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Syslog_Configuration&amp;diff=12902"/>
		<updated>2013-02-15T15:29:10Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* rsyslod */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Open-Xchange Syslog Configuration=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
Open-Xchange provides OSGi packages (''open-xchange-log4j'' and ''open-xchange-commons-logging-log4j'') to enable remote logging via syslog. This is useful for distributed setups or if a logging strategy is already present at the environments the servers are running. If you choose syslog to be the logging mechanism, the syslog service needs some configuration to accept remote logging, even if the service is running on localhost.&lt;br /&gt;
&lt;br /&gt;
The syslog remote logging will open port 514/udp, so don't forget to firewall it properly if it's a security risk for you. The default logging facility of Open-Xchange is defined at the ''/opt/open-xchange/{groupware,admindaemon}/etc/log4j.xml'' file. For more granular log filtering this facility can be changed. Please refer to the syslog and syslog-ng documentation for further information.&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-log4j|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
Please note, there are numerous syslog daemons available and the configuration may also differ between Linux distributions. To make open-xchange-log4j running in collaboration with the syslog&lt;br /&gt;
daemon of your choice, you have to enable logging via UDP protocol and listening port 514. Please&lt;br /&gt;
read for details the documentation of your running syslog service. &lt;br /&gt;
=== For RHEL and CentOS ===&lt;br /&gt;
Here are the documentation steps for the popular rsyslod service.&lt;br /&gt;
The parameter configuration is now completely done at a configuration file at ''/etc/rsyslog.conf''&lt;br /&gt;
&lt;br /&gt;
 # provides UDP syslog reception&lt;br /&gt;
 $ModLoad imudp&lt;br /&gt;
 $UDPServerRun 514&lt;br /&gt;
&lt;br /&gt;
Then restart the rsyslog service to enable remote logging.&lt;br /&gt;
 $ /etc/init.d/rsyslog restart&lt;br /&gt;
&lt;br /&gt;
By default, all Open-Xchange log messages are put to ''/var/log/syslog''.&lt;br /&gt;
&lt;br /&gt;
===SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
SLES11 comes with syslog-ng, modify the configuration at ''/etc/syslog-ng/syslog-ng.conf'':&lt;br /&gt;
&lt;br /&gt;
 source src {&lt;br /&gt;
        #&lt;br /&gt;
        # include internal syslog-ng messages&lt;br /&gt;
        # note: the internal() soure is required!&lt;br /&gt;
        #&lt;br /&gt;
        internal();&lt;br /&gt;
 &lt;br /&gt;
        #&lt;br /&gt;
        # the default log socket for local logging:&lt;br /&gt;
        #&lt;br /&gt;
        unix-dgram(&amp;quot;/dev/log&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        #&lt;br /&gt;
        # uncomment to process log messages from network:&lt;br /&gt;
        #&lt;br /&gt;
        udp(ip(&amp;quot;0.0.0.0&amp;quot;) port(514));&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Uncomment the last statement of the src definition and restart the syslog service to enable logging.&lt;br /&gt;
 $ /etc/init.d/syslog restart&lt;br /&gt;
&lt;br /&gt;
By default, all Open-Xchange log messages are put to ''/var/log/messages''.&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
	<entry>
		<id>https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Syslog_Configuration&amp;diff=12901</id>
		<title>AppSuite:Syslog Configuration</title>
		<link rel="alternate" type="text/html" href="https://wiki.open-xchange.com/wiki/index.php?title=AppSuite:Syslog_Configuration&amp;diff=12901"/>
		<updated>2013-02-15T15:25:21Z</updated>

		<summary type="html">&lt;p&gt;Usman.ahmad: /* rsyslod */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Open-Xchange Syslog Configuration=&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
Open-Xchange provides OSGi packages (''open-xchange-log4j'' and ''open-xchange-commons-logging-log4j'') to enable remote logging via syslog. This is useful for distributed setups or if a logging strategy is already present at the environments the servers are running. If you choose syslog to be the logging mechanism, the syslog service needs some configuration to accept remote logging, even if the service is running on localhost.&lt;br /&gt;
&lt;br /&gt;
The syslog remote logging will open port 514/udp, so don't forget to firewall it properly if it's a security risk for you. The default logging facility of Open-Xchange is defined at the ''/opt/open-xchange/{groupware,admindaemon}/etc/log4j.xml'' file. For more granular log filtering this facility can be changed. Please refer to the syslog and syslog-ng documentation for further information.&lt;br /&gt;
&lt;br /&gt;
{{InstallPlugin|pluginname=open-xchange-log4j|toplevel=products|sopath=appsuite/stable/backend|version=App Suite}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
Please note, there are numerous syslog daemons available and the configuration may also differ between Linux distributions. To make open-xchange-log4j running in collaboration with the syslog&lt;br /&gt;
daemon of your choice, you have to enable logging via UDP protocol and listening port 514. Please&lt;br /&gt;
read for details the documentation of your running syslog service. &lt;br /&gt;
=== rsyslod ===&lt;br /&gt;
Here documentation steps for the popular rsyslod.&lt;br /&gt;
The parameter configuration is now completely done at a configuration file at ''/etc/rsyslog.conf''&lt;br /&gt;
&lt;br /&gt;
 # provides UDP syslog reception&lt;br /&gt;
 $ModLoad imudp&lt;br /&gt;
 $UDPServerRun 514&lt;br /&gt;
&lt;br /&gt;
Then restart the rsyslog service to enable remote logging.&lt;br /&gt;
 $ /etc/init.d/rsyslog restart&lt;br /&gt;
&lt;br /&gt;
By default, all Open-Xchange log messages are put to ''/var/log/syslog''.&lt;br /&gt;
&lt;br /&gt;
===SUSE Linux Enterprise Server 11 ===&lt;br /&gt;
SLES11 comes with syslog-ng, modify the configuration at ''/etc/syslog-ng/syslog-ng.conf'':&lt;br /&gt;
&lt;br /&gt;
 source src {&lt;br /&gt;
        #&lt;br /&gt;
        # include internal syslog-ng messages&lt;br /&gt;
        # note: the internal() soure is required!&lt;br /&gt;
        #&lt;br /&gt;
        internal();&lt;br /&gt;
 &lt;br /&gt;
        #&lt;br /&gt;
        # the default log socket for local logging:&lt;br /&gt;
        #&lt;br /&gt;
        unix-dgram(&amp;quot;/dev/log&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        #&lt;br /&gt;
        # uncomment to process log messages from network:&lt;br /&gt;
        #&lt;br /&gt;
        udp(ip(&amp;quot;0.0.0.0&amp;quot;) port(514));&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
Uncomment the last statement of the src definition and restart the syslog service to enable logging.&lt;br /&gt;
 $ /etc/init.d/syslog restart&lt;br /&gt;
&lt;br /&gt;
By default, all Open-Xchange log messages are put to ''/var/log/messages''.&lt;br /&gt;
&lt;br /&gt;
[[Category: OX6]]&lt;/div&gt;</summary>
		<author><name>Usman.ahmad</name></author>
	</entry>
</feed>