Linux under MongoDB installation __linux

Source: Internet
Author: User
Tags auth mongodb time interval
The following installation methods are not recommended. See my other blogs, Debian and Ubuntu installation MongoDB
1. Download installation package
32-digit: wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-3.2.7.tgz 64:
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian81-3.2.9.tgz
After the download is complete, unzip the compressed package 32:tar zxf mongodb-linux-i686-3.2.7.tgz 64:tar zxf 2. Installation is ready to move MongoDB to/usr/local/mongdb folder 32:MV Mongodb-linux-i686-1.8.2/usr/local/mongodb 64:mvmongodb-linux-x86_64- DEBIAN81-3.2.9/USR/LOCAL/MONGODB Create the database folder with the log file Mkdir/usr/local/mongodb/data touch/usr/local/mongodb/logs 3. Set boot up to MongoDB startup entry rc.local guarantee MongoDB start echo "/usr/local/mongodb/bin/mongod on server boot"--dbpath=/usr/local/mongodb/ Data–logpath=/usr/local/mongodb/logs–logappend--auth–port=27017 ">>/etc/rc.local 4. Start MongoDB CD to the Bin folder in the MongoDB directory boot MongoDB//This is a/usr/local/mongodb/bin/mongod that does not require a password--dbpath=/usr/local/mongodb/data --logpath=/usr/local/mongodb/logs--logappend--port=27017--fork--journal--storageengine = Mmapv1

5. Parameter explanation:--dbpath database path (data file)--logpath log file path--master Specifies the primary machine--slave specified as the IP address of the host machine from the machine--source the specified log file size does not exceed 6 4M. Because Resync is very large and time-consuming, it is best to avoid resync by setting a large enough oplogsize (the default oplog size is 5% of the size of the free disk). --logappend the end of the log file add--port enable the port number--fork run in the background--only specify which database to replicate only--slavedelay whether to log in from the time interval of replication detection--auth If authentication permission is required (username and password)

-H [--help]             Show-usage information--version                 show version information-f [--config] arg       configuration file Specifyi ng additional options--port arg                specify port number--bind_ip arg             Local IP addresses to bind Listener-all local IPs         &N Bsp                  bound by default-v [--verbose]       &NBSP ;  be more verbose (include multiple times for more                   &NBS P        verbosity e.g.-vvvvv)--dbpath arg (=/data/db/) directory for datafiles     Specify data storage directory --quiet                   quieter output   silent mode--logpath arg   &NB Sp   &NBSp     file to send all output to instead of stdout   specify log storage directory--logappend               APPND to LogPath instead of over-writing Specify whether the log is written to the log file in append or overlay--fork           &N Bsp        fork server process   run by creating a subprocess--cpu               & nbsp     periodically show CPU and iowait utilization periodic display CPU and IO usage--noauth           & nbsp      run without security no certification mode run--auth                   &NB Sp;run with security authentication mode run--objcheck                inspect client data for Vali Dity on receipt Check client input data for validity check--quota                   Enable DB quota man Agement   Starting database quota management--quotafiles ARG          number of files Allower per db, requires--qu Ota Specify the number of files allowed per database--appsrvpath arg          root directory for the Babble app server --nocurso RS               diagnostic/debugging option Debug Diagnostics--nohints       &NBS P         Ignore query hints ignore query hit rate--nohttpinterface         Disable HTTP INTERFAC E shut down HTTP interface, default is 28017--noscripting             Disable scripting engine shutdown script engine--noprealloc & nbsp            disable data file preallocation Close database file size pre-allocation--smallfiles       &N Bsp      use A smaller default file size--nssize arg (=16)        .NS file siz E (in megabytes) for new databases The default size of the newly-ns file--diaglog arg             0=off 1=w 2=r 3=both 7=w +some reads provides a way to read only, write only, or read or write, or mainly write + part of the read mode--sysinfo                 Print some Diagnostic System Information Print system diagnostics--upgrade                 Upgrade db if needed if needed New database--repair                  run repair on all DBS repair all databases--notablescan & nbsp           Don't allow table scans not run table Scan--syncdelay arg (=60)     seconds between dis K syncs (0 for never) system sync Refresh Disk Time, default is 60s
Replication options:--master Master Mode primary replication mode--slave slave mode from replication mode--source arg When Slave:specify Master as <server:port> when from, specify the address and port--only Arg when slave:specify a single Databa Se to replicate when from, specify a single library that needs to be copied from the primary--pairwith ARG address of the server to pair with--arbiter arg address of AR       biter server quorum servers, using the--autoresync automatically resync if slave the data is stale automatic synchronization from the primary and pair--oplogsize arg Size limit (in MB) for OP log specifies the size of the action log--opidmem arg size limit (in bytes) for in memory storage of OP IDs Specify the memory size of the storage action log
Sharding options:--configsvr           Declare this is a config db of cluster specify the configuration server in Shard --shardsvr            declare This is a shard db of a cluster specify Shard server   6. Go to the Database CLI management interface CD to the Bin folder in the MongoDB directory and execute the command./mongo
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.