Below are the steps to prepare a stand alone mongodb server for cgrates on Debian 8 jessie

Install sudo

 apt-get install sudo 

Import key

w.adsbygoogle || []).push({});
ate" title="">apt-key adv --keyserver hkp:// --recv 0C49F3730359A14518585931BC711F9BA15703C6

Add repository URL

echo "deb jessie/mongodb-org/3.4 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

Update and Install

 apt-get update 
 apt-get install -y mongodb-org 

Enable and Start

 systemctl enable mongod.service 
 systemctl start mongod 

Setting up CGRates User

Create a file cgrates_user.js with the following content

db = db.getSiblingDB('cgrates')
 user: "cgrates",
 pwd: "",
 roles: [ { role: "dbAdmin", db: "cgrates" } ]

Run the following command to create the user

mongo create_user.js

Succesful output will be as follows:

MongoDB shell version v3.4.10
connecting to: mongodb://
MongoDB server version: 3.4.10

Successfully added user: {Successfully added user: { "user" : "cgrates", "roles" : [ { "role" : "dbAdmin", "db" : "cgrates" } ]}

By default mongo server will only listen to localhost, modify that in /etc/mongod.conf

Quick Restart and you’re good to go!

 systemctl restart mongod 


CGRateS Tutorial Series- Installation – Mongo DB Server Install – Debian 8 – Part 1
Tagged on:         

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.