forked from docs/doc-exports
Reviewed-by: Székely, Ond <ond.szekely@t-systems.com> Co-authored-by: wangdengke2 <wangdengke2@huawei.com> Co-committed-by: wangdengke2 <wangdengke2@huawei.com>
33 lines
6.7 KiB
HTML
33 lines
6.7 KiB
HTML
<a name="dds_faq_0018"></a><a name="dds_faq_0018"></a>
|
||
|
||
<h1 class="topictitle1">How Can I Install a MongoDB Client?</h1>
|
||
<div id="body8662426"><p id="dds_faq_0018__p6437338416538">MongoDB official website provides client installation packages for different OSs. Download the official package at <a href="https://www.mongodb.com/try/download/community" target="_blank" rel="noopener noreferrer">https://www.mongodb.com/try/download/community</a>.</p>
|
||
<div class="notice" id="dds_faq_0018__note134901054185218"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="dds_faq_0018__ul16881449122912"><li id="dds_faq_0018__li12881114915294">The following uses <span class="parmvalue" id="dds_faq_0018__parmvalue127634175515"><b>RedHat/CentOS 8.0 ×64</b></span> and MongoDB 5.0.28 as examples to describe how to obtain the required installation package and install the MongoDB client.</li><li id="dds_faq_0018__li1088115491291">During the installation, select a client version that matches the instance version based on the actual operating system.</li></ul>
|
||
</div></div>
|
||
<div class="section" id="dds_faq_0018__section1679163475310"><h4 class="sectiontitle">Procedure</h4><ol id="dds_faq_0018__o22bb62848f044ba78ddcc8d04b2a2633"><li id="dds_faq_0018__li19040286173627"><span>Obtain the installation package.</span><p><ol type="a" id="dds_faq_0018__ol5149115918032"><li id="dds_faq_0018__li501597610266">Visit the <a href="https://www.mongodb.com/try/download/community" target="_blank" rel="noopener noreferrer">MongoDB official website</a>.</li><li id="dds_faq_0018__li68694315512">Select version <strong id="dds_faq_0018__b176382724310">5.0.28</strong>, platform <strong id="dds_faq_0018__b16922715436">RedHat/CentOS 8.0 ×64</strong>, and package <strong id="dds_faq_0018__b17013275437">tgz</strong>. <a href="#dds_faq_0018__fig646895910135">Figure 1</a> shows an example.<div class="fignone" id="dds_faq_0018__fig646895910135"><a name="dds_faq_0018__fig646895910135"></a><a name="fig646895910135"></a><span class="figcap"><b>Figure 1 </b>MongoDB official web page</span><br><span><img id="dds_faq_0018__image2046875961318" src="en-us_image_0000002412372785.png"></span></div>
|
||
</li><li id="dds_faq_0018__li837112344328">Use either of the following methods to upload the installation package to the ECS:<div class="note" id="dds_faq_0018__note97626018372"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dds_faq_0018__p197635093711">For details about how to log in to an ECS, see <a href="dds_faq_0034.html">How Can I Create and Log In to an ECS?</a></p>
|
||
</div></div>
|
||
<ul id="dds_faq_0018__ul13562105420362"><li id="dds_faq_0018__li456215541368">Click <strong id="dds_faq_0018__b7148158113218">Download</strong> to obtain the binary installation package of version 5.0.28. The name of the installation package is <strong id="dds_faq_0018__b809516346">mongodb-linux-x86_64-rhel80-5.0.28.tgz</strong>. Upload the installation package to the ECS.</li><li id="dds_faq_0018__li1556218545366">Click <strong id="dds_faq_0018__b423343911347">Copy link</strong> to obtain the download address. Log in to the ECS and run the <strong id="dds_faq_0018__b1968819118358">wget </strong><em id="dds_faq_0018__i1890101413518">copylink</em> command.<div class="note" id="dds_faq_0018__note853151016410"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dds_faq_0018__p353115101048">Replace <em id="dds_faq_0018__i1232313153515">copylink</em> with the actual download address.</p>
|
||
</div></div>
|
||
</li></ul>
|
||
</li></ol>
|
||
</p></li><li id="dds_faq_0018__li12107812234"><span>Decompress the installation package on the ECS.</span><p><p id="dds_faq_0018__p5766646112515"><strong id="dds_faq_0018__b36391825155312">tar zxvf mongodb-</strong><em id="dds_faq_0018__i873522725311">linux-x86_64-rhel80-5.0.28</em><strong id="dds_faq_0018__b263972595312">.tgz</strong></p>
|
||
<div class="note" id="dds_faq_0018__note15657451135320"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dds_faq_0018__p865816511534">Replace the installation package name with the actual one.</p>
|
||
</div></div>
|
||
</p></li><li id="dds_faq_0018__li1348614349232"><span>Access the <span class="filepath" id="dds_faq_0018__filepath44002407182911"><b>bin</b></span> directory where the installation package is located.</span><p><p id="dds_faq_0018__p98325533411"><strong id="dds_faq_0018__b6825153885313">cd mongodb-</strong><em id="dds_faq_0018__i3669133915317">linux-x86_64-rhel80-5.0.28</em><strong id="dds_faq_0018__b5825163825315">/bin</strong></p>
|
||
<div class="note" id="dds_faq_0018__note1997843405416"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dds_faq_0018__p497918346547">Replace the installation package name with the actual one.</p>
|
||
</div></div>
|
||
<p id="dds_faq_0018__p10884134616314">The common tools are as follows:</p>
|
||
<ul id="dds_faq_0018__ul6885134623118"><li id="dds_faq_0018__li17885246143114">MongoDB client mongo</li><li id="dds_faq_0018__li1688534620310">Data export tool mongoexport</li><li id="dds_faq_0018__li1388594616316">Data import tool mongoimport</li></ul>
|
||
</p></li><li id="dds_faq_0018__li646501155938"><span>Make the packages executable.</span><p><ul id="dds_faq_0018__ul186071740145218"><li id="dds_faq_0018__li9607174018521">Run the <strong id="dds_faq_0018__b19497131185">chmod +x mongo</strong> command to grant a client permission to connect to an instance.</li><li id="dds_faq_0018__li106071540185212">Run the <strong id="dds_faq_0018__b48411643161113">chmod +x mongoexport</strong> command to grant a client permission to export data.</li><li id="dds_faq_0018__li14607164014520">Run the <strong id="dds_faq_0018__b849335410116">chmod +x mongoimport</strong> command to grant a client permission to import data.</li></ul>
|
||
</p></li><li id="dds_faq_0018__li16148655171418"><span>Connect to an instance through the installed client.</span><p><ul id="dds_faq_0018__ul17445161912155"><li id="dds_faq_0018__li18445191913154">To connect to a cluster instance, see <a href="dds_02_0009.html">Connecting to a Cluster Instance Over Private Networks</a>.</li><li id="dds_faq_0018__li596820432293">To connect to a replica set instance, see <a href="dds_02_0055.html">Connecting to a Replica Set Instance Over Private Networks</a>.</li><li id="dds_faq_0018__li96205243153">To connect to a single node instance, see <a href="dds_02_0074.html">Connecting to a Single-Node Instance Over Private Networks</a>.</li></ul>
|
||
</p></li></ol>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_faq_0104.html">Database Connection</a></div>
|
||
</div>
|
||
</div>
|
||
|