Install ONLY mongo shell, not mongodb

前端 未结 4 1724
时光说笑
时光说笑 2021-02-04 23:26

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

4条回答
  •  灰色年华
    2021-02-05 00:13

    1. Create a repository file at 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 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/

提交回复
热议问题