Changing the Log and Storage Directories for MongoDB on macOS

Open a terminal session and open /usr/local/etc/mongod.conf

systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1

Make the required changes to path and dbPath and start/restart your service.

systemLog:
  destination: file
  path: /Users/mark/devops/mongo-logs/mongo.log
  logAppend: true
storage:
  dbPath: /Users/mark/devops/mongo-data
net:
  bindIp: 127.0.0.1

Installing MongoDB on macOS

To install MongoDB on macOS (if you have Homebrew installed (https://brew.sh/):

brew tap mongodb/brew

This will clone the github repo. Once the command finishes you can issue the command to install mongodb-community. The following will install the latest version of the community edition.

brew install mongodb-community

In order to start the mongo service and restart on login run the following: –

brew services start mongodb/brew/mongodb-community

If you don’t want to run as a background service then run:

mongod --config /usr/local/etc/mongod.conf

Installing Jenkins on macOS

The old method of installing Jenkins is not deprecated in favour of a Homebrew installation.

Install Homebrew as per this arcticle https://markjesson.co.uk/2020/02/27/installing-homebrew-on-macos/

Start by running:

brew install jenkins-lts

You should see output similar to the following: –

==> Downloading http://mirrors.jenkins.io/war-stable/2.204.2/jenkins.war
==> Downloading from http://mirror.serverion.com/jenkins/war-stable/2.204.2/jenk
######################################################################## 100.0%
==> jar xvf jenkins.war
==> Caveats
Note: When using launchctl the port will be 8080.

To have launchd start jenkins-lts now and restart at login:
  brew services start jenkins-lts
Or, if you don't want/need a background service you can just run:
  jenkins-lts
==> Summary
🍺  /usr/local/Cellar/jenkins-lts/2.204.2: 7 files, 63.9MB, built in 37 seconds

Start Jenkins using the following command: –

brew services start jenkins-lts

Jenkins will now be available on: http://localhost:8080. Follow the customisation prompts to complete the installation.

You can restart by running:

brew services restart jenkins-lts

Or update by running:

brew upgradejenkins-lts

Useful links:

https://jenkins.io

https://brew.sh