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 cluster. Only JSON files are supported.
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 |
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 |
For example, the source data can be the following JSON files:
For Elasticsearch 7.x or later:
{"index": {"_index":"my_store"}}{"productName":"Autumn new woman blouses 2019","size":"M"}{"index": {"_index":"my_store"}}{"productName":"Autumn new woman blouses 2019","size":"L"}
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"}
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.
GET _cat/indices?v
For example, run the following command to create index demo:
For Elasticsearch 7.x or later:
PUT /demo{"settings": {"number_of_shards": 1},"mappings": {"properties": {"productName": {"type": "text","analyzer": "ik_smart"},"size": {"type": "keyword"}}}}
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"}}}}}
The command is successfully executed if the following information is displayed.
{"acknowledged" : true,"shards_acknowledged" : true,"index" : "demo"}
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""""}}]}}