This chapter describes how to configure multiple Oracle Communications Calendar Server back-end hosts. For conceptual information, see "Calendar Server Front-End and Back-End Components." For information on performing an initial installation of Calendar Server, including back-end hosts, see "Installing Calendar Server".
A standard Calendar Server installation consists of a default back-end database that contains user data, and an iSchedule back-end database for iScheduling requests. Over time, you might want to add additional back-end user data bases to your initial deployment.
In the case of multiple Calendar Server front ends, configure each to use the same initial default database back end and iSchedule back end. Then, you add additional back ends to each front end. Only one iSchedule back end is needed for all front ends to share.
Each back-end database, including the iSchedule database, must have its own document store. In the case of multiple front ends, all document stores must be available to all front ends. You cannot make all document stores local to a front end in a multiple front-end deployment.
The high-level steps to configure multiple back-end Calendar Server hosts include:
Gathering the database host names, ports, and other database names
Installing all front-end hosts, if not already done
Configuring all front-end servers by using the init-config script, if not already done
Running the init-config script creates the config-backend script for use in the next step. Information on any back-end host can be used for this step. If you have already run the init-config script, and you want to rename the default back-end host, see "Renaming the Default Calendar Server Back-End Host".
Running the config-backend script on each front-end host.
Note:
If you use WebLogic Server, you cannot run this script. See "Installing and Configuring Multiple Calendar Server Back-End Hosts for WebLogic Server Manually" for more information.Enabling connection pool validation on each front-end host.
Note:
This step is applicable only for GlassFish Server.Restarting the application server on each front-end host.
Skip Steps 2 and 3 if you are adding new back-end hosts to an existing front-end installation.
To install and configure multiple Calendar Server back-end hosts for GlassFish Server:
Install the database software on each back-end host. Choose one of the following:
Decide if you must create additional Oracle Database or MySQL Server back-end databases. If MySQL, continue with this step. If Oracle Database, skip to Step 3.
Note:
If the Calendar Server software is not installed on the back-end host, copy the config-mysql, config-oracle, and Util.pm scripts from an installed Calendar Server host and adjust the following path to those scripts accordingly.If this is first database on the host, set up the instance, and create the user and database by running the following command.
Calendar_Home/tools/unsupported/bin/config-mysql -s -u -c
If there is already a database on the host, just create the calendar database by running the following command.
Calendar_Home/tools/unsupported/bin/config-mysql -c
To create the Oracle database user and schema, see the following:
On each front-end host, run the config-backend script.
This script creates a JDBC connection pool and a JDBC resource on the GlassFish Server, and a davserver attributed back-end configuration.
CalendarServer_home/sbin/config-backend
If current deployment is using MySQL, you are prompted for the following information:
Remote database server host name Remote database server port Calendar db name on remote server Calendar db user name Calendar db user password Verifying the database input... Database input is verified Backend identifier for the remote db Document store directory (leave blank if store is remote) Document store host (leave blank if store is local) Document store port (leave blank if store local) Application Server admin user password
Make sure the value for Calendar db name on remote server is the one that you used for the config-mysql -c command.
If current deployment is using Oracle Database, you are prompted for the following information:
Remote database server host name Remote database server port Oracle database service name on remote server Calendar db user name Calendar db user password Verifying the database input... Database input is verified Backend identifier for the remote db Document store directory (leave blank if store is remote) Document store host (leave blank if store is local) Document store port (leave blank if store local) Application Server admin user password
Make sure the value for Calendar db user name is the one that you used for the config-oracle -c command.
Enter Y when prompted to perform the tasks for creating the JDBC connection pool and resource, and davserver back-end identifier.
The system responds that the database back-end configuration is configured successfully.
On each front-end host, enable Connection Validation for the connection pools (both CalDav back-end and iSchedule pools) so that Calendar Server automatically reconnects to the back-end database if it goes down:
In the GlassFish Server Administration Console, select Resources, then JDBC, then Connection Pools.
Select the pool.
Check the Required box for Connection Validation.
Select table for the Validation Method.
Enter DUAL for Table Name.
Click Save.
Click the Advanced tab.
Enter 60 for Validate Atmost Once.
Click Save.
This configuration then issues the command select count(*) from DUAL; on every connection, at most one time every 60 seconds. (If the connection is not being used, it is not checked.)
Note:
Use these settings as a starting point and adjust where necessary. For example, if validation is not important, you can turn it off. Additionally, you might want to adjust the "Validate At Most Once" time duration or validate each time a connection is requested (by setting the value to 0). HA deployments might also use different values.Restart GlassFish Server.
Provision accounts for a multiple back-end deployment.
See "Provisioning Calendar Accounts in a Multiple Back-End Deployment".
Note:
If you use WebLogic Server, see "Installing and Configuring Multiple Calendar Server Back-End Hosts for WebLogic Server Manually" for more information.The Calendar Server init-config script creates the JDBC connection pool and resource, and adds the information to the davserver.properties file, for the one back-end host specified during the front-end configuration. The JDBC resource used is defaultbackend.
If you must change this JDBC resource, to match other naming conventions, follow these steps:
On each front-end the application server, create a JDBC resource associated with the caldavPool connection Pool.
For example, you might use db1 as the resource name.
Save this change and then restart the application server.
Add the following two lines to each davserver.properties file.
store.dav.db1.backendid=JDBC resource store.dav.db1.jndiname=jdbc/JDBC resource
For example, if your resource name is db1, then you would add:
store.dav.db1.backendid=db1 store.dav.db1.jndiname=jdbc/db1
The new resource name can be used in davstore attribute values.
Note:
Once your Calendar Server deployment is up and running, do not change the user back-end ID as defined by the davStore attribute.For calendar accounts to know which back-end host they should connect to, you must provision accounts with the davstore attribute. The davStore attribute indicates the back-end host that stores a user's data if the deployment is configured for multiple back-end hosts. For more information, see the topic on Calendar Server and Directory Server integration in Calendar Server Concepts.
The following examples apply only to Calendar Server 7 and Calendar Server 7 Update 1. Starting with Calendar Server 7 Update 2, this process is automated by the config-backend script.
This section contains the following topics:
Using the GlassFish Server Administration Console to Create a Connection Pool
Using the Command Line to Create a Connection Pool for Non-Default Back-End Hosts
This example uses the GlassFish Server Administration Console to create a connection pool caldav1Pool and JDBC resource jbc/backend1, and to enable Connection Validation.
Select New and enter the following information.
Name: caldav1Pool
Resource Type: javax.sql.DataSource
Database Vendor: MySQL
Click Next.
Set the following properties and be sure that the URL property is either not set or set correctly.
You can also delete all the default properties and keep just the following six properties.
databaseName: caldav1
portNumber: 3306
networkProtocol: jdbc
serverName: localhost (or your MySQL server host name)
user: mysql
password: mysql
Click Save.
Select the pool and use the Ping button to test the pool.
If ping was not successful, you can delete all the default properties and keep just the six properties previously mentioned. Then retry the ping.
Create JDBC resource for the connection pool.
Select JDBC from Resources, then JDBC Resources.
Select New and enter the following information:
JDNI Name: jdbc/backend1
Pool Name: caldav1Pool
Status: check Enabled
Enable Connection Validation for the connection pool:
In the GlassFish Server Administration Console, select Resources, then JDBC, then Connection Pools.
Select caldav1Pool.
Check the Required box for Connection Validation.
Select table for the Validation Method.
Enter DUAL for Table Name.
Click Save.
Click the Advanced tab.
Enter 60 for Validate Atmost Once.
Click Save.
This example uses the command-line interface to create a connection pool caldav1Pool and JDBC resource jbc/backend1.
GlassFish_home/bin/asadmin create-jdbc-connection-pool --user admin --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource --restype javax.sql.DataSource --property "DatabaseName=caldav1:serverName=mysqlhost:user=caldav:password=mysqlpass:portNumber=3306:networkProtocol=jdbc" caldav1Pool GlassFish_home/bin/asadmin create-jdbc-resource --user admin --connectionpoolid caldav1Pool jdbc/backend1
To install and configure multiple Calendar Server back-end hosts for WebLogic Server manually, perform the following steps:
Install the database software on each back-end host. Choose one of the following:
Decide if you must create additional Oracle Database or MySQL Server back-end databases. If you have chosen MySQL, continue with this step. If you have chosen Oracle Database, skip to Step 3.
Note:
If the Calendar Server software is not installed on the back-end host, copy the config-mysql, config-oracle, and Util.pm scripts from an installed Calendar Server host and adjust the following path to those scripts accordingly.If this is the first database on the host, set up the instance, and create the user and database by running the following command:
Calendar_Home/tools/unsupported/bin/config-mysql -s -u -c
If there is a database on the host already, create the calendar database by running the following command:
Calendar_Home/tools/unsupported/bin/config-mysql -c
To create the Oracle database user and schema, see the following:
Collect the following details specific to your new database backend setup.
Frontend: host1.us.oracle.com: Calendar Server deployed on WebLogic Server exists on this host.
Database host: host2.us.oracle.com: Existing backend database in production. Currently, frontend Calendar Server on host1 is configured to the backend database.
New: Additional database to be added: host3.us.oracle.com: Required database (MySQL database or Oracle database) is setup on this machine. This is associated with identifier backend2.
Based on the above details, provide values for the following.
If you use MySQL database:
Remote database server host name= host3.us.oracle.com
Remote database server port= 3306
Calendar database name on remote server=caldav
Calendar database user name=mysql
Calendar database user password=mysql
Backend identifier for the remote database=backend2
Document store directory (leave blank if store is remote)= /var/opt/sun/comms/davserver/db/backend2
Document store host (leave blank if store is local)
Document store port (leave blank if store is local)
Application Server admin user password=adminpass (Front-end WebLogic Server Admin User password)
If you use Oracle database:
Remote database server host name=host3.us.oracle.com
Remote database server port = 1521
Oracle database service name on remote server=pdb2.us.oracle.com
Calendar database user name=csadmin
Calendar database user password= password
Backend identifier for the remote database= backend2
Document store directory= /var/opt/sun/comms/davserver/db/backend2
Note:
Do not provide any value if the document store directory is remote.Document store host
Note:
Do not provide any value if the document store host is local.Document store port
Note:
Do not provide any value if the document store port is local.Application Server administrator user password= adminpass
Note:
You should provide the front-end WebLogic Server Administration user password.Create JDBC Data Source using WebLogic Server Administrator Console on your frontend machine.
Log in to your front-end computer where Calendar Server is deployed on WebLogic Server. You must possess the WebLogic Server Administration credentials and have access to WebLogic Server Administration Console.
Based on the values you have gathered in step 4, proceed to enter the details.
Note:
The following WebLogic Administration Console screen options are provided based on WebLogic Server 12.2.1.3.Log in to WebLogic Server Administration Console on host1.us.oracle.com. For example, https://host1.us.oracle.com:7001/console
Click Lock & Edit.
Click your domain directory. For example, domain1.
Navigate to Services and then Data Sources.
Under the Configuration tab, click New.
Select Generic Data Source.
Enter the following details:
name: backend2
scope: global
JNDI Name: jdbc/backend2
If your database type is MySQL, select Database type: MySQL
Click Next.
Database Driver: Select MySQL's Driver (Type 4) Versions: using com.mysql.jdbc.jdbc2.optional.MySqlDataSource
Click Next.
You can leave the default values shown under the Transaction options.
Click Next.
Database Name: caldav.
Hostname=host3.us.oracle.com
port = 3306
Database User Name=mysql
password=mysql
confirm password=mysql
Click Next.
Ensure that the following is shown in URL=jdbc:mysql://host3.us.oracle.com:3306/caldav
Under Properties, (properties to pass to the JDBC driver when creating database connections), you can have the following: user=mysql, databaseName=caldav, characterEncoding=UTF8
Test table Name: SQL SELECT 1
Click Test Configuration.
The result must be Connection test succeeded.
Click Next.
If your database type is Oracle, select Database type: Oracle.
Click Next.
Database Driver: Select *Oracle's Driver (Thin) for Service connections; Versions:Any.
Click Next.
You can leave the default values shown under Transaction options.
Click Next.
Database Name: pdb2.in.oracle.com
Hostname=host3.us.oracle.com
port=1521
Database User Name=csadmin
password=password
confirm password=password
Click Next.
Ensure the URL is shown correctly as: URL=jdbc:oracle:thin:@//host3.us.oracle.com:1521/pdb2.in.oracle.com
Test table Name: SQL SELECT 1 FROM DUAL
Click Test Configuration.
The result must be Connection test succeeded.
Click Next.
Select the target server.
Note:
The target server must be your Managed Server. For example, server1. The selected target server must be the same target server that you had selected during the init-config setup on the front-end machine.Click Finish.
You can see the newly created backend2 in the list of Data Sources table.
Click Activate Changes.
Restart WebLogic Server.
Ensure that WebLogic Admin or Managed Server log file does not contain any errors.
Run davadmin backend create where a new resource is created. For example, backend2.
Log in to your front-end host where the Calendar Server is set up. For example, host1.us.oracle.com.
Navigate to the CalendarServer_home/sbin directory where davadmin CLI tool is residing. For example, /opt/sun/comms/davserver/sbin/davadmin.
Run the davadmin command:
/opt/sun/comms/davserver/sbin/davadmin backend create -u weblogic_adminuser -n newbackend_identifier -j newbackend_JNDIName -d local_documentstorepath
For example,
/opt/sun/comms/davserver/sbin/davadmin backend create -u weblogic -n backend2 -j "jdbc/backend2" -d "/var/opt/sun/comms/davserver/db/backend2"
Run the following CLI command and verify the created backend details by checking the store.dav.xx parameters that are listed:
/opt/sun/comms/davserver/sbin/davadmin config list
When you run the above command, the list must contain the following:
store.dav.backend2.jndiname=jdbc/backend2
store.dav.backend2.dbdir=/var/opt/sun/comms/davserver/db/backend2
store.dav.backend2.attachstorehost=
store.dav.backend2.attachstoreport=8008
store.dav.backend2.backendid=backend2
store.dav.backend2.purgedelay=2592000
Provision accounts for a multiple back-end deployment.
See "Provisioning Calendar Accounts in a Multiple Back-End Deployment".
When you deploy Calendar Server in a multiple back-end host configuration, the information flow for a user login is as follows.
The user logs in to Calendar Server.
The user's davstore LDAP attribute is read, indicating the back-end database with which the user is associated.
The davstore attribute is mapped to one of the store.dav.xx.backendid values in the Calendar Server davserver.properties file.
The corresponding JNDI name (store.dav.xx.jndiname) is obtained.
This points to a JDBC Resource associated with the back-end database.
The JDBC Resource points one of the JDBC Connection pools.
The user gets a Calendar Server database connection.
For example, assume that user1 has a davstore attribute set to backend1. This would be mapped to the following backendid values:
store.dav.backend1.backendid=backend1 store.dav.backend1.jndiname=jdbc/backend1
The JNDI name would be obtained from:
store.dav.backend1.jndiname=jdbc/backend1
This, in turn, resolves to the following JDBC Resource:
Name=jdbc/backend1 ConnectionPool=caldav1Pool
Next, the following JDBC Connection pool is obtained:
ConnectionPool=caldav1Pool Name=caldav1Pool DB=jdbc:mysql://dbhost.example.com:3306/caldav1
Finally, user1 is given a connection to the back-end host with the caldav1 database.