Files
doc-exports/docs/css/umn/css_01_0089.html
zhengxiu 93d856d5c5 css umn 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:34:43 +00:00

115 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001992165585"></a><a name="EN-US_TOPIC_0000001992165585"></a>
<h1 class="topictitle1">Using CDM to Import Data to an OpenSearch Cluster</h1>
<div id="body0000001992165585"><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p432113142812">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 OpenSearch cluster. Only JSON files are supported.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_table1099912411111" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Using CDM to import data to CSS</caption><thead align="left"><tr id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_row69991141101116"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.4.1.1"><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p14999341161110">Scenario</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.4.1.2"><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p1899916413113">Source Data</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.2.2.4.1.3"><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p79991741191119">Destination Cluster</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_row7044291113"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p146841547131217">Importing data from an Oracle database to CSS</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p40042171115">A local or third-party Oracle database</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p2802274138">OpenSearch 1.3.6</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_row140042111110"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.4.1.1 "><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p1956072019156">Importing data from OBS to CSS</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.4.1.2 "><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p403429113">JSON files in OBS buckets</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.2.2.4.1.3 "><p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p0084251117">OpenSearch 1.3.6</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_section112727018472"><h4 class="sectiontitle">Preparations</h4><ol id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_ol7901133084918"><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li8250101815516">Confirm the source data.<p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_p144161928052"><a name="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li8250101815516"></a><a name="en-us_topic_0000001948561400_li8250101815516"></a>For example, the source data can be the following JSON files:</p>
<pre class="screen" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001938377776_screen6683416102718">{"index": {"_index":"my_store"}}
{"productName":"Autumn new woman blouses 2019","size":"M"}
{"index": {"_index":"my_store"}}
{"productName":"Autumn new woman blouses 2019","size":"L"}</pre>
</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li13901230194912">Obtain data source information.<ul id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_ul1750671414475"><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li65061314194713">If the data source is an Oracle database, you need to obtain the IP address, database name, username, and password of the database.</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li7937181814487">If the data source is JSON files in an OBS bucket, you need to obtain its domain name, port, AK, and SK.</li></ul>
</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li192451438499">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 the cloud service.</li></ol>
</div>
<div class="section" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_section189761043105118"><h4 class="sectiontitle">Importing Data</h4><ol id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_ol71955412418"><li id="EN-US_TOPIC_0000001992165585__li14954114818216"><span id="EN-US_TOPIC_0000001992165585__ph1162461016234">Log in to the CSS management console.</span></li><li id="EN-US_TOPIC_0000001992165585__li14321753129">In the navigation pane on the left, choose <span class="uicontrol" id="EN-US_TOPIC_0000001992165585__uicontrol1015932318191"><b>Clusters &gt; OpenSearch</b></span>.</li><li id="EN-US_TOPIC_0000001992165585__li154373531023">In the cluster list, obtain the target cluster's private IP address from the <strong id="EN-US_TOPIC_0000001992165585__b166543418194">Private IP Address</strong> column. Generally, the IP address format is <em id="EN-US_TOPIC_0000001992165585__i9666113411915">&lt;host&gt;</em>:<em id="EN-US_TOPIC_0000001992165585__i1766693471918">&lt;port&gt;</em> or <em id="EN-US_TOPIC_0000001992165585__i116665340196">&lt;host&gt;</em>:<em id="EN-US_TOPIC_0000001992165585__i15666534111919">&lt;port&gt;</em>,<em id="EN-US_TOPIC_0000001992165585__i17666143413198">&lt;host&gt;</em>:<em id="EN-US_TOPIC_0000001992165585__i066618348194">&lt;port&gt;</em>.<p id="EN-US_TOPIC_0000001992165585__p18437453922">If the cluster has only one node, the IP address and port number of this one node are displayed, for example, <strong id="EN-US_TOPIC_0000001992165585__b15266113711196">10.62.179.32:9200</strong>. If the cluster has multiple nodes, the IP addresses and port numbers of all nodes are displayed, for example, <strong id="EN-US_TOPIC_0000001992165585__b10266103714192">10.62.179.32:9200,10.62.179.33:9200</strong>.</p>
</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li31955462412">In the cluster list, locate the destination cluster, and click <span class="uicontrol" id="EN-US_TOPIC_0000001992165585__uicontrol132153393310"><b>Dashboards</b></span> in the <strong id="EN-US_TOPIC_0000001992165585__b184493881911">Operation</strong> column to log in to OpenSearch Dashboards.</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li20195134202411">In the left navigation pane, choose <strong id="EN-US_TOPIC_0000001992165585__b95471393202">Dev Tools</strong>.</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li167981434143611">Run the following command on OpenSearch Dashboards to check whether the cluster has indexes:<pre class="screen" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_screen1778816833813">GET _cat/indices?v</pre>
<ul id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_ul142012035174"><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li32019351710">If indexes are available in the cluster to which you want to import data, you do not need to create an index. Go to <a href="#EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li10195124192412">8</a>.</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_li520133161714">If no indexes are available in the cluster, go to the next step to create an index.</li></ul>
</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li6195244249">Run the following command to create an index for storing imported data and create a custom mapping to define the data type.<p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_p101958482418"><a name="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li6195244249"></a><a name="en-us_topic_0000001948561400_en-us_topic_0000001268314481_li6195244249"></a>For example, run the following command to create index <strong id="EN-US_TOPIC_0000001992165585__b134417523208">demo</strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_screen1612015348325">PUT /demo
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"productName": {
"type": "text",
"analyzer": "ik_smart"
},
"size": {
"type": "keyword"
}
}
}
}</pre>
<p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_p1063513117336">The command is successfully executed if the following information is displayed.</p>
<pre class="screen" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_screen167317459428">{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "demo"
}</pre>
</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li10195124192412"><a name="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li10195124192412"></a><a name="en-us_topic_0000001948561400_en-us_topic_0000001268314481_li10195124192412"></a>Use CDM to import data from Oracle or OBS to the OpenSearch cluster.</li><li id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li71957422412">After the data migration is complete, go to the OpenSearch Dashboards console of the OpenSearch cluster again, and search for the imported data.<p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_p118053518234"><a name="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_li71957422412"></a><a name="en-us_topic_0000001948561400_en-us_topic_0000001268314481_li71957422412"></a>Run the following command to search for data. If the imported data is consistent with the source data, data importing is successful.</p>
<pre class="screen" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_screen1718063513237">GET demo/_search</pre>
<p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_p1062119062715"><strong id="EN-US_TOPIC_0000001992165585__b7935220112212">demo</strong> is the name of the created index. Replace it if another index is used.</p>
<p id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_p7655115242912">The command is successfully executed if the following information is displayed.</p>
<pre class="screen" id="EN-US_TOPIC_0000001992165585__en-us_topic_0000001948561400_en-us_topic_0000001268314481_screen138965417304">{
"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""""
}
}
]
}
}</pre>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0059.html">Importing Data to an OpenSearch Cluster</a></div>
</div>
</div>