March 29, 2020

My MongoDB notes

On my Fedora linux system (Fedora 30), I want to install MongoDB and play around. The first thing is to add a repo file for Mongo, it is not part of the usual dnf/yum collection. I create /etc/yum.repos.d/mongodb.repo as follows:
[Mongodb]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/4.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
Then I give the command:
dnf install mongodb-org
systemctl enable mongod.service
systemctl start mongod.service
I can check the version by typing:
mongod --version
I can run an interactive shell via:
mongo
Looking at running processes on my machine:
ps -alx | grep mongo
1   970 15207     1  20   0 1491428 95364 -     Sl   ?         15:55 /usr/bin/mongod -f /etc/mongod.conf
Some interesting lines in mongod.conf:
storage:
  dbPath: /var/lib/mongo

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
There are a number of files in /var/lib/mongo, none look particularly interesting at this time.
Feedback? Questions? Drop me a line!

MySQL notes / tom@mmto.org