Help Center> GeminiDB> GeminiDB Mongo API> FAQs> Client Installation> How Can I Install a MongoDB Client?
Updated on 2023-11-21 GMT+08:00

How Can I Install a MongoDB Client?

MongoDB official website provides client installation packages for different OSs. Download the official binary installation package at https://www.mongodb.com/download-center#community.

The following uses RedHat/CentOS 7.0 and MongoDB 4.0.27 as examples to describe how to obtain the required installation package and install the MongoDB client. Select a client version based on the OS version of your ECS and the version of your GeminiDB Mongo instance.

Procedure

  1. Obtain the installation package.

    1. Log in to https://www.mongodb.com/download-center#community.
    2. Select 4.0.27 under Version, RedHat/CentOS 7.0 for Platform, and tgz for Package. Make sure that the platform is consistent with the OS version of your ECS. Figure 1 shows an example.
      Figure 1 MongoDB official web page
    3. Click Download to download the binary installation package of version 4.0.27. The name of the installation package is mongodb-linux-x86_64-rhel70-4.0.27.tgz.

  2. Upload the installation package to the ECS.

    You have created and logged in to an ECS. For details, see Purchasing an ECS and Logging In to an ECS.

  3. Decompress the installation package on the ECS.

    tar zxvf mongodb-linux-x86_64-rhel70-4.0.27.tgz

  4. Obtain the client tool from the bin directory of the installation package.

    cd mongodb-linux-x86_64-rhel70-4.0.27/bin

    The common tools are as follows:

    • MongoDB client mongo
    • Data export tool mongoexport
    • Data import tool mongoimport

  5. Before using a client tool, assign the execute permission to it.

    • Run the chmod +x mongo command to grant a client permission to connect to a DB instance.
    • Run the chmod +x mongoexport command to grant a client permission to export data.
    • Run the chmod +x mongoimport command to grant a client permission to import data.

  6. Connect to a DB instance through the installed client.

    For details about how to connect to a replica set instance, see Connecting to a Replica Set Instance over a Private Network.

    When you run the MongoDB client, if an error similar to Version libcrypto.so.10 not found is displayed, check whether your client is compatible with the ECS OS.