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://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

Add repository URL

echo "deb http://repo.mongodb.org/apt/debian 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')
db.createUser(
 {
 user: "cgrates",
 pwd: "CGRateS.org",
 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://127.0.0.1:27017
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 *