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 |
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. |
Quote:
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? |
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:
Quote:
Quote:
Database “testdb” is not created yet.Define a collection named “users“, and save a dummy document(value) inside. Quote:
Quote:
{ "_id" : ObjectId("5370cab552f5c7a7a4378e34"), "username" : "testing" } Now check list of databases Quote:
local (empty) Database has been created. |
All times are GMT -5. The time now is 06:21 PM. |