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
On this page

Show all

Migrating Cluster Data Using Logstash

Updated on 2023-06-20 GMT+08:00

Logstash is an official data migration tool provided by Elasticsearch.

  1. Apply for an ECS, preferably with at least 8 vCPUs and 16 GB memory.
  2. Install Logstash on the ECS.

    1. Install JDK, because Logstash depends on Java. Run the following command to install JDK using yum:
      yum install java
      yum install python
    2. Download Logstash. Choose a Logstash version close to the Elasticsearch version. They do not have to use exactly the same version.

      Logstash 7.10.2 OSS is recommended. You can download it from https://www.elastic.co/downloads/past-releases/logstash-oss-7-10-2

    3. Run the following command to install Logstash using yum:
      yum install logstash-oss-7.10.0-x86_64.rpm

      Replace logstash-oss-7.10.0-x86_64.rpm with the actual Logstash installation package name.

  3. Modify the JVM configuration of Logstash to improve the cluster data migration efficiency.

    Run the following command to modify the JVM configuration. The default heap memory of Logstash is 1 GB. You are advised to change the heap memory to half of the cluster node memory.

    vim /etc/logstash/jvm.options
    -Xms4g
    -Xmx4g

  4. Modify the conf configuration file of Logstash and configure cluster migration settings.

    1. Go to the /etc/logstash/conf.d/ directory where the Logstash configuration file is stored.
      cd /etc/logstash/conf.d/
    2. Create the logstash-es-es-all.conf file.
      vim logstash-es-es-all.conf
    3. Add the following content to the logstash-es-es-all.conf file and save the file.

      Modify the hosts, user, password, index fields as needed.

      input{
          elasticsearch{
              #IP address of the source cluster
              hosts =>  ["http://172.16.xxx.xxx:9200", "http://172.16.xxx.xxx:9200"]
              # #For a security cluster, configure the username and password for cluster login. For a non-security cluster, you can use the number sign (#) to comment out the user and password fields.
              # user => "xxxx"
              # password => "xxxx"
              # #List of indexes to be migrated. Multiple indexes are separated by commas (,). Set this parameter based on the actual host information. -.* indicates that indexes starting with a period (.) are excluded.
              index => "abmau_edi*,business_test,goods_deploy*, -.*"
              # Retain the default values of the following three items, including the number of threads, the size of migrated data, and Logstash JVM configurations.
              docinfo=>true
              # Retain the default value. To increase the migration speed, you can increase the values of the following two parameters, but to a proper extent.
              slices => 3
              size => 3000
          }
      }
      
      filter {
        # Delete some fields added by Logstash.
        mutate {
          remove_field => ["@timestamp", "@version"]
        }
      }
      
      output{
          elasticsearch{
              # Destination cluster address.
              hosts => ["http://10.100.xx.xx:9200", "http://10.100.xx.xx:9200"]
              # Username and password for logging in to the target cluster. If you do not need to configure them, use the number sign (#) to comment them out.
              user => "admin"
              password => "*****"        
              # Index name of the target cluster. The following configurations must be the same as that of the source cluster.
              index => "%{[@metadata][_index]}"
              # #Index type of the target cluster. The following configurations must be the same as that of the source cluster.
              document_type => "%{[@metadata][_type]}"
              # _id of the target data. If the original _id does not need to be retained, you can delete it. After the deletion, the cluster performance can be better.
              document_id => "%{[@metadata][_id]}"
              ilm_enabled => false
              manage_template => false
          }
      
          # Debugging information. You are advised to delete this information before migration.
          # stdout { codec => rubydebug { metadata => true }}
      }

  5. Start Logstash to migrate cluster data.

    1. Run the following command to start Logstash:
      /usr/share/logstash/bin/logstash --path.settings /etc/logstash
    2. View the Logstash log file to check the task progress. The Logstash log directory is /var/log/logstash/.
    3. Wait until the data migration is complete.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback