6 Configuring Calendar Server with Multiple Hosts

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".

About Installing and Configuring Multiple Calendar Server Back-End Hosts

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:

  1. Installing, configuring, and preparing the new database

  2. Gathering the database host names, ports, and other database names

  3. Installing all front-end hosts, if not already done

  4. 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".

  5. 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.
  6. Enabling connection pool validation on each front-end host.

    Note:

    This step is applicable only for GlassFish Server.
  7. 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.

Installing and Configuring Multiple Calendar Server Back-End Hosts for GlassFish Server

To install and configure multiple Calendar Server back-end hosts for GlassFish Server:

  1. Install the database software on each back-end host. Choose one of the following:

  2. 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
      
  3. To create the Oracle database user and schema, see the following:

  4. 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.

  5. 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.

  6. 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:

    1. In the GlassFish Server Administration Console, select Resources, then JDBC, then Connection Pools.

    2. Select the pool.

    3. Check the Required box for Connection Validation.

    4. Select table for the Validation Method.

    5. Enter DUAL for Table Name.

    6. Click Save.

    7. Click the Advanced tab.

    8. Enter 60 for Validate Atmost Once.

    9. 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.
  7. Restart GlassFish Server.

  8. Provision accounts for a multiple back-end deployment.

    See "Provisioning Calendar Accounts in a Multiple Back-End Deployment".

Renaming the Default Calendar Server Back-End Host

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:

  1. 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.

  2. Save this change and then restart the application server.

  3. 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.

Provisioning Calendar Accounts in a Multiple Back-End Deployment

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.

Examples: Creating Pools and Resources for Calendar Server Back-End Hosts Using GlassFish Server

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

This example uses the GlassFish Server Administration Console to create a connection pool caldav1Pool and JDBC resource jbc/backend1, and to enable Connection Validation.

  1. Select New and enter the following information.

    • Name: caldav1Pool

    • Resource Type: javax.sql.DataSource

    • Database Vendor: MySQL

  2. Click Next.

  3. 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

  4. Click Save.

  5. 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.

  6. Create JDBC resource for the connection pool.

    Select JDBC from Resources, then JDBC Resources.

  7. Select New and enter the following information:

    • JDNI Name: jdbc/backend1

    • Pool Name: caldav1Pool

    • Status: check Enabled

  8. Enable Connection Validation for the connection pool:

    1. In the GlassFish Server Administration Console, select Resources, then JDBC, then Connection Pools.

    2. Select caldav1Pool.

    3. Check the Required box for Connection Validation.

    4. Select table for the Validation Method.

    5. Enter DUAL for Table Name.

    6. Click Save.

    7. Click the Advanced tab.

    8. Enter 60 for Validate Atmost Once.

    9. Click Save.

Using the Command Line to Create a Connection Pool for Non-Default Back-End Hosts

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 

Installing and Configuring Multiple Calendar Server Back-End Hosts for WebLogic Server Manually

To install and configure multiple Calendar Server back-end hosts for WebLogic Server manually, perform the following steps:

  1. Install the database software on each back-end host. Choose one of the following:

  2. 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
      
  3. To create the Oracle database user and schema, see the following:

  4. 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.
  5. 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.
  6. Log in to WebLogic Server Administration Console on host1.us.oracle.com. For example, https://host1.us.oracle.com:7001/console

  7. Click Lock & Edit.

  8. Click your domain directory. For example, domain1.

  9. Navigate to Services and then Data Sources.

  10. Under the Configuration tab, click New.

  11. Select Generic Data Source.

  12. Enter the following details:

    • name: backend2

    • scope: global

    • JNDI Name: jdbc/backend2

    • If your database type is MySQL, select Database type: MySQL

      1. Click Next.

      2. Database Driver: Select MySQL's Driver (Type 4) Versions: using com.mysql.jdbc.jdbc2.optional.MySqlDataSource

      3. Click Next.

        You can leave the default values shown under the Transaction options.

      4. Click Next.

      5. Database Name: caldav.

      6. Hostname=host3.us.oracle.com

      7. port = 3306

      8. Database User Name=mysql

      9. password=mysql

      10. confirm password=mysql

      11. Click Next.

      12. Ensure that the following is shown in URL=jdbc:mysql://host3.us.oracle.com:3306/caldav

      13. Under Properties, (properties to pass to the JDBC driver when creating database connections), you can have the following: user=mysql, databaseName=caldav, characterEncoding=UTF8

      14. Test table Name: SQL SELECT 1

      15. Click Test Configuration.

        The result must be Connection test succeeded.

      16. Click Next.

    • If your database type is Oracle, select Database type: Oracle.

      1. Click Next.

      2. Database Driver: Select *Oracle's Driver (Thin) for Service connections; Versions:Any.

      3. Click Next.

      4. You can leave the default values shown under Transaction options.

      5. Click Next.

      6. Database Name: pdb2.in.oracle.com

      7. Hostname=host3.us.oracle.com

      8. port=1521

      9. Database User Name=csadmin

      10. password=password

      11. confirm password=password

      12. Click Next.

      13. Ensure the URL is shown correctly as: URL=jdbc:oracle:thin:@//host3.us.oracle.com:1521/pdb2.in.oracle.com

      14. Test table Name: SQL SELECT 1 FROM DUAL

      15. Click Test Configuration.

        The result must be Connection test succeeded.

      16. Click Next.

  13. 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.
  14. Click Finish.

    You can see the newly created backend2 in the list of Data Sources table.

  15. Click Activate Changes.

  16. Restart WebLogic Server.

    Ensure that WebLogic Admin or Managed Server log file does not contain any errors.

  17. Run davadmin backend create where a new resource is created. For example, backend2.

  18. Log in to your front-end host where the Calendar Server is set up. For example, host1.us.oracle.com.

  19. Navigate to the CalendarServer_home/sbin directory where davadmin CLI tool is residing. For example, /opt/sun/comms/davserver/sbin/davadmin.

  20. 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"
    
  21. 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

  22. Provision accounts for a multiple back-end deployment.

    See "Provisioning Calendar Accounts in a Multiple Back-End Deployment".

User Login in a Multiple Back-End Host Deployment

When you deploy Calendar Server in a multiple back-end host configuration, the information flow for a user login is as follows.

  1. The user logs in to Calendar Server.

  2. The user's davstore LDAP attribute is read, indicating the back-end database with which the user is associated.

  3. The davstore attribute is mapped to one of the store.dav.xx.backendid values in the Calendar Server davserver.properties file.

  4. The corresponding JNDI name (store.dav.xx.jndiname) is obtained.

  5. This points to a JDBC Resource associated with the back-end database.

  6. The JDBC Resource points one of the JDBC Connection pools.

  7. 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.