Install ONLY mongo shell, not mongodb

2020-05-29 12:50发布

As mentioned above, I need to install only the mongo shell on a RHEL instance (machine A). I have a mongodb server on a separate instance (machine B) and need to connect to that from A to run mongodump and mongorestore commands.

I tried looking it up on the web but all I got was instructions to install the complete mongodb package.

Any help appreciated.

4条回答
【Aperson】
2楼-- · 2020-05-29 13:27

You can follow the official tutorial on installing mongodb, and instead of installing the main package that will install all the packages, just install the package containing mongoshell

查看更多
地球回转人心会变
3楼-- · 2020-05-29 13:28

Please follow below steps.

  1. Create a file /etc/yum.repos.d/mongodb.repo

  2. Update the above file to contain:

    [mongodb]
    name=MongoDB Repository  
    baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/  
    gpgcheck=0
    enabled=1
    
  3. sudo yum install -y mongodb-org-shell-2.6.9

  4. mongo mongo-db_server_IP:27017/database_name -u username -p password

查看更多
Evening l夕情丶
4楼-- · 2020-05-29 13:46
  1. Create a repo file sudo vim /etc/yum.repos.d/mongodb.repo
  [mongodb-org-4.0]
  name=MongoDB Repository 
  baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
  gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
  gpgcheck=1 
  enabled=1 
  1. sudo yum clean all
  2. sudo yum install mongodb-org-shell-4.0.2

  3. mongo <mongo-server-ip> Note: Step 4 will not work in all cases. You need to check proper command to connect to remote mongo server.

Source: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2020-05-29 13:47

Official documentation says that you should be fine installing mongodb-org-shell only.

查看更多
登录 后发表回答