a)yum install cyrus-sasl cyrus-sasl-plain cyrus-sasl-gssapi krb5-libs libcurl libpcap net-snmp openldap openssl
b)Download Mongo DB & Extract The TAR
cd $HOME
curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.4.tgz
cd /mongo/
tar -zxvf /home/mongo/mongodb-linux-x86_64-3.4.4.tgz
cp -R -n mongodb-linux-x86_64-3.4.4/ mongodb
c)Add the PATH in /home/mongo/.bash_profile
PATH=/mongo/mongodb/bin:$PATH
d) Create the datafile folder /mongo/data. If we dont specify dbpath ,it will try to use the default value /data/db.
e)Start the Mongo DB.Run the mongod process at the system prompt.
mongod --dbpath /mongo/data --logpath /tmp/mongo.log --logappend --rest --fork
--dbpath -> Path to our datafiles.
--logpath -->Log file Path
--logappend --> Appending log content to the existing log.
--rest -->Which will enable http interface to the port 28017(default).We can access it http://localhost:28017
--fork --> It will create the child process and run in background.
If we use above command ,datafile from all our databases will be under /mongo/data. If we want to split the datafiles based on database,we have to
specify the parameter directoryperdb.It will create sub folder with dbname under dbpath.
Ex: mongod --dbpath /mongo/new_data --logpath /tmp/mongo.log --logappend --rest --directoryperdb
[mongo@r12 new_data]$ ls -ld *
drwxrwxr-x 2 mongo mongo 4096 Jun 10 12:38 admin
drwxrwxr-x 2 mongo mongo 4096 Jun 10 13:49 diagnostic.data
drwxrwxr-x 2 mongo mongo 4096 Jun 10 12:38 journal
drwxrwxr-x 2 mongo mongo 4096 Jun 10 12:38 local
b)Download Mongo DB & Extract The TAR
cd $HOME
curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.4.tgz
cd /mongo/
tar -zxvf /home/mongo/mongodb-linux-x86_64-3.4.4.tgz
cp -R -n mongodb-linux-x86_64-3.4.4/ mongodb
c)Add the PATH in /home/mongo/.bash_profile
PATH=/mongo/mongodb/bin:$PATH
d) Create the datafile folder /mongo/data. If we dont specify dbpath ,it will try to use the default value /data/db.
e)Start the Mongo DB.Run the mongod process at the system prompt.
mongod --dbpath /mongo/data --logpath /tmp/mongo.log --logappend --rest --fork
--dbpath -> Path to our datafiles.
--logpath -->Log file Path
--logappend --> Appending log content to the existing log.
--rest -->Which will enable http interface to the port 28017(default).We can access it http://localhost:28017
--fork --> It will create the child process and run in background.
If we use above command ,datafile from all our databases will be under /mongo/data. If we want to split the datafiles based on database,we have to
specify the parameter directoryperdb.It will create sub folder with dbname under dbpath.
Ex: mongod --dbpath /mongo/new_data --logpath /tmp/mongo.log --logappend --rest --directoryperdb
[mongo@r12 new_data]$ ls -ld *
drwxrwxr-x 2 mongo mongo 4096 Jun 10 12:38 admin
drwxrwxr-x 2 mongo mongo 4096 Jun 10 13:49 diagnostic.data
drwxrwxr-x 2 mongo mongo 4096 Jun 10 12:38 journal
drwxrwxr-x 2 mongo mongo 4096 Jun 10 12:38 local
No comments:
Post a Comment