Customer Service: 425-487-1515 Technical Support: 425-951-3390 Fax: 425-487-2288 Email: info@teltone.com support@teltone.com Website: www.teltone.com Application Note 116: Gauntlet System High Availability Using Replication Overview Ensuring the high availability of a Gauntlet system can be accomplished using several methods: Data backup and restore Disk mirror or RAID Database replication Clustering This document describes using SQL Server transactional replication to provide a cost-effective and robust solution. Although replication requires a minimum of two servers with Microsoft SQL Server 2000 software, the duplicate database is updated in near real-time, bandwidth requirements are low, and, if the source database fails or is unavailable, an administrator can switch to the duplicate relatively quickly. If the two servers are located in different areas, replication also provides business continuity during natural and other disasters. In essence, transactional replication ensures that all changes to the source database are also copied to a duplicate database. Once the transactional replication is set up, the duplicate database is updated whenever a change is made to the source. The Microsoft SQL Server replication process uses the publishing industry as a metaphor, where the source server is a publisher and distributor and the duplicate server is a subscriber. The transactional replication setup, described in this document, uses two servers: one for the source database publisher and distributor and a second for the subscriber with subscription to the distributor (see Figure 1). Data is pushed from the distributor to the subscriber as Gauntlet administrators make changes to the source CCC database via the CCC web application. More than one subscriber may be configured in a system, but in this document, we use only one. 40-405-00116, Rev. A Page 1 of 20
Source CCC Database Server CCC Web Application Publication Database Publisher Duplicate of Source CCC Database Server Subscription Database Subscriber CCC Server (TSTFMDIST) Snapshot Agent Distributor Snapshot Folder Distribution Database Push Agent CCC Server (TSTTOREPL) Figure 1. Transactional Replication Diagram The publisher contains publication(s), which are collections of one or more articles sent to a subscriber database via the distributor. An article, the basic unit of replication, can be a database table or a subset of a table. The distributor manages the flow of data through the replication system and contains the distribution database. The subscriber receives data from another database. A subscription, which can be to one or more publications, is the data that a subscriber receives. With a push subscription, the distributor sends transactions to the subscriber. Other methods of data distribution are available, but this application note only covers the push subscription method. About This Application Note This application note provides Gauntlet-specific instructions for setting up SQL Server transactional replication to maintain system high availability. This document is intended for personnel with network administration, SQL database management, and Gauntlet system administration experience. Ideally, the same IT administrator installs and sets up both SQL Server and Gauntlet CCC software. 40-405-00116, Rev. A Page 2 of 20
Requirements Getting Additional Information For general information about Microsoft SQL Server and replication, please refer to the Microsoft SQL Server documentation, Help topics, and online information at www.microsoft.com. If you have Gauntlet-related problems, please contact Teltone technical support at 425-951-3390 or send an email to support@teltone.com. Hardware A minimum of two CCC servers. For CCC server hardware requirements, see the Gauntlet System Installation Manual. Replication additionally requires: Hard drive space for each published database Software Preparing Two Servers For CCC server basic software requirements, see the Gauntlet System Installation Manual. Replication additionally requires: Windows Server 2003 Enterprise Edition or Standard Edition (Windows Small Business Server 2003 is not supported.) Microsoft SQL Server 2000. Transactional replication is a standard component of all editions of SQL Server 2000. (MSDE is not supported.) Important: Only members of the system domain administration role can set up and configure replication. If you do not have these rights, you cannot set up replication. For these instructions, the examples use a server named TSTTOREPL (the test database to replicate) as the primary server and configure it as publisher and distributor. The examples use a server named TSTFMDIST (the test database from the distributor) as the secondary server and configure it as the subscriber to the publication located on the publisher (see Figure 1). Set up two identical servers: one will host the primary database accessed by Gauntlet administrators, and the other will be the subscriber. 40-405-00116, Rev. A Page 3 of 20
For each server: 1. Before installing the CCC software (see the Gauntlet System Installation manual), follow the steps below to install Microsoft SQL Server 2000. 2. Create a folder at the root and name it C:\Gauntlet. The default instance of SQL Server must be in this location for the Gauntlet CCC software to find it. 3. Install SQL Server and set it up for mixed authentication (Windows and SQL). Note the system administrator (sa) password used during SQL installation. This password will be needed during the Gauntlet CCC software installation. 4. After installation, verify that you see C:\Gauntlet\MSSQL$Gauntlet. After completing the above steps on both servers: 1. Open SQL Server Enterprise Manager, and register both servers so that both are visible from either server. 2. Verify that you can connect from one server to the other within SQL Server (see Troubleshooting, page 20). Without verified connectivity, replication will not work properly. 3. For both servers, follow the instructions for installing the CCC software in the Gauntlet System Installation manual. When entering the Strong Sys Admin Password during CCC installation, enter the SQL Server sa password defined previously. If the sa password does not match, Gauntlet administrators will not be able to change the SQL database. 4. Verify that SQL Server and Gauntlet CCC are up and running on both servers before starting the replication setup. 5. Open Microsoft Internet Explorer and connect to the CCC URL. If successful, the CCC login page is displayed. Resolve any error messages before continuing. Transactional Replication Setup The following instructions guide you through: Creating a new remote server to be the secondary database Creating a primary SQL server publisher and distributor Creating publications Creating a new push subscription Testing your setup 40-405-00116, Rev. A Page 4 of 20
The following example screen captures are from a Windows XP operating system. Creating a New Remote Server To start, on the primary server, open SQL Server Enterprise Manager by clicking Start > All Programs > Microsoft SQL Server > Enterprise Manager. Navigate to the TSTTOREPL\Gauntlet server and expand the Security folder. Remote servers are listed in the right-hand pane. Select remote servers and right-click. On the shortcut menu, select New Remote Server. Enter the remote server name. In this example, it is TSTFMDIST\GAUNTLET. Select RPC. Leave remote login mappings default option, Same Name, selected. Click OK. The new remote server is listed in the righthand pane. 40-405-00116, Rev. A Page 5 of 20
Configuring a Publisher and Distributor In SQL Server Enterprise Manager, navigate to the TSTTOREPL\Gauntlet server. Select Replication. Right-click the Replication folder. On the shortcut menu, select Configure Publishing, Subscribers and Distribution. Leave the default option, Make <server name> its own distributor, selected. 40-405-00116, Rev. A Page 6 of 20
Leave the default option, Yes, configure the SQL Server Agent service to start automatically, selected. Leave the default network path to the snapshot folder. Click Yes. Leave the default option, No, use the following default settings, selected. 40-405-00116, Rev. A Page 7 of 20
Click Finish. A message box indicates the distributor has successfully been enabled. Click OK. Click Close. If this warning is displayed, click Yes. 40-405-00116, Rev. A Page 8 of 20
Leave the default option, No, I will manually refresh, selected. Note that the Replication Monitor has now been added to the distributor server. 40-405-00116, Rev. A Page 9 of 20
Creating and Managing Publications From SQL Enterprise Manager toolbar, select Tools > Wizards. Expand Replication. Select Create Publication Wizard. use new shot with correct stuff highlighted. Click OK. As the publisher database, select ccc. Click Create Publication. 40-405-00116, Rev. A Page 10 of 20
Verify that ccc is selected. Select Transactional Publication. Select the types of subscribers for this publication. In this example, leave the default option, Servers running SQL Server 2000, selected. 40-405-00116, Rev. A Page 11 of 20
For the Tables and Views object types, select Show and Publish. Select Show unpublished objects. An Article Issues message window is displayed. Note that only one issue, Tables referenced by views are required, should be displayed. Enter a publication name. In this example, the publication name was changed from ccc to Gauntlet ccc Publication. 40-405-00116, Rev. A Page 12 of 20
Leave the default option, No, selected. To create the publication, click Finish. A progress screen is displayed. The pointer moves down the list until all items are completed. Click Close. 40-405-00116, Rev. A Page 13 of 20
Creating a New Push Subscription Click Push New Subscription. Expand SQL Server Group and select the subscriber database. 40-405-00116, Rev. A Page 14 of 20
Verify that CCC is selected. Leave the default option, Continuously, selected. Leave the default option Yes, initialize the schema and data selected. Select Start the Snapshot Agent 40-405-00116, Rev. A Page 15 of 20
Leave the default option, SQL Server Agent, selected. Verify the details (subscription to TSTTOREPL\Gauntlet publisher from TSTFMDIST\Gauntlet subscriber). Click Finish A progress screen is displayed. The pointer moves down the list until all items are completed. 40-405-00116, Rev. A Page 16 of 20
Upon completion, a message window indicates that subscriptions were successfully created at the following subscriber: TSTFMDIST\Gauntlet. Click Close. Click Close. This completes the setup of the transactional replication. However, it is recommended that you test your setup as described next. Testing To verify that the subscription has been created, open Microsoft SQL Server Enterprise Manager and navigate to the TSTFMDIST\Gauntlet server. Expand the Replication folder and select Subscriptions. Click Refresh. A subscription named TSTTOREPL\Gauntlet:ccc is displayed in the right-hand pane, along with the name of the database and other related information. 40-405-00116, Rev. A Page 17 of 20
To further test the subscription, you can check recent activity in the CCC log. Navigate to TSTFMDIST\Gauntlet\Databases\ccc\Tables. The tables in the CCC database are displayed in the right-hand pane. Select the CCC_LOG table and right-click. From the shortcut menu, select Open Table > Returns All Rows. Recent changes to the primary CCC database should be displayed in this view of the subscriber database. 40-405-00116, Rev. A Page 18 of 20
To verify that changes to the primary database are replicated in the subscriber database, add a calling user to the CCC database and then check that the user has been added to the subscriber database. For example, log in to CCC and create a new calling user, with a login ID of Jack_Flash. Navigate to TSTFMDIST\Gauntlet\Databases\ccc\Tables again. Open the CCC_LOG table. The addition of user Jack_Flash is the last event. This completes the testing of your transactional replication setup. Primary CCC Database Failure (Changing Roles) If a failure occurs and the publisher database is no longer available, use one of the following approaches to provide access to the subscriber database: Change the subscriber server s name and IP address to those of the publisher server. or Change your network s DNS settings to resolve to the subscriber server. Note that the subscriber database will have the last information prior to the failure of the publisher server. If repairing the failed publisher server takes an extended period of time, you should set up a new transactional replication from the subscriber server (making it a new publisher) to a third server (making it a new subscriber) until the repairs are completed. 40-405-00116, Rev. A Page 19 of 20
Troubleshooting Most problems experienced while setting up replication are related to account access rights, naming details, and connectivity (or the lack thereof) between the SQL publisher/distributor and subscriber. To verify connectivity in SQL: 1. On the publisher server, open Microsoft SQL Server Enterprise Manager. 2. Expand Microsoft SQL Servers and SQL Server Group to show all servers. 3. Right-click the subscriber server and select Connect. Successful connection is indicated by the server s arrow indicator changing from no color to green. No alarms or warnings should be generated as a result of this action. 40-405-00116, Rev. A Page 20 of 20