MongoDB: On a C2 with Ubuntu 18.04

UPDATE: MongoDB 4.0.6 on ODROID C2 with Ubuntu 18.04

I use a MongoDB database to analyze data extracted from logs on Linux production servers that handle hundreds of thousands of users per day. I also have databases that I use for research topics. I have pulled data from The British Library and various datasets from the Europeana Collections.

I’ve written before about MongoDB running on a four ODROID-C2 cluster with external SATA drives. That article can be found here: https://andyfelong.com/2017/01/official-mongodb-3-4-on-odroid-c2-under-ubuntu/

I had tried both Arch and Ubuntu flavors of Linux, and pointed out earlier that MongoDB had an official Enterprise Server Version 3.6 for Ubuntu 16.04 ARM 64. As of February 2019, MongoDB Release 4.0.6 is now available for download. Please check the license terms of the “Enterprise Server Version”. There is also a “Community Server” version that might better meet your needs and avoid restrictions. The Community Server install is what is described in this post.

It’s great that MongoDB has an official version for “Ubuntu 16.04 Linux 64-bit ARM 64.” I, however, am running the latest Ubuntu OS for ODROID-C2, Ubuntu 18.04.2 LTS. So, here is the quick and easy way to install the latest MongoDB on your ODROID-C2 running Ubuntu 18.04.

I assume you have not installed MongoDB in any form on your computer before this setup. If you have, do a complete backup, known as a dump, of the databases and remove MongoDB, its utilities, and all directories and files associated with its install.

Make sure your OS is up to date using these commands:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Here are the current Linux version information I am using:
$ uname -a
Linux odroid 3.16.62-35 #1 SMP PREEMPT Wed Jan 23 05:14:46 -02 2019 aarch64 aarch64 aarch64 GNU/Linux
$ cat /etc/os-release
NAME=”Ubuntu”
VERSION=”18.04.2 LTS (Bionic Beaver)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=”Ubuntu 18.04.2 LTS”
VERSION_ID=”18.04″
HOME_URL=”https://www.ubuntu.com/”
SUPPORT_URL=”https://help.ubuntu.com/”
BUG_REPORT_URL=”https://bugs.launchpad.net/ubuntu/”
PRIVACY_POLICY_URL=”https://www.ubuntu.com/legal/terms-and-policies/privacy-policy”
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Import the public key for the Package Management System:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
Add a MongoDB list file from the “xenial” branch, currently there is no MongoDB 4 on the “bionic” branch. Update the packages list. Install any updates and then install MongoDB. Note that “lincurl4” replaced “libcurl3” in Ubuntu 18.04. We need to revert to “libcurl3” for MongoDB 4.0 to install correctly. A simple “apt-get install” will fix this.
$ 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 upgrade
$ sudo apt-get install libcurl3
$ sudo apt-get install -y mongodb-org
You can check versions installed:
$ mongod --version
$ mongo –-version
You can start MongoDB and check its status:
$ sudo service mongod start
$ sudo service mongod status
Run the MongoDB shell:
$ mongo

Be the first to comment

Leave a Reply