Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Search Service/ Best Practices/ Elasticsearch Data Migration/ Migrating Data from an On-premises Elasticsearch Cluster to Huawei Cloud Using the S3 Plugin

Migrating Data from an On-premises Elasticsearch Cluster to Huawei Cloud Using the S3 Plugin

Updated on 2024-11-22 GMT+08:00

This topic describes how to use the S3 plugin to migrate data from an on-premises Elasticsearch cluster to a Huawei Cloud Elasticsearch cluster using the snapshot mechanism.

Scenario

The S3 plugin (repository-s3) is purpose-developed for Elasticsearch. It allows users to store Elasticsearch snapshots to a storage service compatible with S3 APIs, such as Huawei Cloud OBS. The S3 plugin provides an efficient, flexible, and secure way to back up the data of Elasticsearch clusters.

The S3 plugin can be used to migrate data from an on-premises Elasticsearch cluster to a Huawei Cloud Elasticsearch cluster. Typical scenarios include:

  • Cloud migration: Migrate an on-premises Elasticsearch service to the cloud to enjoy the benefits of cloud services, such as scalability, ease-of-maintenance, and cost-effectiveness.
  • Cross-version migration: Migrate data from an on-premises Elasticsearch cluster of an earlier version to a Huawei Cloud Elasticsearch cluster of a later version.
  • Cluster merge: Migrate data from multiple on-premises Elasticsearch clusters to a single Huawei Cloud Elasticsearch cluster to form a unified data platform for simplified management and higher data consistency.
  • Unified technology stack: For a simplified, unified technology stack, companies that are already using some services on Huawei Cloud may choose to migrate their on-premises Elasticsearch clusters to Huawei Cloud.

Overview

Figure 1 Migration procedure

Figure 1 describes the procedure for migrating an on-premises Elasticsearch cluster (source cluster) to a Huawei Cloud Elasticsearch cluster (destination cluster) using the S3 plugin.

  1. Install the repository-s3 plugin in the on-premises Elasticsearch cluster.
  2. Back up the data of the on-premises Elasticsearch cluster to Huawei Cloud OBS.
  3. Restore data from Huawei OBS to an Elasticsearch cluster in CSS.

Advantages

  • High cross-version compatibility: Data can be migrated between Elasticsearch clusters of different versions, including upgrade from an earlier version to a later version.
  • High availability and durability: S3 protects the security of data backups and minimizes the risk of data loss.
  • Flexible backup policies: You can choose between full backup or incremental backup based on service requirements to optimize storage utilization and migration time.

Impact on Performance

The essence of migrating data between clusters using backup and restoration is copying files at the data storage layer to back up data. This solution does not rely on any external Elasticsearch APIs. Hence it significantly reduces any impact on the performance of the source cluster. For clusters that are not particularly latency-sensitive, the performance impact of this method can be ignored.

Constraints

  • The version of the destination cluster must not be earlier than that of the source cluster. For details, see Snapshot version compatibility.
  • This method does not support incremental data synchronization. You need to pause data update before starting to back up data.
  • An on-premises Elasticsearch cluster needs public network access to back up snapshots to OBS.

Prerequisites

  • The source and destination Elasticsearch clusters are available.
  • The OBS bucket (backup-obs) for storing snapshots has been prepared. The OBS bucket and the destination Elasticsearch cluster of CSS are in the same region.
  • You have obtained the AK/SK of your account. For details, see How Do I Obtain an Access Key (AK/SK)?.

Procedure

  1. Install the repository-s3 plugin in the on-premises Elasticsearch cluster.

    1. Check the version of the on-premises Elasticsearch cluster and determine the version of the repository-s3 plugin that you need to install.

      Run the following command to obtain cluster information:

      curl http://x.x.x.x:9200 # Enter the IP address of the Elasticsearch cluster.

      Find version.number in the command output. In the example below, the cluster version is 7.10.2.

      {
        "name" : "es_cluster_migrate-ess-esn-1-1",
        "cluster_name" : "es_cluster_migrate",
        "cluster_uuid" : "1VbP7-39QNOx_R-llXKKtA",
        "version" : {
          "number" : "7.10.2",
          "build_flavor" : "default",
          "build_type" : "tar",
          "build_hash" : "d2ef93d",
          "build_date" : "2018-12-17T21:17:40.758843Z",
          "build_snapshot" : false,
          "lucene_version" : "8.7.0",
          "minimum_wire_compatibility_version" : "6.7.0",
          "minimum_index_compatibility_version" : "6.0.0-beta1"
        },
        "Tagline" : "You Know, for Search"
      }
    2. Download the repository-s3 plugin installation package of the required version. 7.10.2 is used as an example here. Change the version number in the download address based on the actual cluster version.

      Download address: https://artifacts.elastic.co/downloads/elasticsearch-plugins/repository-s3/repository-s3-7.10.2.zip

    3. Log in to an instance node of the on-premises Elasticsearch cluster, and run the cd command to go to the plugins directory.
    4. Run the following command to extract the repository-s3 plugin installation package to the plugins directory:
      unzip  repository-s3-7.10.2.zip -d plugins/repository-s3
    5. Add the AK/SK that enables access to Huawei Cloud to the repository-s3 plugin.
      1. Go to the installation path of the on-premises Elasticsearch cluster, and run the following command to create a keystore file:
        bin/elasticsearch-keystore create s3.keystore
        NOTE:

        Use a common user account, rather than the root account, to create the keystore file. Otherwise, the configuration will not take effect.

      2. Add the AK/SK that enables access to Huawei Cloud to the keystore file.
        bin/elasticsearch-keystore add s3.client.default.access_key
        bin/elasticsearch-keystore add s3.client.default.secret_key

        access_key indicates the AK, and secret_key indicates the SK.

    6. If the on-premises Elasticsearch cluster has multiple instance nodes, repeat 1.c to 1.e to install the S3 plugin and configure the AK/SK for all these nodes.
    7. After the AK/SK is added, restart the Elasticsearch cluster for the configuration to take effect.
    8. After the restart, run the following command to check whether the S3 plugin has been successfully installed.
      curl http://x.x.x.x:9200/_cat/plugins # Enter the IP address of the Elasticsearch cluster.

      If the correct version information of the repository-s3 plugin is returned, as shown below, the plugin has been successfully installed.

      node-1 repository-s3 7.10.2

  2. Back up the data of the on-premises Elasticsearch cluster to Huawei Cloud OBS.

    1. Log in to the Kibana console of the on-premises Elasticsearch cluster, and choose Dev Tools to go to the CLI.
    2. Run the following command to create a snapshot repository my_backup, and connect it to OBS bucket backup-obs for storing snapshots in Huawei Cloud OBS.
      PUT /_snapshot/my_backup
      {
        "type": "s3",
        "settings": {
          # OBS bucket name
          "bucket": "backup-obs",
          # Public network address for accessing OBS
          "endpoint": "obs.xxx.example.com",
          "base_path": "snapshot",
          "max_snapshot_bytes_per_sec": "1000mb"
        }
      }
    3. Run the following command. If correct information about the snapshot repository is returned, it has been successfully created.
      GET /_snapshot/my_backup
    4. Run the following command to create a snapshot.

      Exclude system indexes whose name starts with ., and create a full data snapshot for all other indexes. Setting wait_for_completion to true means asynchronous task execution.

      PUT  _snapshot/my_backup/snapshot_all?wait_for_completion=true
      {
          "indices": "*,-.*"
      }
    5. After the snapshot is created, run the following command to check the snapshot information:
      # Display all existing snapshots.
      GET _cat/repositories
      # Display information about all snapshots.
      GET _snapshot/my_backup/_all
      # Check the information of a snapshot by specifying its name. snapshot_all indicates the snapshot name.
      GET _snapshot/my_backup/snapshot_all
      # Check the status of a snapshot by specifying its name. snapshot_all indicates the snapshot name.
      GET _snapshot/my_backup/snapshot_all/_status

  3. Restore data from OBS to an Elasticsearch cluster of CSS.

    1. Log in to the CSS management console.
    2. In the navigation pane on the left, choose Clusters > Elasticsearch to go to the Clusters page.
    3. Locate the destination cluster and click Access Kibana in the Operation column to log in to Kibana.
    4. Click Dev Tools in the navigation tree on the left.
    5. Run the following command to create a snapshot repository called my_backup_all.
      PUT _snapshot/my_backup_all/
      {
          "type" : "obs",
          "settings" : {
      		# Private domain name of OBS.
      		"endpoint" : "obs.xxx.example.com",
      		"region" : "cn-south-1",
      		# Username and password for accessing OBS.
      		"access_key": "xxx",
      		"secret_key": "xxx",  
      		# OBS bucket name, which must be the same as the destination OBS bucket name in the previous step.
      		"bucket" : "backup-obs",   
      		"compress" : "false",
      		"chunk_size" : "1g",
      		"base_path" : "snapshot",
      		"max_restore_bytes_per_sec": "1000mb",
      		"max_snapshot_bytes_per_sec": "1000mb"    
      	}
      }
    6. Run the following command to restore data from the snapshot on OBS to the destination cluster.
      • Check all existing snapshots. In the command below, my_backup_all indicates the repository name.
        GET _snapshot/my_backup_all/_all
      • Restore data from the snapshot_all snapshot in the my_backup_all snapshot repository to the destination Elasticsearch cluster.
        POST _snapshot/my_backup_all/snapshot_all/_restore?wait_for_completion=true
      • Restore specified indexes to the destination Elasticsearch cluster. In this example, my_index1 and my_index2 are the names of the indexes to be restored.
        POST _snapshot/my_backup_all/snapshot_all/_restore?wait_for_completion=true
        {
          "indices": "my_index1,my_index2,-.*",
          "ignore_unavailable": "true"
        }

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback