MongoDB running but can't connect using shell

前端 未结 17 1702
甜味超标
甜味超标 2020-12-23 16:45

CentOS 5.x Linux with MongoDB 2.0.1 (tried main and legacy-static)

MongoDB is running:

root     31664  1.5  1.4  81848 11148 ?        Sl   18:40   0:         


        
17条回答
  •  攒了一身酷
    2020-12-23 17:14

    If your mongoDB server(remote server)'s version is greater then 4.0.3, then you will face this issue. Hence you should replace your current mongo-client shell with below mongo :

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
    echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
    sudo apt-get update
    sudo apt-get install -y mongodb-org
    

    Then you mongo client will be able to connect your remove mongodb

提交回复
热议问题