forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Yang, Tong <yangtong2@huawei.com> Co-committed-by: Yang, Tong <yangtong2@huawei.com>
59 lines
8.4 KiB
HTML
59 lines
8.4 KiB
HTML
<a name="mrs_01_0407"></a><a name="mrs_01_0407"></a>
|
|
|
|
<h1 class="topictitle1">Preparing a Driver for MySQL Database Link</h1>
|
|
<div id="body1589421630813"><div class="section" id="mrs_01_0407__s78832e8225994ed19fa40912fae39571"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_0407__a604d2fe4c797496ba2d76da92b289d00">As a component for batch data export, Loader can import and export data using a relational database.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_0407__s5a9e83ac3b8841a49f5613d1971a74d6"><h4 class="sectiontitle">Prerequisites</h4><p id="mrs_01_0407__a68b7c5b1486f4ff49d8ba9e527a6759b">You have prepared service data.</p>
|
|
</div>
|
|
<div class="section" id="mrs_01_0407__s626c74c010b843ca9b1e640ab095bf5f"><h4 class="sectiontitle">Procedure</h4><p id="mrs_01_0407__p11151306401"><strong id="mrs_01_0407__b15573427165519">Procedure for MRS clusters earlier than 3.<em id="mrs_01_0407__i1398315541412">x</em>:</strong></p>
|
|
<ol id="mrs_01_0407__of77e0616b4324b048300a5958d0f914a"><li id="mrs_01_0407__l945d89eadc024485b6c0bd53e78cfce4"><span>Download the MySQL JDBC driver <span class="filepath" id="mrs_01_0407__f2b16126c56784c26bb62794b05ae284c"><b>mysql-connector-java-5.1.21.jar</b></span> from the MySQL official website. For details about how to select the MySQL JDBC driver, see the following table.</span><p>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_0407__table13581236105614" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Version information</caption><thead align="left"><tr id="mrs_01_0407__row1335812363567"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.3.1.2.1.2.3.1.1"><p id="mrs_01_0407__p1735833618565">JDBC Driver Version</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.3.1.2.1.2.3.1.2"><p id="mrs_01_0407__p123587364565">MySQL Version</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="mrs_01_0407__row535816362569"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.1 "><p id="mrs_01_0407__p113584368569">Connector/J 5.1</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.2 "><p id="mrs_01_0407__p13581136125613">MySQL 4.1, MySQL 5.0, MySQL 5.1, and MySQL 6.0 alpha</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0407__row1835853615561"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.1 "><p id="mrs_01_0407__p1935873620566">Connector/J 5.0</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.2 "><p id="mrs_01_0407__p9359436145613">MySQL 4.1, MySQL 5.0 servers, and distributed transaction (XA)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0407__row135914365569"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.1 "><p id="mrs_01_0407__p1359736155615">Connector/J 3.1</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.2 "><p id="mrs_01_0407__p8359123635614">MySQL 4.1, MySQL 5.0 servers, and MySQL 5.0 except distributed transaction (XA)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="mrs_01_0407__row135953655619"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.1 "><p id="mrs_01_0407__p635915367566">Connector/J 3.0</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.3.1.2.1.2.3.1.2 "><p id="mrs_01_0407__p83591036155610">MySQL 3.x and MySQL 4.1</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</p></li><li id="mrs_01_0407__l1a9c2ad65f7747ca999df43aa176a9d0"><span>Upload <span class="filepath" id="mrs_01_0407__f8337f851a0674a8298712dba8934f435"><b>mysql-connector-java-5.1.21.jar</b></span> to the Loader installation directory on the active and standby MRS Master nodes.</span><p><ul id="mrs_01_0407__ud09fa5f67f394ae69f3e92b46375397f"><li id="mrs_01_0407__ld3e67855344d401abbb4d76fb2709994">For versions earlier than MRS 1.9.2, upload the package to <span class="filepath" id="mrs_01_0407__filepath16231174311614"><b>/opt/Bigdata/FusionInsight/FusionInsight-Sqoop-1.99.7/FusionInsight-Sqoop-1.99.7/server/jdbc</b></span>.</li><li id="mrs_01_0407__ld9672360ecaf472e8e4268744bf9534d">For versions later than MRS 1.9.2 and earlier than MRS 3.x, upload the package to <span class="filepath" id="mrs_01_0407__filepath8846115581610"><b>/opt/Bigdata/MRS_XXX/install/FusionInsight-Sqoop-1.99.7/FusionInsight-Sqoop-1.99.7/server/jdbc/</b></span>.<p id="mrs_01_0407__a2f585e6d96fa4b2cb0d5d89e9b494e24">In the preceding path, <span class="parmname" id="mrs_01_0407__parmname11288558145212"><b>XXX</b></span> indicates the MRS version number. Change it based on site requirements.</p>
|
|
</li></ul>
|
|
</p></li><li id="mrs_01_0407__l1af56a3bce61447ea8dfb4f26063b646"><span>Change the owner of the <span class="filepath" id="mrs_01_0407__f785efd8c23734d3d8d3fca610e595f18"><b>mysql-connector-java-5.1.21.jar</b></span> package to <strong id="mrs_01_0407__b1469505513534">omm:wheel</strong>.</span></li><li id="mrs_01_0407__lb61ebc708555461fa5282e56bede0197"><span>Modify the <span class="filepath" id="mrs_01_0407__fcf51971dcfdc43c6906a62c49f933d93"><b>jdbc.properties</b></span> configuration file.</span><p><p id="mrs_01_0407__a05bd81df8f3b4e4298652748d709bce1">Change the key value of <span class="parmname" id="mrs_01_0407__pfbd0e747ef2d4125a6a801d876a93963"><b>MYSQL</b></span> to <span class="parmvalue" id="mrs_01_0407__p98adace1f0c046a5a43593e5ec0b9a10"><b>mysql-connector-java-5.1.21.jar</b></span>, for example, <strong id="mrs_01_0407__b1053217331811">MYSQL=mysql-connector-java-5.1.21.jar</strong>.</p>
|
|
</p></li><li id="mrs_01_0407__l88b9006cc50f4961afde33214c615420"><span>Restart the Loader service.</span></li></ol>
|
|
</div>
|
|
<p id="mrs_01_0407__p1860915217404"><strong id="mrs_01_0407__b11858428185517">Procedure for MRS cluster 3.<em id="mrs_01_0407__i53901313321">x</em> and later versions:</strong></p>
|
|
<p id="mrs_01_0407__p12359183673719">Modify the permission on the JAR package of the relational database driver.</p>
|
|
<ol id="mrs_01_0407__ol78145323719"><li id="mrs_01_0407__li88195313712"><span>Log in to the active and standby management nodes of the Loader service, obtain the driver JAR package of the relational database, and save it to the following directory on the active and standby Loader nodes: <strong id="mrs_01_0407__b06889339551">${BIGDATA_HOME}/FusionInsight_Porter_<span id="mrs_01_0407__text368823318552">8.1.0.1</span>/install/FusionInsight-Sqoop-1.99.3/FusionInsight-Sqoop-1.99.3/server/webapps/loader/WEB-INF/ext-lib</strong></span><p><div class="note" id="mrs_01_0407__note101521423151413"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_0407__p6153623131416"><span id="mrs_01_0407__text18547757143419">The version 8.1.0.1 is used as an example. Replace it with the actual version number.</span></p>
|
|
</div></div>
|
|
</p></li><li id="mrs_01_0407__li12416165711377"><span>Run the following commands as user <strong id="mrs_01_0407__b642418364556">root</strong> on the active and standby nodes of the Loader service to change the permission:</span><p><p id="mrs_01_0407__p12971729113419"><strong id="mrs_01_0407__b1272136113510">cd ${BIGDATA_HOME}/FusionInsight_Porter_<span id="mrs_01_0407__text11818114772317">8.1.0.1</span>/install/FusionInsight-Sqoop-1.99.3/FusionInsight-Sqoop-1.99.3/server/webapps/loader/WEB-INF/ext-lib</strong></p>
|
|
<p id="mrs_01_0407__p17244143751310"><strong id="mrs_01_0407__b16595143815515">chown omm:wheel</strong> <em id="mrs_01_0407__i7595538115510">JAR</em><em id="mrs_01_0407__i4595153819554"> package name</em></p>
|
|
<p id="mrs_01_0407__p524443712138"><strong id="mrs_01_0407__b57161745787">chmod 600</strong> <em id="mrs_01_0407__i13724184511816">JAR</em><em id="mrs_01_0407__i372694517817">package name</em></p>
|
|
</p></li><li id="mrs_01_0407__li51201969387"><span>Log in to FusionInsight Manager. Choose <strong id="mrs_01_0407__b185589425555">Cluster</strong> and click the target cluster name. In the navigation pane on the left, choose <strong id="mrs_01_0407__b1655904217558">Services</strong> > <strong id="mrs_01_0407__b145591242105512">Loader</strong>. In the upper right corner, choose <strong id="mrs_01_0407__b185591442205513">More</strong>, select <strong id="mrs_01_0407__b5559184245513">Restart Service</strong>, and enter the password of the administrator to restart the Loader service.</span></li></ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_0400.html">Using Loader</a></div>
|
|
</div>
|
|
</div>
|
|
|