This tutorial guides you to install only mongo shell client without mongodb server. I wanted test mongo instance connection from Cluster A, whereas the mongodb server instance is running Cluster B. Let’s see what Mongo provides to do that.
Install only mongo shell client and not mongodb
If you would like to install only the mongo shell client, MongoDB provides a package called mongodb-org-shell which contains mongo shell. And you may have to install other tools so that you would be able to install mongo shell client correctly.
I would recommend to follow the instructions in MongoDB official documentation if the below steps don’t work for you as the instructions may keep changing.
First, go to the cloud shell and run the following command. This command will download the key and pass it to apt-key add.
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - OK
Then create a package list file for MongoDB by running the following instruction.
$ echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse
Update the local package database by running the following command.
$ sudo apt-get update
Note, before installing mongo-org-shell you might need to install dependencies. You might face the below error, so make sure that you install libcurl3 before installing mongo shell.
$ sudo apt-get install mongodb-org-shell ---- ---- The following packages have unmet dependencies: mongodb-org-shell : Depends: libcurl3 (>= 7.16.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
Therefore, install libcurl3 dependency by running the following command.
$ sudo apt-get install libcurl3
Finally, install only mongo shell client i.e., mongo-org-shell.
$ sudo apt-get install mongodb-org-shell
That’s it. You had successfully installed mongo shell client without mongodb server.
Now you can test mongo shell client (only) by running the following command.
$ mongo --host mongodb:27017
Hope it helped 🙂
- How to Explore Docker Container’s File System ?
- Docker EXPOSE Port only to the Host on Google Cloud
- Get Docker Container’s IP Address from the Host
- Copy Files between Host and Docker Container
- Start Stop Restart MariaDB on Linux OS
- kubectl unable to connect to server: x509: certificate signed by unknown authority
- How to list all Containers running in Kubernetes Pod ?
- How to find which users belongs to a specific group in linux
- Give write permissions for specific user or group for specific folder in linux
- How to remove an image tag from docker hub ?
- Build a Docker Image with a Dockerfile and Cloud Build in GCP?
- How to create GCP project on Google Cloud Platform
- MariaDB – How to set max_connections permanently ?
- Create GCP project on Google Cloud Platform
- What is ImagePullBackOff status on a Kubernetes pod ?
- Create non-root SSH user account and provide access to specific folders
- Delete docker repository from the docker hub
- Unable to connect to the server: dial tcp i/o timeout