CentOS 6 installs MongoDB and server-side configuration with Yum

Source: Internet
Author: User
Tags install mongodb mongodb server mongo shell

There are many ways to install MongoDB, you can install the source code, and you can use the Yum source installation method in CentOS. 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 [root@localhost ~]# Yum info mongo-10gen

(Hint that there is no matching information) that the Yum source in your CentOS system does not contain MONGODB resources, so you need to add the Yum source before installing MongoDB with the Yum command, which means adding *.repo in the/etc/yum.repos.d/directory 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

[email protected] 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 files, and INIT.D scripts.
To view client installation conditions
[Email protected] 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,
: Replication 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
[email protected] geffzhang]# Yum install Mongo-10gen-server

[email protected] 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

    1. # mongo.conf
    2. #where to log
    3. Logpath=/var/log/mongo/mongod.log
    4. Logappend=true #以追加方式写入日志
    5. # fork and run in background
    6. Fork = True
    7. #port = 27017 #端口
    8. Dbpath=/var/lib/mongo #数据库文件保存位置
    9. Directoryperdb=true
    10. # Enables periodic logging of CPU utilization and I/O wait
    11. #启用定期记录CPU利用率和 I/O waits
    12. #cpu = True
    13. # Turn on/off security. OFF is currently the default
    14. # whether to run in secure authentication mode, default is non-secure way of authentication
    15. #noauth = True
    16. #auth = True
    17. # Verbose logging output.
    18. # Verbose record output
    19. #verbose = True
    20. # Inspect all client data for validity in receipt (useful for
    21. # Developing drivers) Check the validity of the client receiving data when developing the driver
    22. #objcheck = True
    23. # Enable DB quota management enables database quota management, with a default of 8 files per db, which can be set with the Quotafiles parameter
    24. #quota = True
    25. # Set Oplog record level
    26. # Set oplogging level where n is
    27. # 0=off (default)
    28. # 1=w
    29. # 2=r
    30. # 3=both
    31. # 7=w+some Reads
    32. #oplog = 0
    33. # diagnostic/debugging option Dynamic Debug Item
    34. #nocursors = True
    35. # Ignore Query hints ignore queries hint
    36. #nohints = True
    37. # Disable HTTP interface, default to localhost:28017
    38. # Disable The HTTP interface (Defaults to localhost:27018). This port number is wrong.
    39. #nohttpinterface = True
    40. # Close the server-side script, which will greatly limit the functionality
    41. # Turns off server-side scripting. This would result in greatly limited
    42. # functionality
    43. #noscripting = True
    44. # Close Scan table, any query will be scan failed
    45. # Turns off table scans. Any query this would do a table scan fails.
    46. #notablescan = True
    47. # Close data file pre-allocation
    48. # Disable data File preallocation.
    49. #noprealloc = True
    50. # Specify the size of the. ns file for the new database, in MB
    51. # specify. ns file size for new databases.
    52. # nssize = <size>
    53. # Accout token for Mongo monitoring server.
    54. #mms-token = <token>
    55. # MONGO the name of the monitoring server
    56. # server name for Mongo monitoring server.
    57. #mms-name = <server-name>
    58. # MONGO The ping interval of the monitoring server
    59. # Ping interval for Mongo monitoring server.
    60. #mms-interval = <seconds>
    61. # Replication Options Copy option
    62. # in replicated MONGO databases, specify here whether the is a slave or master in replication, specifies that the current is a dependency
    63. #slave = True
    64. #source = master.example.com
    65. # Slave only:specify A single database to replicate
    66. #only = master.example.com
    67. # or
    68. #master = True
    69. #source = slave.example.com

CentOS 6 installs MongoDB and server-side configuration with Yum

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.