[MongoDB]: 3.0 Installation
[srinivas@dbversitydotcom ~]$ curl -O http://downloads.mongodb.org/linux/mongodb-linux-x86_64-3.0.1.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 37.7M 100 37.7M 0 0 12.3M 0 0:00:03 0:00:03 –:–:– 12.3M
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$ ll -lhtr
total 38M
-rw-rw-r–. 1 srinivas srinivas 38M Apr 1 14:08 mongodb-linux-x86_64-3.0.1.tgz
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$ tar -zxvf mongodb-linux-x86_64-3.0.1.tgz
mongodb-linux-x86_64-3.0.1/README
mongodb-linux-x86_64-3.0.1/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-3.0.1/GNU-AGPL-3.0
mongodb-linux-x86_64-3.0.1/bin/mongodump
mongodb-linux-x86_64-3.0.1/bin/mongorestore
mongodb-linux-x86_64-3.0.1/bin/mongoexport
mongodb-linux-x86_64-3.0.1/bin/mongoimport
mongodb-linux-x86_64-3.0.1/bin/mongostat
mongodb-linux-x86_64-3.0.1/bin/mongotop
mongodb-linux-x86_64-3.0.1/bin/bsondump
mongodb-linux-x86_64-3.0.1/bin/mongofiles
mongodb-linux-x86_64-3.0.1/bin/mongooplog
mongodb-linux-x86_64-3.0.1/bin/mongoperf
mongodb-linux-x86_64-3.0.1/bin/mongod
mongodb-linux-x86_64-3.0.1/bin/mongos
mongodb-linux-x86_64-3.0.1/bin/mongo
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$ mkdir -p mongodb
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$ cp -R -n mongodb-linux-x86_64-3.0.1/ mongodb
[srinivas@dbversitydotcom ~]$
[srinivas@dbversitydotcom ~]$ cd mongodb-linux-x86_64-3.0.1/bin/
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ ll -lhtr
total 113M
-rwxr-xr-x. 1 srinivas srinivas 4.1M Mar 16 11:21 bsondump
-rwxr-xr-x. 1 srinivas srinivas 5.5M Mar 16 11:21 mongostat
-rwxr-xr-x. 1 srinivas srinivas 5.6M Mar 16 11:21 mongofiles
-rwxr-xr-x. 1 srinivas srinivas 5.6M Mar 16 11:22 mongoexport
-rwxr-xr-x. 1 srinivas srinivas 5.8M Mar 16 11:22 mongoimport
-rwxr-xr-x. 1 srinivas srinivas 5.9M Mar 16 11:22 mongorestore
-rwxr-xr-x. 1 srinivas srinivas 5.8M Mar 16 11:22 mongodump
-rwxr-xr-x. 1 srinivas srinivas 5.4M Mar 16 11:22 mongotop
-rwxr-xr-x. 1 srinivas srinivas 5.3M Mar 16 11:22 mongooplog
-rwxr-xr-x. 1 srinivas srinivas 22M Mar 16 11:29 mongoperf
-rwxr-xr-x. 1 srinivas srinivas 22M Mar 16 11:29 mongod
-rwxr-xr-x. 1 srinivas srinivas 11M Mar 16 11:29 mongos
-rwxr-xr-x. 1 srinivas srinivas 12M Mar 16 11:29 mongo
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ pwd
/home/srinivas/mongodb-linux-x86_64-3.0.1/bin
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ mkdir data
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ export PATH=/home/srinivas/mongodb-linux-x86_64-3.0.1/bin:$PATH
[srinivas@dbversitydotcom bin]$ ./mongod –dbpath /home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data –logpath mongodb.log –smallfiles –nojournal &
[1] 11129
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ ll -lhtr
total 113M
-rwxr-xr-x. 1 srinivas srinivas 4.1M Mar 16 11:21 bsondump
-rwxr-xr-x. 1 srinivas srinivas 5.5M Mar 16 11:21 mongostat
-rwxr-xr-x. 1 srinivas srinivas 5.6M Mar 16 11:21 mongofiles
-rwxr-xr-x. 1 srinivas srinivas 5.6M Mar 16 11:22 mongoexport
-rwxr-xr-x. 1 srinivas srinivas 5.8M Mar 16 11:22 mongoimport
-rwxr-xr-x. 1 srinivas srinivas 5.9M Mar 16 11:22 mongorestore
-rwxr-xr-x. 1 srinivas srinivas 5.8M Mar 16 11:22 mongodump
-rwxr-xr-x. 1 srinivas srinivas 5.4M Mar 16 11:22 mongotop
-rwxr-xr-x. 1 srinivas srinivas 5.3M Mar 16 11:22 mongooplog
-rwxr-xr-x. 1 srinivas srinivas 22M Mar 16 11:29 mongoperf
-rwxr-xr-x. 1 srinivas srinivas 22M Mar 16 11:29 mongod
-rwxr-xr-x. 1 srinivas srinivas 11M Mar 16 11:29 mongos
-rwxr-xr-x. 1 srinivas srinivas 12M Mar 16 11:29 mongo
drwxrwxr-x. 3 srinivas srinivas 83 Apr 1 15:41 data
-rw-rw-r–. 1 srinivas srinivas 2.2K Apr 1 15:41 mongodb.log
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ ls -lhtr data/
total 33M
-rwxrwxr-x. 1 srinivas srinivas 6 Apr 1 15:41 mongod.lock
-rw-rw-r–. 1 srinivas srinivas 69 Apr 1 15:41 storage.bson
drwxrwxr-x. 2 srinivas srinivas 6 Apr 1 15:41 _tmp
-rw——-. 1 srinivas srinivas 16M Apr 1 15:41 local.ns
-rw——-. 1 srinivas srinivas 16M Apr 1 15:41 local.0
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ cat mongodb.log
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] MongoDB starting : pid=11129 port=27017 dbpath=/home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data 64-bit host=dbversitydotcom.us-west-2.compute.internal
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten]
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is ‘always’.
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten]
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is ‘always’.
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] ** We suggest setting it to ‘never’
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten]
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] db version v3.0.1
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] git version: 534b5a3f9d10f00cd27737fbcd951032248b5952
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] build info: Linux build16.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] allocator: tcmalloc
2015-04-01T15:41:17.834-0400 I CONTROL [initandlisten] options: { storage: { dbPath: “/home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data”, journal: { enabled: false }, mmapv1: { smallFiles: true } }, systemLog: { destination: “file”, path: “mongodb.log” } }
2015-04-01T15:41:17.859-0400 I INDEX [initandlisten] allocating new ns file /home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data/local.ns, filling with zeroes…
2015-04-01T15:41:18.146-0400 I STORAGE [FileAllocator] allocating new datafile /home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data/local.0, filling with zeroes…
2015-04-01T15:41:18.146-0400 I STORAGE [FileAllocator] creating directory /home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data/_tmp
2015-04-01T15:41:18.148-0400 I STORAGE [FileAllocator] done allocating datafile /home/srinivas/mongodb-linux-x86_64-3.0.1/bin/data/local.0, size: 16MB, took 0 secs
2015-04-01T15:41:18.155-0400 I NETWORK [initandlisten] waiting for connections on port 27017
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$
[srinivas@dbversitydotcom bin]$ ./mongo
MongoDB shell version: 3.0.1
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type “help”.
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
>
>
> show dbs
local 0.031GB
>
> use dbversity
switched to db dbversity
>
>
> db.newcol.insert({ user_id : 1, user : “dbversity”, dbtype : “NoSQL”, dbname : “MongoDB”, features : [ “schema less”, “dynamic Schema”, “horizontally scalable” ] })
WriteResult({ “nInserted” : 1 })
>
>
> db.newcol.find()
{ “_id” : ObjectId(“551c4b05c42909dae4112ad5”), “user_id” : 1, “user” : “dbversity”, “dbtype” : “NoSQL”, “dbname” : “MongoDB”, “features” : [ “schema less”, “dynamic Schema”, “horizontally scalable” ] }
>
> db.newcol.find().pretty()
{
“_id” : ObjectId(“551c4b05c42909dae4112ad5”),
“user_id” : 1,
“user” : “dbversity”,
“dbtype” : “NoSQL”,
“dbname” : “MongoDB”,
“features” : [
“schema less”,
“dynamic Schema”,
“horizontally scalable”
]
}
>
>