HVR for Azure. Getting Started

HVR for Azure Getting Started Contents Introduction ...................................................................................................
Author: Imogen McKenzie
8 downloads 0 Views 2MB Size
HVR for Azure Getting Started

Contents Introduction .................................................................................................................................................. 3 HVR Image for Azure ................................................................................................................................. 3 On-premises Hub ...................................................................................................................................... 4 Getting started .............................................................................................................................................. 4 Step 1: Setting up HVR Image in Azure ......................................................................................................... 4 Step 2: Setting up your on-premises Hub & Source databases .................................................................... 9 Optional step: Create source tables using demo channel definitions .................................................... 10 Step 3: Install HVR on-premises .................................................................................................................. 10 First start of HVR ..................................................................................................................................... 11 Step 4: Create source location .................................................................................................................... 12 Step 5: Create target location (including target database) ........................................................................ 12 Step 6: Setting up your Replication Configuration (“Channel”).................................................................. 15 Location Groups ...................................................................................................................................... 15 Actions .................................................................................................................................................... 15 Tables ...................................................................................................................................................... 17 Step 7: Initialize the channel ....................................................................................................................... 17 Step 8: Perform Initial Load ........................................................................................................................ 18 Step 9: Starting the replication ................................................................................................................... 19 Step 10 (optional): Securing HVR communications with SSL ...................................................................... 21

Page 2 of 21

HVR for Azure Getting Started

Oct, 2016

Introduction HVR stands for High Volume Replicator. Our software offers real-time heterogeneous data replication software across platforms including Azure. With HVR you get everything you need for data replication including schema creation, initial data load, real-time change data capture and delivery, and compare/repair. A typical implementation requires an installation of the software on the source and on the target server.

HVR Image for Azure HVR for Microsoft Azure, available from the Azure marketplace, contains all necessary components to connect to Azure SQL and Microsoft SQL and Oracle, enabling replication from/into all supported onpremises platforms. With a few clicks, the Azure platform is ready to receive or send data through HVR.

The HVR image for Azure takes care of the firewall settings, necessary database drivers and required HVR components on Azure. Connecting from on-premises to Azure normally does not require any additional measures. Page 3 of 21

HVR for Azure Getting Started

Oct, 2016

On-premises Hub HVR uses a hub and spoke architecture. In an on-premises to cloud setup, the on-premises HVR installation will be nominated to be the hub. The hub share its installation with the source database or be installed on a separate server.

Getting started This Quick start guide explains the 9 easy steps required to get an HVR replication running starting from the installation of HVR on Azure and on-premises.

Step 1: Setting up HVR Image in Azure In the Azure portal, go to the Azure Marketplace, find and select “HVR for Azure” and press “Create”.

Page 4 of 21

HVR for Azure Getting Started

Oct, 2016

In step Basics: Select VM Disk type to be “HDD” as to be able to select the entry level machine types (A) in the next step. Enter the credentials you wish to use, select or create a resource group and determine the location you want HVR to run in (typically the same as your databases). Press “OK”.

Page 5 of 21

HVR for Azure Getting Started

Oct, 2016

In step Size: Select the appropriate machine type. Azure will suggest machine type A1, which is perfectly suitable to run the HVR Image for Azure. Press “Select”.

Page 6 of 21

HVR for Azure Getting Started

Oct, 2016

In step Settings, you will need to choose the storage account and network settings. Default Azure will create new ones. If this is your first time, the default settings are OK. Advanced users may want to reuse existing storage accounts and virtual networks. Press “OK”.

In step Summary, all your choices are listed for your reference. Press “OK”.

Page 7 of 21

HVR for Azure Getting Started

Oct, 2016

In step Buy, you will be shown the regular costs of the VM you are going to deploy. The HVR Software itself is priced €0.000, as the image does not contain a license. Press “Purchase”.

Page 8 of 21

HVR for Azure Getting Started

Oct, 2016

You will now see the VM image seeing deployed in the Marketplace. This will take a while. Once it is finished, the details of the created VM can be accessed in “Virtual Machines: in the portal.

Default, no DNS name is created for the IP address of the VM. To create a DNS name, go to “Virtual Networks” and select the network the VM was created in. You will see the IP resource used for the VM (default "VMname"-ip). When accessing its “Configuration”, you can enter a DNS name for your VM.

Step 2: Setting up your on-premises Hub & Source databases In this start guide we will assume a Windows hub with an SQL Server database for both the source and HVR catalogs. HVR supports numerous other OS-es and databases as well. Page 9 of 21

HVR for Azure Getting Started

Oct, 2016

The SQL server source database will probably exist, the hub database needs to be created. The same SQL server installation may be used for both, as the hub database is a minimal and static database holding only the catalogs. To use log based capture on your SQL server source database, make sure SQL server replication components are installed and run the SQL server “Configure Distribution Wizard” to create a distribution database. Though HVR uses its own log based capture methods, these components are necessary to be able to instantiate replication tasks on SQL server.

Optional step: Create source tables using demo channel definitions If you created an empty source database for your HVR POC, you need to populate it with tables. For a quick start, this HVR has included in the distribution several example replication setups, called “demo channels”. Please find them in the directory %HVR_HOME%\demo. Demo01 contains 2 tables, dm01_product and dm01_order, which can be loaded into your channel. You may do so by using the following script: C:\> cd %HVR_HOME%\demo\hvr_demo01\base\sqlserver C:\> osql –U hvr –P hvr –d testdb1 < hvr_demo01.cre C:\> osql –U hvr –P hvr –d testdb1 < hvr_demo01.mod

Step 3: Install HVR on-premises

You will have received instructions where to download the HVR installation files after registering on the HVR website info.hvr-software.com/azure-trial-request for Azure. Download the 64 bit windows installer Page 10 of 21

HVR for Azure Getting Started

Oct, 2016

( hvr xxxxx windows x64 64bit setup.exe) and run the HVR installer. Accept the defaults, check creation of the environment variables.

First start of HVR Start the HVR GUI by clicking its icon. On first start HVR will ask for the credentials of the hub database (“register hub”). Select SQL server as database type and enter the details for your hub database you just created. Leave “connect to HVR on a remote machine unchecked”. HVR will create the necessary tables in the database and be ready for use.

Page 11 of 21

HVR for Azure Getting Started

Oct, 2016

Step 4: Create source location To create a location for your on-premises source database, right click on location configuration and press new. The dialog for location properties appears. This database will probably be on the same server as your hub, so its location properties should look like this (enter the source database you created or an existing database).

Press Test to test if HVR can successfully connect to the database location.

Step 5: Create target location (including target database) On Azure, there needs to be a target database available. For convenience, let’s assume a Azure SQL database will be used. Create the database in the Azure portal (with a new or existing database server). Check the Azure SQL firewall configuration that it accepts connections from Azure resources (“Allow Access to Azure Services” )

Page 12 of 21

HVR for Azure Getting Started

Oct, 2016

In the HVR hub, create a location for your Azure database. This will be a remote location, so enter the Azure VM’s IP on node and its credentials:

Page 13 of 21

HVR for Azure Getting Started

Oct, 2016

Enter the Azure SQL database you just created and its corresponding database server. Make sure to append the username by the short database name separated with@ like in the example. Test your connections by pressing the test connection button:

Some common errors during connection test and their solution: F_JB0506: Connection attempt timed-out after 10 seconds : wrong VM name and / or portnumber. F_JG202C: Attempt to log on as user '' failed. : Wrong username /password for VM F_JD21AE: Unable to connect to SQL Server database '' on node: wrong credentials for database

Page 14 of 21

HVR for Azure Getting Started

Oct, 2016

Step 6: Setting up your Replication Configuration (“Channel”) The Replication definition can be found under “Channel Definitions”. It should be empty. Create your first channel by right clicking selecting “Channel Definitions” and selecting “New Channel”

The Channel should now be listed with 2 subitems, “Location Groups” and “Tables”. We are going to add location groups, actions and tables to the channel to complete the setup:

Location Groups First create 2 location groups, one for source and one for target, called SOURCE and TARGET respectively, by rightclicking “Location Groups” and selecting “New Group”.

For SOURCE, select your (MS SQL Server) source database location to be part of the group, for TARGET your Azure database location.

Actions Next, we’ll add the actions required to tell HVR to do on the locations. For the SOURCE location group, the action is Capture, for the TARGET it is Integrate.

Page 15 of 21

HVR for Azure Getting Started

Oct, 2016

Right click on the SOURCE location group, press “New Action” and select “Capture”:

No specific parameters need to be set so just press OK. For the TARGET location group repeat the process but select Action “Integrate”

Page 16 of 21

HVR for Azure Getting Started

Oct, 2016

Please check the option /burst Integrate action catalog. This forces the operations to Azure to be performed in performance optimized mode transferring all data at once to Azure before applying it to the target.

Tables Right Click on “Tables” and select “Table Explore” to add tables to the channel. You will be asked which database to explore for tables, select your source database. You will be presented a list of tables, select the ones to include in the channel and press add.

Step 7: Initialize the channel Now the configuration of the channel is finished and all it left to let HVR create the necessary jobs and structures to replicate. Choose “HVR initialize” from the menu by right clicking on the channel name. Leave the radio button on Create or Replace Objects and all locations checked and press “initialize”

Page 17 of 21

HVR for Azure Getting Started

Oct, 2016

At this point, the replication jobs are created but not started.

Step 8: Perform Initial Load If your source database already contains data, you will want to make sure this data is on your target as well. For this, HVR can be used too, including the creation of the necessary tables on the target to hold this data (target DDL creation).

Page 18 of 21

HVR for Azure Getting Started

Oct, 2016

Choose HVR Refresh and select your target (the source will be preselected). Check “create absent tables” “if mismatched” and “with index” for target DDL creation and finally press “Refresh” This will not only populate your target with data but will also create the necessary tables and indexes to store this data in.

Step 9: Starting the replication Got to the scheduler and start the jobs – with it the scheduler will be started.

Page 19 of 21

HVR for Azure Getting Started

Oct, 2016

Page 20 of 21

HVR for Azure Getting Started

Oct, 2016

Your replication is now running. Test it by performing some transactions on the source. You can check the replication results by running Compare. You can see replication statistics in graphs and reports by rightclicking the channel in the scheduler and choosing “Statistics”

Step 10 (optional): Securing HVR communications with SSL The HVR for Azure Image creates a remote listener agent without network encryption. This is advisable only for POC environments. To setup your VM for production, the remote listener agent should be reconfigured to force encryption of all data. 1. Login to your Azure VM using remote desktop 2. Open a command window with administrator privileges and enter the following commands: cd %HVR_HOME%\bin C:\hvr\hvr_home\bin\hvrremotelistener -ahd 4343 C:\hvr\hvr_home\bin\hvrremotelistener -acs -Khvr 4343

3. Exit the Remote Desktop session to the Azure VM and add Action”LocationProperties /SslRemoteCertificate hvr” for your Azure location (or group) on your hub

4. In this example we used the included certficate hvr. It is possible and advisable to use your own certificate instead, generate it using hvrsslgen (see the HVR manual section “Configuring Encrypted Network Connections"), copy the priv_key and pub_cert to the Azure VM and the pub_cert only to the hub, both in location %HVR_HOME%\lib\cert.

Page 21 of 21

HVR for Azure Getting Started

Oct, 2016