Using DBMoto 7 in a Microsoft Windows Cluster
Copyright This document is copyrighted and protected by worldwide copyright laws and treaty provisions. No portion of this documentation may be distributed or reproduced by any means, or in any form, without HiT Software's prior written permission. COPYRIGHT NOTICE: Copyright 2010 HiT Software, Inc., A BackOffice Associates, LLC Company. All Rights Reserved. Disclaimer Information in these HTML documents is subject to change without notice. Although efforts have been made to ensure the accuracy of these documents, HiT Software, Inc. assumes no responsibility for damages incurred directly or indirectly from errors, omissions, and discrepancies between the software and the documents. If you find any problems in the documentation, please report them to HiT Software, Inc. Trademarks HiT Software, DBMoto and Ritmo are registered trademarks or trademarks of HiT Software, Inc. All other marks are used for the benefit of their respective owners and HiT Software, Inc. disclaims any interest in such marks. Contact Information HiT Software, Inc. Tel. +1-408-345-4001 Fax +1-408-345-4899 Electronic mail: info@hitsw.com Web site: www.hitsw.com HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 2
Introduction DBMoto offers an environment to replicate relational data between all major relational databases. The product must be installed on a Microsoft Windows system, but can replicate data from any major database (including IBM DB2, Oracle, MySQL) running on any platform to any major database. DBMoto can be installed and used in a Microsoft Windows Cluster environment where a a group of two or more physically separated servers are running MSCS (Microsoft Cluster Server) and serving collectively as a single failover system. The combined use of DBMoto with Microsoft Windows Cluster Server offers a robust failover solution for environments where data must be replicated to users at all times. A standard installation of DBMoto in a non-cluster environment offers some recovery features. For example, when the source or target database becomes unavailable for some reason, DBMoto automatically attempts to reconnect to the unavailable database. However, in environments where true failover capabilities are required, HiT Software recommends using DBMoto with Microsoft Windows Cluster Service. Configuration In the step by step example below, the configuration consists of a Microsoft Windows (2003 Enterprise Edition) Cluster with 2 Servers, each running Cluster Service version 5.2. The.NET Framework version is 3.5 (2.0 SP2 or above is required for DBMoto 7.) In addition, SQL Server 2005 (cluster-aware) is installed on each node, with a SQL Network Name established. One node is designated as the active node. The nodes use a common shared drive where the DBMoto Metadata database will be installed. When the active cluster node is down for any reason, the passive node becomes the new active node, accessing the DBMoto Metadata on the common drive. NOTE: This example uses Microsoft SQL Server as the metadata database, but any database supported by DBMoto can be used (except IBM DB2 for i and IBM DB2 for z/os.) HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 3
The overall installation and setup approach for DBMoto is to: Install DBMoto on all cluster nodes. On the active cluster node, set up the metadata on a common drive outside the cluster and set this as the default metadata. Set up and test replications on the active cluster node. On remaining cluster nodes, point to the existing metadata and set it as the default metadata. Create and activate the cluster resources for DBMoto. Test the failover process. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 4
Installating DBMoto in a Windows Cluster Environment 1. For each system in the cluster, install a Windows Server Operating System that supports Failover Clusters as described in your Microsoft Windows documentation. 2. Install Microsoft SQL Server on each cluster node. Microsoft SQL Server is cluster-aware and can be configured to operate correctly in a Windows cluster environment. 3. Create a SQL Server database on a disk that is common to both cluster nodes and outside the cluster so that when one node goes down, the failover node can access the database on the accessible disk. Your DBMoto metadata tables will be created in this database. 4. Install DBMoto 7 on each system, making sure to install DBMoto Replicator as a service. Setting Up Metadata on the Active Cluster Node 1. Run the DBMoto Management Center on the active cluster node. 2. Expand the tree in the Metadata Explorer to view the local node. 3. From the right mouse button menu, choose Add New Metadata. 4. In the Metadata Connection wizard, type a name for the new metadata. 5. In the Data Provider area, choose Microsoft SQL Server (not SQL Server CE) as the database. The Provider field is adjusted for you, and you do not need to enter a value in the Assembly field. 6. Click Next. 7. In the Data Source field, enter the SQL Network Name or IP address of the SQL Server installed on the cluster. 8. Type a user ID and password. 9. Click Test to test the connection. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 5
10. Click Next. 11. Select the name of the database you created on the cluster common disk. 12. Select the database owner name. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 6
13. Click Next. 14. Select the appropriate option for metadata creation. If you are installing DBMoto for the first time and do not have an existing metadata you want to use, select Create a new metadata database. 15. Complete the wizard. 16. In the Management Center Metadata Explorer, select the metadata that you have just created and, from the right mouse button menu, select Set as Default. This operation ensures that the newly created metadata will be used by the DBMoto Replicator. You have now created the metadata tables in the common database. Later, you will create a metadata connection on the passive node which points to the same metadata tables. Setting Up Replications on the Active Cluster Node You can now set up your replication(s) in the DBMoto Management Center according to instructions in the DBMoto User s Guide (available from the Windows Start menu, or from the Help menu in the DBMoto Management Center.) Test the replication(s) as follows. 1. Check that the DBMoto Server Agent service is running. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 7
In the Windows Notification Area, look for the DBMoto Service Monitor icon: DBMoto Service Monitor with Server Agent stopped. From the right mouse button, choose DBMoto Server Agent, then Start, then Service. DBMoto Service Monitor with Server Agent started If the DBMoto Service Monitor icon is not available, from the Windows Start menu, choose All Programs, then HiT Software DBMoto V7, then DBMoto Service Monitor. Start the DBReplicator Service. From the DBMoto Service Monitor, choose DBMoto Data Replicator, then Start, then Service. 2. In the DBMoto Management Center, make sure that the replications are enabled. Replications are enabled on creation by default, but if you think you may have disabled this option, expand the metadata and Replications nodes, then for each replication, make sure the Enable Replication item is checked on the right mouse button menu. 3. Check replication progress using the Replication Monitor in the DBMoto Management Center. Click in the toolbar, or, from the View menu, choose Replication Monitor. Note that DBMoto automatically records replication details and issues in the DBMoto log, a text file located in the Log folder in your DBMoto installation folder. Because DBMoto is being used in a cluster environment, you may want to set up the log in a location that is common to all nodes in the cluster (e.g. on the same disk as the metadata database.) You can do this by setting up the log as a database rather than a text file, and use the metadata database to keep the log data. Setting Up a Log Database 1. In the DBMoto Management Center Metadata Explorer, select the server (most likely labeled local.) From the right mouse button menu, choose Data Replicator Options. 2. In the Data Replicator Options dialog, choose the Log tab. 3. Select the Database option. 4. Either leave the default option to use the metadata database for log details, or set up a connection to an alternative database. 5. Click OK to complete the changes. DBMoto provides a Log Viewer to access the contents of the log. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 8
6. In the Metadata Explorer, select the metadata. From the right mouse button menu, choose View Log to open the Log Viewer tab in the right pane of the Management Center. Setting Up DBMoto on Passive Cluster Nodes 1. Start the DBMoto Management Center on the passive cluster node. 2. Expand the tree in the Metadata Explorer to view the local node. 3. From the right mouse button menu, choose Add New Metadata. 4. Follow the steps the Metadata Connection wizard to connect to the database where you created the metadata for the active cluster node. 5. In the Define Metadata screen, select the Open existing metadata database option. 6. Complete the wizard. 7. In the Management Center Metadata Explorer, select the metadata that you have just created and, from the right mouse button menu, select Set as Default. This operation ensures that the newly created metadata will be used by the DBMoto Replicator. 8. Close the DBMoto Management Center. Setting Up the Cluster Resources To ensure that DBMoto restarts successfully in a failover situation, you need to specify which services should be started when the failed node is restarted. DBMoto has two critical services: the DBMoto Server Agent (DBMAgent.exe) and the DBMoto Replicator (DBReplicator.exe). These services are represented as cluster resources in the Cluster Administrator. DBMoto Server Agent Resource 1. On the active node, open the Windows Cluster Administrator application. 2. In the Cluster Administrator window, choose Resources, then New, then Resource. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 9
3. In the New Resource wizard, type the name of the cluster resource as you want it to appear in the Cluster Administrator. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 10
4. Add a description if desired. 5. From the Resource Type drop-down list, choose Generic Service. 6. In the Group field, choose the group that contains all the resources on which the DBMoto services depend. A resource and its dependencies must be together in a single group. These services are: SQL IP Address SQL Network Name SQL Server SQL Server Agent SQL Server FullText 7. Click Next. 8. In the Possible Owners screen, make sure that all the nodes in the environment are listed as possible owners. 9. Click Next to display the Dependencies screen. You need to specify the services/applications upon which the DBMoto Server Agent resource depends. Select all the SQL Server services. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 11
10. Click Next to display the Generic Service Parameters screen. 11. In the service name field, type DBMAgentSrv. This is the name of the DBMot Server Agent service. 12. Type auto in the Start Parameters field to ensure that the services are started automatically after a failover. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 12
13. Click Next to display the Registry Replication screen. DBMoto does not use the Windows Registry to store information so you do not need to enter a value in this screen. 14. Click Finish to complete the creation of the DBMoto Server Agent resource. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 13
DBMoto Replicator Resource 1. To create the DBMoto Replicator resource, in the Cluster Administrator, choose Resources, then New, then Resource. 2. In the New Resource wizard, type the name of the cluster resource as you want it to appear in the Cluster Administrator. 3. Add a description if desired. 4. From the Resource Type drop-down list, choose Generic Service. 5. In the Group field, choose the group that contains all the resources on which the DBMoto services depend. A resource and its dependencies must be together in a single group. SQL IP Address SQL Network Name SQL Server SQL Server Agent SQL Server FullText DBMoto Server Agent 6. Click Next. 7. In the Possible Owners screen, make sure that all the nodes in the environment are listed as possible owners. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 14
8. Click Next to display the Dependencies screen. You need to specify the services/applications upon which the DBMoto Replicator resource depends. Select all the SQL Server services, plus the DBMoto Server Agent service. 9. Click Next to display the Generic Service Parameters screen. 10. Type DBMotoSrv. This is the name of the DBMoto Data Replicator Service. 11. Type auto in the Start Parameters field to ensure that the services are started automatically after a failover. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 15
12. Click Next to display the Registry Replication screen. DBMoto does not use the Windows Registry to store information so you do not need to enter a value in this screen. 13. Click Finish to complete the creation of the DBMoto Replicator resource. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 16
14. In the Cluster Administrator, verify that the two DBMoto resources have been created by expanding the Groups node to display the group where you created the resources. 15. Click on the group name to display the group resources in the right-hand pane. You should see the two DBMoto resources in addition to the SQL Server resources on which they depend. 16. In the Cluster Administrator, bring the DBMoto Agent Service and DBMoto Data Replicator resources online. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 17
Testing the Failover Behavior 1. In the Cluster Administrator, select the active cluster node. 2. From the right mouse button menu, choose Stop Cluster Service. The cluster service should stop on that node, but start up on the backup node. You can use the Cluster Administrator to view the status of groups and resources on each node. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 18
Potential Issues DBMoto stores all the replication status information in the Metadata, which is available to either server in the cluster in case of failure of one of the servers. When failure occurs, replication is switched to the other server in the cluster and the Cluster Server Manager takes care of restarting the failed server, including an automatic restart of the DBMoto Replicator service. The DBMoto Replicator service uses the information stored in the independent Metadata to identify the current status and is typically able to resume replications without difficulty. However, certain conditions that require special handling can occur: If the DBMoto engine happens to shut down while in the middle of a mirroring replication, it might not be able to save the last transaction ID into the metadata. This could cause the same transaction to be processed again by the second server. An error message would be generated in the DBMoto log. Some conditions (such as the status of recovery of a replication, or a refresh recovery point if interrupted during a refresh) are not saved in the metadata. Such conditions would not prevent continued operation of DBMoto, but may cause the replication to restart. HiT Software, Inc., A Back Office Associates, LLC Company Copyright 2010 19