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
- Obtain the installation package.
- Log in to https://www.mongodb.com/download-center#community.
- 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.
- 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.
- 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.
- Decompress the installation package on the ECS.
tar zxvf mongodb-linux-x86_64-rhel70-4.0.27.tgz
- 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
- 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.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot