mongodb is a non-relational database, a lot of people use, the installation under Linux is not simple, many users have suffered some hardships in the Linux system installation and configuration mongodb, the following small series I will introduce you to the installation and configuration method of mongodb.
1. download the package
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz
Unzip the compressed package after the download is complete
tar zxf mongodb-linux-i686-1.8.2.tgz
2. Prepare for installation
Move mongodb to /usr/local /server/mongdb folder
mv mongodb-linux-i686-1.4.4 /usr/local/mongodb
Creating database folders and log files
mkdir /usr /local/mongodb/data
touch /usr/local/mongodb/logs
3. Set boot from boot
Add mongodb boot project to rc.local to ensure mongodb Start when the server is powered on
echo “/usr/local/server/mongodb/bin/mongod –dbpath=/usr/local/server/mongodb/data –
logpath= /usr/local/server/mongodb/logs –logappend –auth –port=27017″ 》” /etc/rc.local
echo “/usr/local/mongodb/bin/mongod &ndash ;dbpath=/usr/local/mongodb/data –
logpat h=/usr/local/mongodb/logs –logappend –auth –port=27017″ 》” /etc/rc.local
4. Start mongodb
cd to mongodb directory The bin folder under the start mongodb
//The following is the login method that requires permission. The user connection requires a username and password
/usr/local/server/mongodb/bin/mongod – Dbpath=/usr/local/server/mongodb/data –
logpath=/usr/local/server/mongodb/logs –logappend –auth –port=27017 –fork
//This is a password that does not require a password
/usr/local/server/mongodb/bin/mongod –dbpath=/usr/local/server/mongodb/data –
Logpath=/usr/local/server/mongodb/logs –logappend –port=27017 –fork
5. Parameter Explanation: –dbpath Database Path (Data File)
&ndash ;logpath log file path
–master specified as the primary machine
–slave specified as slave
–source The IP address of the host
–pologSize specifies that the log file size does not exceed 64M. Because resync is very computationally intensive and time consuming, it is best to avoid by setting a large enough
oplogSize Resync (the default oplog size is 5% of the free disk size).
–logappend Add
–port at the end of the log file Enable port number
–fork Run in the background
–only Specify which to copy only A database
–slavedelay refers to the time interval from replication detection
–auth whether to verify the permission login (username and password)
-h [ --help ] Show this usage information
–version show version information
-f [ --config ] arg configuration file specifying additional options
–port arg specify port number
–bind_ip arg local ip address to bind listener – all local ips
bound by default
-v [ --verbose ] be more verbose (include multiple times for more
verbosity eg -vvvvv)
–dbpath arg (=/data/db/) directory for datafiles Specify data storage directory
–quiet quieter output Silent mode< Br>
&ndash ;logpath arg file to send all output to instead of stdout Specify the log storage directory
–logappend appnd to logpath instead of over-writing Specify whether the log is appended or overridden
Write to log file
Previous12Next page Total 2 pages
Some users have installed BackTrack for their computer, which is a professional Lin
Recently, some netizens found that when using the cd command, they cant enter the d
Recently, in the operation of CentOS system, when downloading files using wget, the
In Linux, a signal is also called a soft interrupt. The process processes the signa
Two methods of Deepin system update
How to use the Linux system swap and zram swap?
How to install fcitx input method under Linux
Linux system how to re-mount var partition
The principle of implementing breakpoint resume in Linux
How Linux implements remote control of shell commands
Summary of tar commands in Linux system
How to use the Linux more command?
CentOS sets the three skills of system time
Really understand the mysterious digital signature in SP2
Red Hat 9.0 configures the Xmanager
How does WinXP delete web history? How to delete web history
What should I do if the win7 search text box is missing?
Modify the registry to let Win7 have a quick start function
Win7 system hard disk changed to ahci mode after the blue screen solution
How to use Momo Lock? Mo Mo Lock uses the tutorial graphic to introduce in detail
Teach you to upgrade the BIOS of the graphics card (2)
Win10 update wireless network card driver tutorial win10 how to update wireless network card driver
Can I make System Restore permanently retain a restore point