LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2014, 11:23 AM   #1
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Rep: Reputation: Disabled
Mongo data base configuration


I am new to MongoDB. I installed mongo in my machine which is running RHEL 6.4. As per the our company wiki, I created following directories:
#mkdir /data/
#mkdir /data/db
#mkdir /data/log
#mkdir /data/arb (As per our company wiki, I am making Mongodb Arbiter server, they told me to create /data/arb directory)

I set up all things as per our wiki instruction. But, I got a feedback from team as:

"The database should be configured to live in /data/xxx", here xxx is 'arb' directory because I am making mongodb arbiter server. What I did is, I made following change in mongod.conf file (shown by arrow line):
------------------------------------------------------------
# mongod.conf

#where to log
#logpath=/var/log/mongodb/mongod.log
logpath=/data/log/mongod.log

logappend=true

# fork and run in background
fork=true

port=30000 <----Port for Arbiter
keyFile=/data/keyfile
#dbpath=/var/lib/mongo <----This was earlier & I comment out it
dbpath=/data/arb <-----------It was added by me

# location of pidfile
pidfilepath=/var/run/mongodb/mongod.pid
- - -
--------------------------------------------------------------
I started the mongod service # service mongod restart and I checked the /data/arb file and found following files inside it.
--------------------------------------------------------------
drwxr-xr-x 2 mongod mongod 4096 May 11 10:11 journal
-rw------- 1 mongod mongod 67108864 May 11 10:11 local.0
-rw------- 1 mongod mongod 16777216 May 11 10:11 local.ns
-rwxr-xr-x 1 mongod mongod 5 May 11 10:11 mongod.lock
---------------------------------------------------------------

NOW, could you please tell me as per the feedback given by team to me in my ticket "The database should be configured to live in /data/arb", Have I done it correctly???

THANK YOU IN ADVANCE

Last edited by linuxmantra; 05-11-2014 at 11:34 AM.
 
Old 05-12-2014, 09:07 AM   #2
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Have you imported database? Can you see the database file in /data/arb
If you have mongo client like rockmongo or similar one, you can import/export database using this.

If you are able to see the data using command line or using client, it means it is configured correctly.
 
Old 05-12-2014, 09:11 AM   #3
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eklavya View Post
Have you imported database? Can you see the database file in /data/arb
If you have mongo client like rockmongo or similar one, you can import/export database using this.

If you are able to see the data using command line or using client, it means it is configured correctly.
Content of my /data/arb:

total 81936
drwxr-xr-x 2 mongod mongod 4096 May 12 08:56 journal
-rw------- 1 mongod mongod 67108864 May 12 08:56 local.0
-rw------- 1 mongod mongod 16777216 May 12 08:56 local.ns
-rwxr-xr-x 1 mongod mongod 5 May 12 08:56 mongod.lock

Did you mean this files?
 
Old 05-12-2014, 09:28 AM   #4
eklavya
Member
 
Registered: Mar 2013
Posts: 619

Rep: Reputation: 136Reputation: 136
Yes these files. It looks correct but when you will import real database and you will be able to access data using browser then it will be confirmed your configuration is fine.
You can create test database and check it.
Quote:
# mongo
MongoDB shell version: 2.2.3
Quote:
> use testdb
switched to db testdb
Quote:
> show dbs
local (empty)
Database “testdb” is not created yet.Define a collection named “users“, and save a dummy document(value) inside.
Quote:
> db.users.save( {username:"testing"} )
Now check the inserted data
Quote:
> db.users.find()
Output will be something like this.
{ "_id" : ObjectId("5370cab552f5c7a7a4378e34"), "username" : "testing" }
Now check list of databases
Quote:
> show dbs
testdb 0.0625GB
local (empty)
Database has been created.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need data base for fedora 12 lalithasankh Linux - Software 18 07-14-2010 05:26 PM
Data base C# archShade Programming 3 05-08-2007 02:35 PM
Data Base Software Help Ingla Linux - Software 15 03-02-2006 05:19 PM
Data base programmin mola Programming 1 06-05-2005 04:31 AM
Manage Data Base in c/c++ saint_devil Programming 3 01-03-2005 10:33 AM


All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration