Matthew Haywood
Matthew Haywood

Reputation: 46

Running a mongodb server on Raspberry pi 4

I am trying to run a MongoDB server with a node.js server and express on a Raspberry Pi 4. I have installed the MongoDB server using sudo apt-get install mongodb. When I try to start the node server I get the following error.

MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoError: Server at localhost:27017 reports maximum wire version 0, but this version of the Node.js Driver requires at least 2 (MongoDB 2.6)]

I have read that it is because of the MongoDB version which is db version v2.4.14. I have tried updating by removing the old mongodb and following instructions at https://hevodata.com/blog/install-mongodb-on-ubuntu/ and doing sudo apt-get install -y mongodb-org, however I then get this error on the terminal:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mongodb-org

Upvotes: 2

Views: 2483

Answers (1)

Mike Yan
Mike Yan

Reputation: 1699

As my best known, mongodb 4 need to run on 64-bit Linux.

If you are using Raspbian or similar OS installed by noobs, it should be all in 32-bit.

You can only use some old version of mongodb (latest version of mongodb 32 bit is 3.2), or you can try to install some 64-bit Linux on your own.

You can try the method on this website. https://andyfelong.com/2019/03/mongodb-4-0-6-64-bit-on-raspberry-pi-3/

Upvotes: 2

Related Questions