Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ Source MongoDB 3.2.1 installed on CentOS6.5     - Windows environment Android Studio v1.0 Installation Guide (Linux)

- VMware Workstation + Ubuntu 10.04 Download the Android 2.2 source code (Linux)

- ARP spoofing prevent Linux environment LAN (Linux)

- Binary Tree Traversal (Linux)

- Installation of network monitoring ntopng under CentOS 6.4 (Linux)

- Strategy Games Ubuntu installation of Wesnoth 1.12.1 (Linux)

- Memcached distributed caching (Server)

- Ubuntu 14.04 installed Nvidia CUDA 7.5 and build Python Theano deep learning development environment (Linux)

- xargs Detailed description (Linux)

- The Sublime Text 3 configuration file (Linux)

- Elaborate .NET Multithreading: Using Task (Programming)

- Linux system package manager (rpm, yum, source packages installation) (Linux)

- Git / Github use notes (Linux)

- Method under Linux GCC Compiler shared library function export control (Programming)

- iOS constants, variables, properties and characteristics (Programming)

- How do I delete a NEEDS RECOVERY rollback state of undo tablespace (Database)

- Oracle metadata Reconstruction experiments (Database)

- Mind mapping software installed in CentOS 7 in XMind (Linux)

- curl Usage: Being the first site header and status codes (Server)

- Ubuntu derivative version of the user and how to install SmartGit / HG 6.0.0 (Linux)

  Source MongoDB 3.2.1 installed on CentOS6.5
  Add Date : 2018-11-21      
  1. Prepare the environment:

mkdir / home / mongodb # Create a directory to store program MongoDB
mkdir / data / mongodata -p # Create a data storage directory
mkdir / data / log / mongolog -p # create a log storage directory

curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.1.tgz
3, mounting:

tar xf mongodb-linux-x86_64-3.2.1.tgz
cd mongodb-linux-x86_64-3.2.1
cp -r * / home / mongodb
In order to facilitate the command starts, you need to edit global variables PATH

vim /etc/profile.d/mongo.sh
export PATH = $ PATH: / home / mongodb / bin
source /etc/profile.d/mongo.sh
4, start the service

First check mongod help information

[Root @ test ~] # mongod --help

General options:
  -h [--help] show this usage information
  --version show version information
   -f [--config] arg configuration file specifying
                                        additional options
  -v [--verbose] [= arg (= v)] be more verbose (include multiple times
                                        for more verbosity e.g. -vvvvv)
   --quiet quieter output
  --port arg # mongodb services specified port number, default is: 27017
   --bind_ip arg # on a multi-card machines where a designated mongodb service binding on ip
   --ipv6 enable IPv6 support (disabled by
   --maxConns arg # Specify the maximum number of client connections
   --logpath arg # specify the log file path must be a file instead of a directory
   --syslog log to system's syslog facility instead
                                         of file or stdout
   --syslogFacility arg syslog facility used for mongodb syslog
   --logappend # to print the log to additional --logpath parameter specifies the log file
   --logRotate arg set the log rotation behavior
                                         (Rename | reopen)
   --timeStampFormat arg Desired format for timestamps in log
                                         messages. One of ctime, iso8601-utc or
   --pidfilepath arg full path to pidfile (if not set, no
                                         pidfile is created)
   --keyFile arg private key for cluster authentication
   --setParameter arg Set a configurable parameter
   --httpinterface enable http interface
   --clusterAuthMode arg Authentication mode used for cluster
                                         authentication. Alternatives are
                                         (KeyFile | sendKeyFile | sendX509 | x509)
   --nounixsocket disable listening on unix sockets
   --unixSocketPrefix arg alternative directory for UNIX domain
                                         sockets (defaults to / tmp)
   --filePermissions arg permissions to set on UNIX domain
                                         socket file - 0700 by default
   --fork # run as a daemon process in the form of services
   --auth run with security
   --noauth run without security
   --jsonp allow JSONP access via http (has
                                         security implications)
   --rest turn on simple rest api
   --slowms arg (= 100) value of slow for profile and console
   --profile arg 0 = off 1 = slow, 2 = all
   --cpu periodically show cpu and iowait
   --sysinfo print some diagnostic system
   --noIndexBuildRetry do not retry any index builds that were
                                         interrupted by shutdown
   --noscripting disable scripting engine
   --notablescan do not allow table scans
   --shutdown kill a running server (for init
 Replication options:
   --oplogSize arg size to use (in MB) for replication op
                                         log. default is 5% of disk space (i.e.
                                         large is good)
 Master / slave options (old; use replica sets instead):
   --master master mode
   --slave slave mode
   --source arg when slave: specify master as
   --only arg when slave: specify a single database
                                         to replicate
   --slavedelay arg specify delay (in seconds) to be used
                                         when applying master ops to slave
   --autoresync automatically resync if slave data is
 Replica set options:
   --replSet arg arg is [/                                          >]
   --replIndexPrefetch arg specify index prefetching behavior (if
                                         secondary) [none | _id_only | all]
   --enableMajorityReadConcern enables majority readConcern
 Sharding options:
   --configsvr declare this is a config db of a
                                         cluster; default port 27019; default
                                         dir / data / configdb
   --configsvrMode arg Controls what config server protocol is
                                         in use. When set to "sccc" keeps server
                                         in legacy SyncClusterConnection mode
                                         even when the service is running as a
   --shardsvr declare this is a shard db of a
                                        cluster; default port 27018
 Storage options:
   --storageEngine arg what storage engine to use - defaults
                                         to wiredTiger if no data files present
   --dbpath arg # specify the data directory path
   --directoryperdb each database will be stored in a
                                         separate directory
   --noprealloc disable data file preallocation - will
                                         often hurt performance
   --nssize arg (= 16) .ns file size (in MB) for new databases
   --quota limits each database to a certain
                                         number of files (8 default)
   --quotaFiles arg number of files allowed per db, implies
   --smallfiles use a smaller default file size
   --syncdelay arg (= 60) seconds between disk syncs (0 = never,
                                         but not recommended)
   --upgrade upgrade db if needed
   --repair run repair on all dbs
   --repairpath arg root directory for repair files -
                                         defaults to dbpath
   --journal enable journaling
   --nojournal disable journaling (journaling is on by
                                         default for 64 bit)
   --journalOptions arg journal diagnostic options
   --journalCommitInterval arg how often to group / batch commit (ms)
 WiredTiger options:
   --wiredTigerCacheSizeGB arg maximum amount of memory to allocate
                                         for cache; defaults to 1/2 of physical
   --wiredTigerStatisticsLogDelaySecs arg (= 0)
                                         seconds to wait between each write to a
                                         statistics file in the dbpath; 0 means
                                         do not log statistics
   --wiredTigerJournalCompressor arg (= snappy)
                                         use a compressor for log records
                                         [None | snappy | zlib]
   --wiredTigerDirectoryForIndexes Put indexes and data in different
   --wiredTigerCollectionBlockCompressor arg (= snappy)
                                         block compression algorithm for
                                         collection data [none | snappy | zlib]
   --wiredTigerIndexPrefixCompression arg (= 1)
                                         use prefix compression on row-store
                                         leaf pages
Start Service example:

mongod --dbpath = / data / mongodata --logpath = / data / log / mongolog / mongodb.log --logappend --fork
Check whether to activate:

netstat -tnlp | grep mongod
tcp 0 0* LISTEN 17909 / mongod
As can be seen above the port 27017 is already running

5, the test

Start mongodb the shell:

 [Root @ test ~] # mongo
 MongoDB shell version: 3.2.1
 connecting to: test
 Server has startup warnings:
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten]
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten]
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten] ** WARNING: / sys / kernel / mm / transparent_hugepage / enabled is 'always'.
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten]
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten] ** WARNING: / sys / kernel / mm / transparent_hugepage / defrag is 'always'.
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten] ** We suggest setting it to 'never'
 2016-01-25T16: 12: 52.960 + 0800 I CONTROL [initandlisten]
 > Help
     db.help () help on db methods
     db.mycoll.help () help on collection methods
     sh.help () sharding helpers
     rs.help () replica set helpers
     help admin administrative help
     help connect connecting to a db help
     help keys key shortcuts
     help misc misc things to know
     help mr mapreduce
     show dbs show database names
     show collections show collections in current database
     show users show users in current database
     show profile show most recent system.profile entries with time> = 1ms
     show logs show the accessible logger names
     show log [name] prints out the last segment of log in memory, 'global' is default
     use set current database
     db.foo.find () list objects in collection foo
     db.foo.find ({a: 1}) list objects in foo where a == 1
     it result of the last line evaluated; use to further iterate
     DBQuery.shellBatchSize = x set default number of items to display on shell
     exit quit the mongo shell
 > Show dbs
 local 0.000GB
So far, MongoDB3.2.1 installed.
- Sniffer Linux Environment (Linux)
- Open Ubuntu system updates (Linux)
- How to Check notebook CPU temperature in Ubuntu (Linux)
- Install Java, Maven, Tomcat under Linux (Linux)
- There are three ways to run a Linux operating system from a USB stick (Linux)
- Linux mention the right notes (Linux)
- MySQL use the integer type (Database)
- Getting Started with Linux: Learn how to install and access CentOS 7 Remote Desktop on a VPS (Server)
- Under CentOS using yum command to install the Task Scheduler crontab (Linux)
- Linux top command to get started (Linux)
- Puppet installation and testing (Server)
- The Java ThreadLocal (Programming)
- Troubleshooting Linux virtual machine device id and the letter of inconsistencies (Linux)
- VMware difference in three network connection (Linux)
- CentOS 6.5 / Linux restart network card being given Determining if ip address x.x.x.x is already in use (Linux)
- Python common data type summary (Programming)
- Spark read more HBase tables a RDD (Server)
- Apache Tomcat integration and resin (Server)
- How to publish projects to the Jcenter repository using Gradle in Android Studio (Programming)
- Let the terminal under Mac OS X as like Linux has displayed a variety of colors (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.