Copying Data Between Similar HPE Vertica Clusters

Similar documents
HPE Automatic Number Plate Recognition Software Version: Automatic Number Plate Recognition Release Notes

Vertica on Microsoft Azure HPE Vertica Analytic Database. Software Version: 7.2.x

HPE ALM Client MSI Generator

HP Integration with Incorta: Connection Guide. HP Vertica Analytic Database

HP Operations Orchestration

HPE ConnectorLib Java SDK

HPE Remote Analysis Agent Software Version: 5.3 Microsoft Windows. Technical Note

HPE Storage Optimizer Software Version: 5.4. Support Matrix

HP AutoPass License Server

Vertica Knowledge Base Article. Vertica QuickStart for Tableau

HPE Remote Analysis Agent Software Version: 5.2 Microsoft Windows. Technical Note

HPE IDOL Site Admin. Software Version: Installation Guide

HP IDOL Site Admin. Software Version: Installation Guide

HPE Operations Bridge Reporter

HP Automation Insight

HPE Security ArcSight Connectors

HP ALM. Software Version: patch 2. Business Views Microsoft Excel Add-in User Guide

HP Operations Orchestration

HP Virtual Connect Enterprise Manager

HP ALM Client MSI Generator

HP Database and Middleware Automation

HPE ALM Excel Add-in. Microsoft Excel Add-in Guide. Software Version: Go to HELP CENTER ONLINE

HPE ControlPoint. Software Version: Support Matrix

HPE Security ArcSight Connectors

HPE Security Fortify WebInspect Enterprise Software Version: Windows operating systems. Installation and Implementation Guide

HPE Storage Optimizer Software Version: 5.4. Best Practices Guide

HPE Structured Data Manager

HP Operations Orchestration

HPE Operations Bridge Reporter

HP Intelligent Management Center Remote Site Management User Guide

Guidelines for using Internet Information Server with HP StorageWorks Storage Mirroring

IDOL Site Admin. Software Version: User Guide

Marvell BIOS Utility User Guide

HPE RDX Utility Version 2.36 Release Notes

HPE 3PAR OS MU3 Patch 24 Release Notes

HPE 3PAR OS MU5 Patch 49 Release Notes

HPE 3PAR OS MU2 Patch 36 Release Notes

HP UFT Connection Agent

HPE Security ArcSight ESM

HP Fortify Scanning Plugin for Xcode

HP ALM Synchronizer for Agile Manager

HP Operations Orchestration Software

HPE Security ArcSight Connectors

HPE 3PAR OS GA Patch 12

HPE Project and Portfolio Management Center

Data Protector. Software Version: Zero Downtime Backup Integration Guide

HPE Security ArcSight SmartConnectors. Format Preserving Encryption Environment Setup Guide

OMi Management Pack for Oracle Database. Software Version: Operations Manager i for Linux and Windows operating systems.

HP StorageWorks. EVA Virtualization Adapter administrator guide

HP 3PAR OS MU1 Patch 11

HP 3PAR OS MU3 Patch 17

HPE Project and Portfolio Management Center

HP Storage Mirroring Application Manager 4.1 for Exchange white paper

Achieve Patch Currency for Microsoft SQL Server Clustered Environments Using HP DMA

HPE StoreEver MSL6480 Tape Library Version 5.50 Firmware Release Notes

HP Enterprise Integration module for SAP applications

HP LeftHand P4500 and P GbE to 10GbE migration instructions

HPE Security ArcSight Connectors

HP Operations Orchestration Software

Connectivity Pack for Microsoft Guide

HPE Security ArcSight Connectors

IDE Connector Customizer Readme

HP Enterprise Collaboration

HP D6000 Disk Enclosure Direct Connect Cabling Guide

Installation Guide. OMi Management Pack for Microsoft Skype for Business Server. Software Version: 1.00

HPE ComputeSensor. User Guide. Software Version: 3.02 Windows and Linux operating systems. Document Release Date: August 2017

HP StorageWorks Enterprise Virtual Array 4400 to 6400/8400 upgrade assessment

HP Business Service Management

HPE 3PAR OS MU3 Patch 28 Release Notes

HPE SiteScope. SiteScope Public API Reference Guide. Software Version: Go to HELP CENTER ONLINE

Project and Portfolio Management Center

HPE Recovery Manager Central Integration Service

HPE 3PAR OS MU3 Patch 18 Upgrade Instructions

External Devices User Guide

Customizing Incremental ETL for Operational Reporting

HPE 3PAR OS MU3 Patch 23 Release Notes

HP Storage Provisioning Manager HP 3PAR StoreServ Peer Persistence

HP ArcSight Express. Software Version: AE 4.0. Technical Note: ArcSight Express Backup and Recovery

HP Operations Orchestration

HP SM Service Catalog-PPM Center Project Proposal Integration Solution

HP 3PAR OS MU3 Patch 18 Release Notes

HPE Network Node Manager i Software

HP ALM. Software Version: Tutorial

HP Project and Portfolio Management Center

HPE 1/8 G2 Tape Autoloader and MSL Tape Libraries Encryption Kit User Guide

External Devices User Guide

HPE Moonshot ilo Chassis Management Firmware 1.52 Release Notes

HP Business Availability Center

HPE D2600/D2700 Disk Enclosure I/O Module Firmware 0149 Release Notes

Project and Portfolio Management Center

External Devices. User Guide

Standardize Microsoft SQL Server Cluster Provisioning Using HP DMA

HP Service Test Management

HP ALM. Software Version: Tutorial

OMi Management Pack for Microsoft SQL Server. Software Version: For the Operations Manager i for Linux and Windows operating systems.

HPE Basic Implementation Service for Hadoop

HP Network Node Manager i Software Step-by-Step Guide to Scheduling Reports using Network Performance Server

QuickSpecs. HPE VM Explorer. What's New. HPE VM Explorer. Overview

HPE Intelligent Management Center

HPE Enterprise Integration Module for SAP Solution Manager 7.1

Transcription:

Copying Data Between Similar HPE Vertica HPE Vertica Analytic Database

Legal Notices Warranty The only warranties for Hewlett Packard Enterprise products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. Hewlett Packard Enterprise shall not be liable for technical or editorial errors or omissions contained herein. The information contained herein is subject to change without notice. Restricted Rights Legend Confidential computer software. Valid license from Hewlett Packard Enterprise required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. Copyright Notice Copyright 2016 Hewlett Packard Enterprise Development L.P. Trademark Notices Adobe is a trademark of Adobe Systems Incorporated. Microsoft and Windows are U.S. registered trademarks of Microsoft Corporation. UNIX is a registered trademark of The Open Group. This product includes an interface of the 'zlib' general purpose compression library, which is Copyright 1995-2002 Jean-loup Gailly and Mark Adler. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 2

Table of Contents Part II: Copying Data Between Similar Vertica... 4 Source and Target... 4 Copy a Full Cluster from a Source to a Target Cluster (Copycluster)... 5 How to Copy a Full Cluster Between Similar Vertica... 5 Advantages and Limitations of Full Database Replication... 7 Copy Specific Tables Between Similar Vertica... 8 How to Copy Specific Tables Between Similar Vertica... 8 Advantages and Limitations of Copying Specific Tables Between Similar Vertica... 13 For More Information... 14 Copyright 2016 Hewlett Packard Enterprise Development LP. Page 3

Part II: Copying Data Between Similar Vertica You can replicate your Vertica database on another cluster, with these options: Replicate your entire Vertica database Copy the catalog, schema, projections, and partitions. Replicate part of your Vertica database Copy only specific tables. When performing replication, you must make sure that your source and target clusters are similar. The two clusters must have the same number of nodes, node names, dbadmin user, and Vertica database version. Other prerequisites vary, depending on whether you are performing a full or partial replication. See Copy a Full Cluster from Source to Target Cluster (Copycluster) or Copy Specific Tables Between Similar Vertica for information specific to the type of replication you want to perform. Source and Target For the purpose of this document: The primary cluster is referred to as the source. The secondary cluster is referred to as the target. Backup always occurs on the source, and restore always occurs on the target. The IP addresses for the source cluster nodes are 10.100.0.66 and 10.100.0.77. The IP addresses for the target cluster nodes are 10.100.0.88 and 10.100.0.99. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 4

Copy a Full Cluster from a Source to a Target Cluster (Copycluster) To copy the entire database from one Vertica cluster to another Vertica cluster, you can use the vbr option, --copycluster. Vertica backs up the data from the source cluster and restores the data to the target cluster in a single operation. Caution When copying data, the vbr script with the --copycluster option overwrites all existing data in the target cluster. Prerequisites: The target cluster must have a different IP address than the source cluster. The source and the target cluster must have the same: o Number of nodes o Node names The databases on the source and target clusters must share the same: o dbadmin user o Database name o Vertica version You must set up passwordless SSH between the source and the target clusters. How to Copy a Full Cluster Between Similar Vertica To copy your entire database from one cluster to another similar cluster, follow these steps: 1. On the target cluster, install Vertica with the same number of nodes and same Vertica version as your source cluster. $ sudo /opt/vertica/sbin/install_vertica --accept-eula --license '/opt/vertica/config/licensing/vertica_community_edition.license.key' -- point-to-point --dba-user-password-disabled --ssh-identity 2. On the target cluster, create a database with the same database name as the source database, mydatabase. $ /opt/vertica/bin/admintools -t create_db -s 10.100.0.88,10.100.0.99 -d mydatabase Info: no password specified, using none Database with 1 or 2 nodes cannot be k-safe and it may lose data if it crashes Database mydatabase created successfully. After you create the database, it is up and running. Before you can copy the database, you must first stop it. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 5

3. On the target cluster, stop the mydatabase database. $ /opt/vertica/bin/admintools -t stop_db -d mydatabase Info: no password specified, using none Connecting to database Issuing shutdown command to database Database mydatabase stopped successfully 4. On the source cluster, create a configuration file called copyclusterconfig.ini. Run the vbr script with the --setupconfig option and answer the prompts. $ /opt/vertica/bin/vbr --setupconfig Number of restore points (1): 3 Object restore mode (coexist, createorreplace or create) (createorreplace): coexist Vertica user name (dbadmin): Node v_verticadb1_node0001 Backup host name (no default): 10.100.0.88 Backup directory (no default): Node v_verticadb1_node0002 Backup host name (no default): 10.100.0.99 Backup directory (no default): Change advanced settings? (n) [y/n]: n Config file name (backup_snapshot.ini):copyclusterconfig.ini Saved vbr config to copyclusterconfig.ini 5. On the source cluster, verify that your source database is up and running. Copy your entire database to the target cluster by running the vbr script with the --copycluster option. Caution: When copying data, the vbr script with the --copycluster option overwrites all existing data in the target cluster. $ /opt/vertica/bin/vbr --config-file copyclusterconfig.ini --task copycluster Starting copy of database mydatabase. Participating nodes: v_mydatabase_node0001, v_mydatabase_node0002. Enter vertica password: Snapshotting database. Snapshot complete. Syncing data to destination cluster. [==================================================] 100% Reinitializing destination catalog. Copycluster complete! Copyright 2016 Hewlett Packard Enterprise Development LP. Page 6

6. Start the target database, and verify that Vertica copied the data accurately. $ admintools -t start_db -d mydatabase Info: no password specified, using none Starting nodes: v_mydatabase_node0001 (10.100.0.88) v_mydatabase_node0002 (10.100.0.99) Starting Vertica on all nodes. Please wait, databases with large catalog may take a while to initialize. Node Status: v_mydatabase_node0001: (DOWN) v_mydatabase_node0002: (DOWN) Node Status: v_mydatabase_node0001: (DOWN) v_mydatabase_node0002: (DOWN) Node Status: v_mydatabase_node0001: (DOWN) v_mydatabase_node0002: (DOWN) Node Status: v_mydatabase_node0001: (DOWN) v_mydatabase_node0002: (DOWN) Node Status: v_mydatabase_node0001: (UP) v_mydatabase_node0002: (UP) Database mydatabase started successfully $ vsql => \dt store_sales* List of tables Schema Name Kind Owner Comment --------+----------------------+---------+---------+--------- store store_sales table dbadmin store store_sales_fact table dbadmin store store_sales_original table dbadmin (3 rows) Advantages and Limitations of Full Database Replication Advantages You can create a full copy of the source cluster database. Limitations All nodes on the source cluster must be up. The target cluster must be stopped. To restore data, the source and target clusters must have the same: o Number of nodes o Database name o dbadmin users o Vertica version Copyright 2016 Hewlett Packard Enterprise Development LP. Page 7

Copy Specific Tables Between Similar Vertica Suppose, you have a Vertica database with 50 tables on the source cluster and you have backed up 50 tables on the target clusters. You add 5 new tables and want to copy the 5 new tables to the target cluster to replicate data between the 2 Vertica clusters. In this situation, you can just copy specific tables from one cluster to another, as long as your clusters are identical. Prerequisites: The target cluster database name can be same or different than the source cluster database name. The source and the target cluster must have the same: o Number of nodes o Vertica version o dbadmin username The source and the target cluster can have different: o Node names o Database name The target cluster must have a different IP address than the source cluster. How to Copy Specific Tables Between Similar Vertica To copy a table, follow these steps, which lead you through creating a table on your source cluster and copying it to the target. 1. On the source cluster, create a table named cluster1_table1. $ vsql => CREATE TABLE cluster1_table1 (i INT NOT NULL) PARTITION BY i; CREATE TABLE => COPY cluster1_table1 FROM stdin; Enter data to be copied followed by a newline. End with a backslash and a period on a line by itself. >> 1 >> 2 >> 3 >> 4 >> 5 >> \. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 8

=> SELECT * FROM cluster1_table1; i --- 2 3 5 1 4 => \dt List of tables Schema Name Kind Owner Comment --------+--------------------------+-------+---------+--------- public cluster1_table1 table dbadmin public table_that_wont_be_moved table dbadmin (2 rows) 2. On the source cluster, create a backup configuration file backup_snapshot_today.ini. Run the vbr script with the --setupconfig option and answer the prompts. $ /opt/vertica/bin/vbr --setupconfig Snapshot name (backup_snapshot): Number of restore points (1): 3 Specify objects (no default): public.cluster1_table1 Object restore mode (coexist, createorreplace or create) (createorreplace): coexist Vertica user name (dbadmin): Save password to avoid runtime prompt? (n) [y/n]: n Node v_mydatabase_node0001 Backup host name (no default): 10.100.0.88 Backup directory (no default): /vertica/backuplocation Node v_mydatabase_node0002 Backup host name (no default): 10.100.0.88 Backup directory (no default): /vertica/backuplocation Change advanced settings? (n) [y/n]: n Config file name (backup_snapshot.ini): object_specific_replication.ini Saved vbr config to object_specific_replication.ini. When you specify coexist for the object restore mode, Vertica creates all restored objects with the prefix <backup>_<timestamp>_<object_name>. This approach allows existing and restored objects to exist simultaneously. For more information about the other options, see Object Restore Mode in the Vertica documentation. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 9

For this example the name of the backup configuration file is object_specific_replication.ini. $ cat object_specific_replication.ini [Misc] snapshotname = backup_snapshot restorepointlimit = 3 objects = public.cluster1_table1 objectrestoremode = coexist tempdir = /tmp/vbr retrycount = 2 retrydelay = 1 [Database] dbname = mydatabase dbuser = dbadmin dbpromptforpassword = True [Transmission] encrypt = False checksum = False port_rsync = 50000 serviceaccessuser = dbadmin total_bwlimit_backup = 0 concurrency_backup = 1 total_bwlimit_restore = 0 concurrency_restore = 1 [Mapping] v_mydatabase_node0001 = 10.100.0.88:/vertica/backuplocation v_mydatabase_node0002 = 10.100.0.88:/vertica/backuplocation 3. On the source cluster, initialize your backup location by running the vbr script with the init option. $ /opt/vertica/bin/vbr.py -t init --config-file object_specific_replication.ini --debug=3 Initializing backup locations. Backup locations initialized. 4. On the source cluster, create a backup of table cluster1_table1 by running the vbr script with the backup option. $ /opt/vertica/bin/vbr.py -t backup --config-file object_specific_replication.ini Starting backup of database mydatabase. Objects: public.cluster1_table1 Participating nodes: v_mydatabase_node0001, v_mydatabase_node0002. Snapshotting database. Snapshot complete. Copying backup metadata. Finalizing backup. Backup complete! Copyright 2016 Hewlett Packard Enterprise Development LP. Page 10

5. On the target cluster, copy the object_specific_replication.ini file from the source cluster: a. Using any text editor, change the database name to the target database name and map the nodes appropriately. b. Rename the file to object_specific_replication_on_target.ini. The object_specific_replication_on_target.ini file is as follows. The changed text is in bold. $ cat object_specific_replication_on_target.ini [Misc] snapshotname = backup_snapshot restorepointlimit = 3 objects = public.cluster1_table1 objectrestoremode = coexist tempdir = /tmp/vbr retrycount = 2 retrydelay = 1 [Database] dbname = targetdb dbuser = dbadmin dbpromptforpassword = True [Mapping] v_targetdb_node0001 = 10.100.0.88:/vertica/backuplocation v_targetdb_node0002 = 10.100.0.88:/vertica/backuplocation [NodeMapping] v_mydatabase_node0001 = v_targetdb_node0001 v_mydatabase_node0002 = v_targetdb_node0002 6. On the target cluster, restore table cluster1_table1 by running the vbr script with the restore option. $ /opt/vertica/bin/vbr.py -t restore --config-file object_specific_replication_on_target.ini Starting object restore of database targetdb. Participating nodes: v_targetdb_node0001,v_targetdb_node0002. Objects to restore: public.cluster1_table1. Enter vertica password: Restoring from restore point: backup_snapshot_20160203_212137 Loading snapshot catalog from backup. Extracting objects from catalog. Syncing data from backup to cluster nodes. 0 out of 0 bytes transferred (100%) Finalizing restore. The prefix of newly created schemas in coexist mode is: backup_snapshot_20160203221054 Restore complete! When you specify coexist, the newly created schema is: backup_snapshot_20160203221054. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 11

7. Move the data from cluster1_table1 to another table in the target database. To move your data using move_partitions_to_table, the two tables must have identical schema, projections, and partitions. When you move your data, Vertica removes the data from its original location. a. On the target cluster, to view both the schemas, use the \dt command. $ vsql => \dt List of tables Schema Name Kind Owner ---------------------------------------+----------------+------+-------- backup_snapshot_20160203221054_public cluster1_table1 table dbadmin public cluster2_table2 table dbadmin b. To view the existing data in the table public.cluster2_table2, use the following command: => SELECT * FROM public.cluster2_table2; i ---- 15 13 12 14 11 c. Move the data from backup_snapshot_20160203221054_public.cluster1_table1 to public.cluster2_table2 using the following command: $ vsql => \dt List of tables Schema Name Kind Owner --------------------------------------+-----------------+------+-------- backup_snapshot_20160203221054_public cluster1_table1 table dbadmin public cluster2_table2 table dbadmin => SELECT MOVE_PARTITIONS_TO_TABLE('backup_snapshot_20160203221054_public.cluster1 _table1', 1,5,'public.cluster2_table2'); MOVE_PARTITIONS_TO_TABLE ------------------------------------------------- 5 distinct partition values moved at epoch 17. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 12

=> SELECT * from cluster2_table2; i ----- 5 3 2 11 15 15 13 12 4 1 Now, public.cluster2_table2 has data from both tables, and backup_snapshot_20160203221054_public.cluster1_table1 has no data. Advantages and Limitations of Copying Specific Tables Between Similar Vertica Advantages The source and the target clusters can be up. Perform multiple, incremental backups. Sync tables bidirectionally to different backup locations. Perform fast incremental backups at regular intervals (if no significant changes). Choose individual tables to migrate. Faster than full backup, so saves disk space at the backup location. Can have different database name and dbadmin users between source and target clusters. Limitations The tables must have the same schema and projection definition. You must manually move the userdefined libraries and functions in the source and the target clusters. User-defined libraries and functions in the source and the target clusters should be the same. Copyright 2016 Hewlett Packard Enterprise Development LP. Page 13

For More Information For More Information About Vertica Community Edition Vertica Documentation Big Data and Analytics Community See https://my.vertica.com/community/ http://my.vertica.com/docs/7.2.x/ht ML/index.htm https://community.dev.hpe.com/t5/bi g-data-and-analytics/ctp/bigdata_analytics Copyright 2016 Hewlett Packard Enterprise Development LP. Page 14