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

Using CDM to Import Data to Elasticsearch

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

With CSS, you can use the web user interface of the Cloud Data Migration (CDM) service to import data from an Oracle database or OBS to an Elasticsearch or OpenSearch cluster. Only JSON files are supported.

Table 1 Using CDM to import data to CSS

Scenario

Source Data

Target Cluster

Importing data from an Oracle database to CSS

A local or third-party Oracle database

Elasticsearch 5.5, 6.2, 6.5, 7.1, 7.6, 7.9, or 7.10

OpenSearch 1.3.6

Importing data from OBS to CSS

JSON files in OBS buckets

Elasticsearch 5.5, 6.2, 6.5, 7.1, 7.6, 7.9, or 7.10

OpenSearch 1.3.6

Preparations

  1. Confirm the source data.

    For example, the source data can be the following JSON files:

    For Elasticsearch earlier than 7.x:
    {"index": {"_index":"my_store","_type":"products"}}
    {"productName":"Autumn new woman blouses 2019","size":"M"}
    {"index": {"_index":"my_store","_type":"products"}}
    {"productName":"Autumn new woman blouses 2019","size":"L"}
    For Elasticsearch 7.x or later or OpenSearch:
    {"index": {"_index":"my_store"}}
    {"productName":"Autumn new woman blouses 2019","size":"M"}
    {"index": {"_index":"my_store"}}
    {"productName":"Autumn new woman blouses 2019","size":"L"}
  2. Obtain data source information.
    • If the data source is an Oracle database, you need to obtain the IP address, database name, username, and password of the database.
    • If the data source is JSON files in an OBS bucket, you need to obtain its domain name, port, AK, and SK.
  3. If the data source is an Oracle database, make sure the Oracle database can be accessed using a public IP address, or a VPN or Direct Connect connection has been established between the customer's data center and Huawei Cloud.

Importing Data

  1. Log in to the CSS management console.
  2. In the navigation pane on the left, expand Clusters and select a cluster type. A cluster list is displayed.
  3. In the cluster list, obtain the IP address of the target cluster from the Private Network Address column. Generally, the IP address format is <host>:<port> or <host>:<port>,<host>:<port>.

    If the cluster has only one node, the IP address and port number of this one node are displayed, for example, 10.62.179.32:9200. If the cluster has multiple nodes, the IP addresses and port numbers of all nodes are displayed, for example, 10.62.179.32:9200,10.62.179.33:9200.

  4. Find the row that contains the target cluster, and click Access Kibana in the Operation column.
  5. In the Kibana navigation pane on the left, choose Dev Tools.
  6. Run the following command on the console to check whether the cluster has indexes:
    GET _cat/indices?v
    • If indexes are available in the cluster to which you want to import data, you do not need to create an index. Go to 8.
    • If no indexes are available in the cluster, go to the next step to create an index.
  7. Run the following command to create an index for storing imported data and create a custom mapping to define the data type.

    For example, run the following command to create index demo:

    Run the following command for Elasticsearch earlier than 7.x:
    PUT /demo
    {
      "settings": {
        "number_of_shards": 1
      },
      "mappings": {
        "products": {
          "properties": {
            "productName": {
              "type": "text",
              "analyzer": "ik_smart"
            },
            "size": {
              "type": "keyword"
            }
          }
        }
      }
    }

    Run the following command for Elasticsearch 7.x or later or OpenSearch:

    PUT /demo
    {
      "settings": {
        "number_of_shards": 1
      },
      "mappings": {
          "properties": {
            "productName": {
              "type": "text",
              "analyzer": "ik_smart"
            },
            "size": {
              "type": "keyword"
            }
          }
        }
      }

    The command is successfully executed if the following information is displayed.

    {
      "acknowledged" : true,
      "shards_acknowledged" : true,
      "index" : "demo"
    }
  8. Log in to the CDM management console and import Oracle or OBS data to the Elasticsearch or OpenSearch cluster through a CDM cluster.
  9. After the data migration is complete, go to the Kibana console of the Elasticsearch or OpenSearch cluster again, and search for the imported data.

    Run the following command to search for data. If the imported data is consistent with the source data, data importing is successful.

    GET demo/_search

    demo is the name of the created index. Replace it if another index is used.

    The command is successfully executed if the following information is displayed.

    {
      "took": 18,
      "timed_out": false,
      "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
      },
      "hits": {
        "total": 2,
        "max_score": 1,
        "hits": [
          {
            "_index": "demo",
            "_type": "products",
            "_id": "g6UepnEBuvdFwWkRmn4V",
            "_score": 1,
            "_source": {
              "size": """"size":"L"}""",
              "productName": """{"productName":"Latest art shirts for women in autumn 2019""""
            }
          },
          {
            "_index": "demo",
            "_type": "products",
            "_id": "hKUepnEBuvdFwWkRmn4V",
            "_score": 1,
            "_source": {
              "size": """"size":"M"}""",
              "productName": """{"productName":"Latest art shirts for women in autumn 2019""""
            }
          }
        ]
      }
    }

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