installationMongodbThere are many ways to install the source code,CentosYou can also use the Yum source installation method. Since MongoDB is updated more quickly, I prefer to use the Yum source installation method. The installation steps under 64-bit CentOS are as follows:
1. Preparatory work
run the Yum command to view MongoDB package information [email protected]~]# yum Info Mongo-10gen
(hint that there is no matching information) that the Yum source in your CentOS system does not contain MONGODB-related resources, so you need to increase the Yum source before installing MongoDB with the Yum command, that is, add * in the/etc/yum.repos.d/directory. Repo Yum Source configuration file
2, Vi/etc/yum.repos.d/10gen.repo, enter the following statement:
[10gen] name = 10gen Repository baseurl=http:// downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0
after you have configured the Yum source, you can query MongoDB-related information if the configuration correctly executes the following command:
View information for a MONGODB server package
[root@localhost geffzhang]# yum Info mongo-10gen-server
* base:centos.ustc.edu.cn
* extras:centos.ustc.edu.cn
* updates:centos.ustc.edu.cn
installed Packages
Name:mongo-10gen-server
arch:x86_64
version:2.0.6
release:mongodb_1
size:13 M
repo:installed
From Repo:10gen
Summary:mongo Server, sharding server, and support scripts
url:http://www.mongodb.org
LICENSE:AGPL 3.0
Description:mongo (from "humongous") is a schema-free document-oriented
: Database.
:
: This package provides the MONGO server software, MONGO sharding
: Server Softwware, default configuration
file s, and INIT.D scripts.
To view Client installation conditions
[root@localhost geffzhang]#
* base:centos.ustc.edu.cn
* extras:centos.ustc.edu.cn
* updates:centos.ustc.edu.cn
installed Packages
Name:mongo-10gen
arch:x86_64
version:2.0.6
release:mongodb_1
size:69 M
repo:installed
From Repo:10gen
Summary:mongo client shell and tools
url:http://www.mongodb.org
LICENSE:AGPL 3.0
Description:mongo (from "humongous") is a schema-free document-oriented
: Database. IT features dynamic profileable queries, full indexing,
: Repli
Cat Ion and fail-over support, efficient storage of large
: Binary Data Objects, and auto-sharding.
:
: This package provides the MONGO shell, Import/export tools, and
: Other client utilities.
3. Installing MongoDB server side and client Tools
[root@localhost geffzhang]# yum install mongo-10gen-server
[root@localhost geffzhang]# yum install Mongo-10gen
4. Start MongoDB
Service Mongod Start
updated later, stop MongoDB, execute yum update Mongo-10gen mongo-10gen-server.
5, server configuration:/etc/mongod.conf
# mongo.conf #where to Loglogpath=/var/log/mongo/mongod.log logappend=true #以追加方式写入日志 # Fork and run in backgroundfork = t Rue #port = 27017 #端口 dbpath=/var/lib/mongo #数据库文件保存位置directoryperdb =true# enables periodic logging of CPU utilization and I/O wait# enable periodic logging of CPU utilization and I/O waits #cpu = true # Turn on/off security. Off is currently if the default# is running in a secure authentication mode, the default is non-certified unsafe way #noauth = True#auth = true # Verbose logging output.# verbose logging output #verbose = true # Inspect all client data for validity on receipt (useful for# developing drivers) checks the validity of the client receiving data when developing the driver #objcheck = true # Enable DB quota management enables database quota management, default per db can have 8 files, can be set with quotafiles parameter #quota = true# set oplog record level # set oplogging le Vel where n is# 0=off (default) # 1=w# 2=r# 3=both# 7=w+some reads#oplog = 0 # diagnostic/debugging option dynamic Debug Item # Nocursors = true # Ignore queries hints ignore query hint #nohints = true# Disable HTTP interface, default to localhost:28017# Disable the HTTP interface (DEFA Ults to localhost:27018). This port number is written wrong #nohttpinterface = true # Close the server-side script, which will greatly limit the functionality# Turns off server-side scripting. This would result in greatly limited# functionality#noscripting = true# Close the scan table, any query will be scan failed # Turns off table scans. Any query this would do a table scan fails. #notablescan = true# Close the data file pre-allocate # Disable. #noprealloc = t rue# Specifies the size of the. ns file for the new database, in mb# specify. ns files size for new databases.# nssize =; size; # Accout token for Mongo monitoring server. #mms-token =; token;# Mongo the name of the monitoring server # The server name for Mongo monitoring server. #m Ms-name =; server-name;# Mongo Monitoring Server ping interval # ping interval for Mongo monitoring server. #mms-interval =; seconds; # Replication options Copy option # in replicated MONGO databases, specify here whether the is a slave or master in replication, specifies that the current is a dependency #s Lave = True#source = master.example.com# Slave only:specify A single database to Replicate#only = master.example.com# or# master = True#source = slave.example.com
Installing MongoDB and server-side configurations with Yum