热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentOS6系统使用yum方式安装配置mongodb服务器

安装MongoDB的方法有很多种,可以源代码安装,在Centos也可以用yum源安装的方法。由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法。64位Centos下的安装步骤如下:1、准备工作运行yum命令查看MongoDB的包信息[root@server110.com~]#yuminfomongo
安装MongoDB的方法有很多种,可以源代码安装,在Centos也可以用yum源安装的方法。由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法。
64位Centos下的安装步骤如下:

1、准备工作
运行yum命令查看MongoDB的包信息 
[root@server110.com~]# yum info mongo-10gen
(提示没有相关匹配的信息,) 说明你的centos系统中的yum源不包含MongoDB的相关资源,所以要在使用yum命令安装MongoDB前需要增加yum源,也就是在 /etc/yum.repos.d/目录中增加 *.repo yum源配置文件

2、vi /etc/yum.repos.d/10gen.repo,输入下面的语句:
[10gen] 
name=10gen Repository 
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 
gpgcheck=0 
做好yum源的配置后,如果配置正确执行下面的命令便可以查询MongoDB相关的信息: 
查看mongoDB的服务器包的信息
[root@server110.com 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.

查看客户端安装情况
[root@server110.com 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、安装MongoDB的服务器端和客户端工具 
[root@server110.com geffzhang]#  yum install mongo-10gen-server
[root@server110.com geffzhang]#  yum install mongo-10gen

4、启动Mongodb
service mongod start
以后有更新了,停掉mongodb,执行yum update mongo-10gen mongo-10gen-server 即可。

5、服务器配置: /etc/mongod.conf
# mongo.conf   
#where to log   
logpath=/var/log/mongo/mongod.log   
logappend=true #以追加方式写入日志   
# fork and run in background   
fork = true  
#port = 27017 #端口   
dbpath=/var/lib/mongo #数据库文件保存位置   
directoryperdb=true
# Enables periodic logging of CPU utilization and I/O wait   
#启用定期记录CPU利用率和 I/O 等待   
#cpu = true  
# Turn on/off security.  Off is currently the default  
# 是否以安全认证方式运行,默认是不认证的非安全方式   
#noauth = true  
#auth = true  
# Verbose logging output.   
# 详细记录输出   
#verbose = true  
# Inspect all client data for validity on receipt (useful for  
# developing drivers)用于开发驱动程序时的检查客户端接收数据的有效性   
#objcheck = true  
# Enable db quota management 启用数据库配额管理,默认每个db可以有8个文件,可以用quotaFiles参数设置   
#quota = true  
# 设置oplog记录等级   
# Set oplogging level where n is   
#   0=off (default)   
#   1=W   
#   2=R   
#   3=both   
#   7=W+some reads   
#oplog = 0  
# Diagnostic/debugging option 动态调试项   
#nocursors = true  
# Ignore query hints 忽略查询提示   
#nohints = true  
# 禁用http界面,默认为server110.com:28017  
# Disable the HTTP interface (Defaults to server110.com:27018).这个端口号写的是错的   
#nohttpinterface = true  
# 关闭服务器端脚本,这将极大的限制功能   
# Turns off server-side scripting.  This will result in greatly limited   
# functionality   
#noscripting = true  
# 关闭扫描表,任何查询将会是扫描失败   
# Turns off table scans.  Any query that would do a table scan fails.   
#notablescan = true  
# 关闭数据文件预分配   
# Disable data file preallocation.   
#noprealloc = true  
# 为新数据库指定.ns文件的大小,单位:MB   
# Specify .ns file size for new databases.   
# nssize =   
# Accout token for Mongo monitoring server.   
#mms-token =   
# mongo监控服务器的名称   
# Server name for Mongo monitoring server.   
#mms-name =   
# mongo监控服务器的ping 间隔   
# Ping interval for Mongo monitoring server.   
#mms-interval =   
# Replication Options 复制选项   
# in replicated mongo databases, specify here whether this is a slave or master 在复制中,指定当前是从属关系   
#slave = true  
#source = master.example.com   
# Slave only: specify a single database to replicate   
#Only= master.example.com   
# or   
#master = true  
#source = slave.example.com  


推荐阅读
  • Centos7.6安装Gitlab教程及注意事项
    本文介绍了在Centos7.6系统下安装Gitlab的详细教程,并提供了一些注意事项。教程包括查看系统版本、安装必要的软件包、配置防火墙等步骤。同时,还强调了使用阿里云服务器时的特殊配置需求,以及建议至少4GB的可用RAM来运行GitLab。 ... [详细]
  • 如何在服务器主机上实现文件共享的方法和工具
    本文介绍了在服务器主机上实现文件共享的方法和工具,包括Linux主机和Windows主机的文件传输方式,Web运维和FTP/SFTP客户端运维两种方式,以及使用WinSCP工具将文件上传至Linux云服务器的操作方法。此外,还介绍了在迁移过程中需要安装迁移Agent并输入目的端服务器所在华为云的AK/SK,以及主机迁移服务会收集的源端服务器信息。 ... [详细]
  • CentOS 7部署KVM虚拟化环境之一架构介绍
    本文介绍了CentOS 7部署KVM虚拟化环境的架构,详细解释了虚拟化技术的概念和原理,包括全虚拟化和半虚拟化。同时介绍了虚拟机的概念和虚拟化软件的作用。 ... [详细]
  • Allegro总结:1.防焊层(SolderMask):又称绿油层,PCB非布线层,用于制成丝网印板,将不需要焊接的地方涂上防焊剂.在防焊层上预留的焊盘大小要比实际的焊盘大一些,其差值一般 ... [详细]
  • centos php部署到nginx 404_NodeJS项目部署到阿里云ECS服务器全程详解
    本文转载自:http:www.kovli.com20170919ecs-deploy作者:Kovli本文详细介绍如何部署NodeJS项目到阿里云ECS上, ... [详细]
  • 本文介绍了Python高级网络编程及TCP/IP协议簇的OSI七层模型。首先简单介绍了七层模型的各层及其封装解封装过程。然后讨论了程序开发中涉及到的网络通信内容,主要包括TCP协议、UDP协议和IPV4协议。最后还介绍了socket编程、聊天socket实现、远程执行命令、上传文件、socketserver及其源码分析等相关内容。 ... [详细]
  • 生成对抗式网络GAN及其衍生CGAN、DCGAN、WGAN、LSGAN、BEGAN介绍
    一、GAN原理介绍学习GAN的第一篇论文当然由是IanGoodfellow于2014年发表的GenerativeAdversarialNetworks(论文下载链接arxiv:[h ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • LVS实现负载均衡的原理LVS负载均衡负载均衡集群是LoadBalance集群。是一种将网络上的访问流量分布于各个节点,以降低服务器压力,更好的向客户端 ... [详细]
  • CentOS7.8下编译muduo库找不到Boost库报错的解决方法
    本文介绍了在CentOS7.8下编译muduo库时出现找不到Boost库报错的问题,并提供了解决方法。文章详细介绍了从Github上下载muduo和muduo-tutorial源代码的步骤,并指导如何编译muduo库。最后,作者提供了陈硕老师的Github链接和muduo库的简介。 ... [详细]
  • Python项目实战10.2:MySQL读写分离性能优化
    本文介绍了在Python项目实战中进行MySQL读写分离的性能优化,包括主从同步的配置和Django实现,以及在两台centos 7系统上安装和配置MySQL的步骤。同时还介绍了创建从数据库的用户和权限的方法。摘要长度为176字。 ... [详细]
  • Linux防火墙配置—允许转发
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • 三、查看Linux版本查看系统版本信息的命令:lsb_release-a[root@localhost~]#lsb_release-aLSBVersion::co ... [详细]
  • centos6.8 下nginx1.10 安装 ... [详细]
  • 一面自我介绍对象相等的判断,equals方法实现。可以简单描述挫折,并说明自己如何克服,最终有哪些收获。职业规划表明自己决心,首先自己不准备继续求学了,必须招工作了。希望去哪 ... [详细]
author-avatar
心只为你跳国
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有