Configuration

External database

Install MongoDB & MongoDB Compass

Enable Authentication

use admin
db.createUser(
  {
    user: "admin",
    pwd: passwordPrompt(), // or cleartext password
    roles: [
      { role: "userAdminAnyDatabase", db: "admin" },
      { role: "readWriteAnyDatabase", db: "admin" }
    ]
  }
)

Stop/Shutdown MongoDB

db.adminCommand( { shutdown: 1 } )

Enable authentication in configuration file (mongod.cfg)

security:
  authorization: enabled

Start MongoDB and connect again with MongoDB Compass and the previous created user

Create new user for rtlscloud app

use admin
db.getSiblingDB('rtlscloud').createUser({ user: 'rtlscloud', pwd: passwordPrompt(), roles: [{role: 'readWrite', db: 'rtlscloud'}] })

Create or Update rtlscloud application.yaml

spring:
  mongodb:
    embedded:
      enabled: false
  data:
    mongodb:
      port: 27017
      database: rtlscloud
      username: "rtlscloud"
      password: // cleartext password