The mongodb package included by default in Ubuntu is usually behind.

Follow these instructions to install verion 3.4 from the mongodb repo.

Install from MongoDB repo

Import the public key used by the package management system

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

Create a list file for MongoDB

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

Install package

sudo apt-get update

sudo apt-get install -y mongodb-org

Start

sudo service mongod start

run client (output from a EC2 Instance on AWS):

mongo
ubuntu:~$ mongo
MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.10
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	http://docs.mongodb.org/
Questions? Try the support group
	http://groups.google.com/group/mongodb-user
Server has startup warnings: 
2017-11-06T13:07:22.871+0000 I STORAGE  [initandlisten] 
2017-11-06T13:07:22.871+0000 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2017-11-06T13:07:22.871+0000 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] 
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] 
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] 
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] 
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-11-06T13:07:22.917+0000 I CONTROL  [initandlisten] 

Reference

Categories: TL;DR

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *