<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>系统运维 &#187; 数据库主从</title>
	<atom:link href="http://www.osyunwei.com/archives/tag/%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%BB%E4%BB%8E/feed" rel="self" type="application/rss+xml" />
	<link>https://www.osyunwei.com</link>
	<description>国产化OS/AnolisOS/openEuler/RHEL/CentOS/Rocky Linux/Debian/Ubuntu Linux FreeBSD 服务器教程 &#124; Windows Server 2003/2008/2012/2016/2019/2022/2025服务器教程</description>
	<lastBuildDate>Tue, 14 Apr 2026 10:59:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux下Mongodb数据库主从同步配置</title>
		<link>https://www.osyunwei.com/archives/8433.html</link>
		<comments>https://www.osyunwei.com/archives/8433.html#comments</comments>
		<pubDate>Mon, 24 Nov 2014 09:50:46 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[主从架构]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[数据库主从]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=8433</guid>
		<description><![CDATA[说明： 有两台已经安装完成的Mongodb数据库服务器，现在需要把一台设置为主库，另一台设置为从库，实现主从同步。 操作系统：CentOS 7.0 64位 MongoDB数据库版本：mongodb-linux-x86_64-2.6.5 准备工作：MongoDB数据库安装 请参考：Linux下安装配置MongoDB数据库 http://www.osyunwei.com/archives/7629.html 具体操作： 一、配置MongoDB主库 以下操作在MongoDB主库服务器上进行 1、cd  /usr/local/mongodb/ #进入MongoDB安装目录 vi /usr/local/mongodb/mongodb.conf  #编辑，在原来配置文件的最后一行添加以下代码 master=true  #设置为主库 oplogSize=2048  #同步复制的日志大小设置，单位MB :wq!  #保存退出 添加好之后如下图所示： 系统运维 www.osyunwei.com 温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链 2、重启MongoDB数据库 service  mongod  stop #停止MongoDB service  mongod  start #启动MongoDB 二、配置MongoDB从库 以下操作在MongoDB从库服务器上进行 1、cd  /usr/local/mongodb/ #进入MongoDB安装目录 vi /usr/local/mongodb/mongodb.conf  #编辑，在原来配置文件的最后一行添加以下代码 slave=true  #设置为从库 source=192.168.21.100:27017   #设置要同步的MongoDB主库IP地址和端口，格式：ip:端口 slavedelay=10                 #设置从库同步主库的延迟时间，单位为秒 autoresync=true [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/8433.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/8433.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
