<?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; MongoDB</title>
	<atom:link href="http://www.osyunwei.com/archives/category/config/database/mongodb/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>Sun, 10 May 2026 14:53:20 +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/9313.html</link>
		<comments>https://www.osyunwei.com/archives/9313.html#comments</comments>
		<pubDate>Wed, 25 Nov 2015 01:01:07 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=9313</guid>
		<description><![CDATA[说明： 有三台服务器，已经安装好了MongoDB数据库，具体信息如下： MongoDB版本：mongodb-linux-x86_64-2.6.11 MongoDB安装目录：/usr/local/mongodb MongoDB数据库目录：/home/data/mongodb/mongodb_data MongoDB日志目录：/home/data/mongodb/mongodb_log MongoDB配置文件：/usr/local/mongodb/mongodb.conf 三台服务器IP地址： 192.168.0.8 192.168.0.9 192.168.0.10 实现目的： 对三台服务器进行部署，实现副本集功能。 具体操作： 一、确定副本集名称、主从节点、配置文件、启动脚本信息 1、定义副本集名称为：osyunwei 2、主节点为：192.168.0.8 3、两台从节点为： 192.168.0.9 192.168.0.10 4、确保三台副本集服务器上的配置文件完全相同，如下： 第一种写法：官方推荐、适合2.6以后的版本 vi /usr/local/mongodb/mongodb.conf #编辑 systemLog: destination: "file" path: "/home/data/mongodb/mongodb_log/mongodb.log" logAppend: true storage: journal: enabled: true dbPath: "/home/data/mongodb/mongodb_data/" directoryPerDB: true processManagement: fork: true pidFilePath: "/usr/local/mongodb/mongo.pid" net: port: 27017 http: enabled: true RESTInterfaceEnabled: true #security: # [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/9313.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/9313.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下PHP安装配置MongoDB 3.0.x数据库连接扩展</title>
		<link>https://www.osyunwei.com/archives/9257.html</link>
		<comments>https://www.osyunwei.com/archives/9257.html#comments</comments>
		<pubDate>Fri, 25 Sep 2015 03:20:48 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=9257</guid>
		<description><![CDATA[说明： 操作系统：CentOS 6.X 64位 MongoDB数据库服务器： IP地址：192.168.21.130 Web服务器： IP地址：192.168.21.127 PHP安装路径：/usr/local/php 实现目的： 安装PHP的MongoDB数据库扩展，通过PHP程序连接MongoDB数据库 具体操作： 一、安装PHP的MongoDB数据库扩展（在Web服务器192.168.21.127上操作） 下载地址：http://pecl.php.net/get/mongo-1.6.11.tgz 上传mongo-1.6.11.tgz到/usr/local/src目录 tar zxvf mongo-1.6.11.tgz #解压 cd mongo-1.6.11 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make #编译 make install #安装，完成之后出现下面的界面 系统运维 www.osyunwei.com 温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链 /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ vi /usr/local/php/etc/php.ini #编辑，在最后一行添加下面的代码 extension="mongo.so" :wq! #保存退出 service php-fpm reload #重新加载php-fpm 在站点根目录下添加php测试页面 vi /usr/local/nginx/html/phpinfo.php #编辑 &#60;?php phpinfo(); ?&#62; :wq! #保存退出 打开上面的页面，http://192.168.21.127/phpinfo.php 如下图所示： 二、创建测试数据库（在MongoDB数据库服务器操作） [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/9257.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/9257.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下安装配置MongoDB 3.0.x 版本数据库</title>
		<link>https://www.osyunwei.com/archives/9239.html</link>
		<comments>https://www.osyunwei.com/archives/9239.html#comments</comments>
		<pubDate>Thu, 10 Sep 2015 09:13:19 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=9239</guid>
		<description><![CDATA[说明： 操作系统：CentOS 5.X 64位 IP地址：192.168.21.128 实现目的： 安装配置MongoDB数据库 具体操作： 一、关闭SElinux、配置防火墙 1、vi /etc/selinux/config #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 :wq! #保存退出 setenforce 0 #使配置立即生效 2、vi /etc/sysconfig/iptables #编辑 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT #允许27017端口通过防火墙 :wq! #保存退出 /etc/init.d/iptables restart #重启防火墙使配置生效 二、安装MongoDB MongoDB下载地址：https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz #目前最新版 上传mongodb-linux-x86_64-3.0.6.tgz到/usr/local/src目录 cd /usr/local/src #进入软件存放目录 tar zxvf mongodb-linux-x86_64-3.0.6.tgz [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/9239.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/9239.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下定时切割Mongodb数据库日志并删除指定天数前的日志记录</title>
		<link>https://www.osyunwei.com/archives/8998.html</link>
		<comments>https://www.osyunwei.com/archives/8998.html#comments</comments>
		<pubDate>Sat, 28 Feb 2015 06:17:55 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Mongodb数据库日志]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=8998</guid>
		<description><![CDATA[说明： 操作系统：CentOS Mongodb安装目录：/usr/local/mongodb Mongodb数据库存放目录：/home/data/mongodb/mongodb_data Mongodb日志存放目录：/home/data/mongodb/mongodb_log 实现目的： 对Mongodb数据库日志按天保存，并且只保留最近7天的日志记录。 具体操作： 使用Mongodb数据库自带的命令来切割日志 ps -def &#124; grep mongod kill -SIGUSR1 &#60;mongod process id&#62; 1、创建Mongodb数据库日志切割脚本 vi /home/crontab/cut_mongodb_log.sh #编辑 #!/bin/sh datafile=/home/data/mongodb/mongodb_data #Mongodb数据库存放目录 logfile=/home/data/mongodb/mongodb_log #Mongodb日志存放目录 days=7 #代表删除7天前的备份，即只保留最近7天的备份 /bin/kill -SIGUSR1 `cat $datafile/mongod.lock` #切割日志 find $logfile/ -mtime +$days -delete #删除7天前的备份文件 :wq! #保存退出 chmod +x   /home/crontab/cut_mongodb_log.sh  #添加执行权限 系统运维 www.osyunwei.com 温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链接 2、添加任务计划，修改/etc/crontab vi /etc/crontab #在最后一行添加 0 [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/8998.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/8998.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下自动备份Mongodb数据库并删除指定天数前的备份</title>
		<link>https://www.osyunwei.com/archives/8985.html</link>
		<comments>https://www.osyunwei.com/archives/8985.html#comments</comments>
		<pubDate>Sat, 28 Feb 2015 02:25:01 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Mongodb数据库备份]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=8985</guid>
		<description><![CDATA[说明： Mongodb数据库服务器 操作系统：CentOS Mongodb数据库版本：mongodb-linux-x86_64-2.6.x 具体操作： 1、创建Mongodb数据库备份目录 mkdir -p /home/backup/mongod_bak/mongod_bak_now mkdir -p /home/backup/mongod_bak/mongod_bak_list 2、新建Mongodb数据库备份脚本 vi /home/crontab/mongod_bak.sh #新建文件，输入以下代码 #!/bin/sh DUMP=/usr/local/mongodb/bin/mongodump #mongodump备份文件执行路径 OUT_DIR=/home/backup/mongod_bak/mongod_bak_now #临时备份目录 TAR_DIR=/home/backup/mongod_bak/mongod_bak_list #备份存放路径 DATE=`date +%Y_%m_%d` #获取当前系统时间 DB_USER=username #数据库账号 DB_PASS=123456 #数据库密码 DAYS=7 #DAYS=7代表删除7天前的备份，即只保留最近7天的备份 TAR_BAK="mongod_bak_$DATE.tar.gz" #最终保存的数据库备份文件名 cd $OUT_DIR rm -rf $OUT_DIR/* mkdir -p $OUT_DIR/$DATE $DUMP -u $DB_USER -p $DB_PASS -o $OUT_DIR/$DATE #备份全部数据库 tar -zcvf $TAR_DIR/$TAR_BAK $OUT_DIR/$DATE #压缩为.tar.gz格式 [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/8985.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/8985.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下PHP安装配置MongoDB数据库连接扩展</title>
		<link>https://www.osyunwei.com/archives/7643.html</link>
		<comments>https://www.osyunwei.com/archives/7643.html#comments</comments>
		<pubDate>Sat, 26 Apr 2014 06:31:48 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=7643</guid>
		<description><![CDATA[说明： 操作系统：CentOS 5.X 64位 MongoDB数据库服务器： IP地址：192.168.21.130 Web服务器： IP地址：192.168.21.127 PHP安装路径：/usr/local/php 实现目的： 安装PHP的MongoDB数据库扩展，通过PHP程序连接MongoDB数据库 具体操作： 一、安装PHP的MongoDB数据库扩展（在Web服务器192.168.21.127上操作） 下载地址：http://pecl.php.net/get/mongo-1.5.1.tgz 上传mongo-1.5.1.tgz到/usr/local/src目录 tar  zxvf mongo-1.5.1.tgz  #解压 cd mongo-1.5.1 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make  #编译 make install  #安装，完成之后出现下面的界面 系统运维  www.osyunwei.com  温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链 /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ vi /usr/local/php/etc/php.ini  #编辑，在最后一行添加下面的代码 extension="mongo.so" :wq! #保存退出 service php-fpm reload  #重新加载php-fpm 在站点根目录下添加php测试页面 vi /usr/local/nginx/html/phpinfo.php  #编辑 &#60;?php phpinfo(); ?&#62; :wq!  #保存退出 打开上面的页面，http://192.168.21.127/phpinfo.php 如下图所示： 二、创建测试数据库（在MongoDB数据库服务器操作） [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/7643.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/7643.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下安装配置MongoDB数据库</title>
		<link>https://www.osyunwei.com/archives/7629.html</link>
		<comments>https://www.osyunwei.com/archives/7629.html#comments</comments>
		<pubDate>Fri, 25 Apr 2014 09:20:59 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=7629</guid>
		<description><![CDATA[说明： 操作系统：CentOS 5.X 64位 IP地址：192.168.21.130 实现目的： 安装配置MongoDB数据库 具体操作： 一、关闭SElinux、配置防火墙 1、vi /etc/selinux/config #SELINUX=enforcing #注释掉 #SELINUXTYPE=targeted #注释掉 SELINUX=disabled #增加 :wq!  #保存退出 setenforce 0 #使配置立即生效 2、vi /etc/sysconfig/iptables  #编辑 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT  #允许27017端口通过防火墙 :wq! #保存退出 /etc/init.d/iptables restart #重启防火墙使配置生效 二、安装MongoDB MongoDB下载地址：https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.0.tgz  #目前最新版 上传mongodb-linux-x86_64-2.6.0.tgz到/usr/local/src目录 cd  /usr/local/src  #进入软件存放目录 tar zxvf mongodb-linux-x86_64-2.6.0.tgz  [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/7629.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/7629.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
