<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>meisw's blog</title>
		<link>http://meisw.wdlinux.cn//</link>
		<description>工作,学习,生活,这里将会有一些记录.     备用域名:http://meisw.wdlinux.cn</description>
		<copyright>Copyright (C) 2004 Security Angel Team [S4T] All Rights Reserved.</copyright>
		<generator>SaBlog-X Version 1.6 Build 20080806</generator>
		<lastBuildDate>Sat, 30 May 2026 01:13:31 +0000</lastBuildDate>
		<ttl>30</ttl>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1075-1.html</guid>
			<title>mongodb查询大小</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;可以通过传参数，比如</p>
<pre><code>db.stats(1024)</code></pre>
<p>得到的是kb单位的</p>
<pre><code>db.stats(1073741824);</code></pre>
<pre><code><br /></code></pre>
<pre><code>-------</code></pre>
<pre><code><ol start="1" class="dp-c"><li><span class="keyword">var</span>&nbsp;collNames&nbsp;=&nbsp;db.getCollectionNames();&nbsp;&nbsp;</li><li><span class="keyword">for</span>&nbsp;(<span class="keyword">var</span>&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;collNames.length;&nbsp;i++)&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;<span class="keyword">var</span>&nbsp;coll&nbsp;=&nbsp;db.getCollection(collNames[i]);&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;<span class="keyword">var</span>&nbsp;stats&nbsp;=&nbsp;coll.stats(1024&nbsp;*&nbsp;1024);&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;print(stats.ns,&nbsp;stats.storageSize);&nbsp;&nbsp;</li><li>}&nbsp;&nbsp;</li></ol></code></pre>]]></description>
			<link>http://meisw.wdlinux.cn//show-1075-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2019-07-31 20:24</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1071-1.html</guid>
			<title>mongodb远程复制数据表</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp; db.runCommand({cloneCollection:&quot;ball.othermatch&quot;,from:&quot;127.0.0.1:27017&quot;})</p>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>https://blog.csdn.net/wulex/article/details/83479516</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1071-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2019-03-20 22:48</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1059-1.html</guid>
			<title>关闭及主从配置</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;安全的关闭/停止mongodb的方法</p>
<p>&gt; use admin</p>
<p>&gt; db.shutdownServer()</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>六.改变oplogSize的大小</p>
<p>&nbsp; 变更oplog的大小,这是一个挺大的工程</p>
<p>&nbsp; 首先要停掉主节点,然后删除local数据库.</p>
<p>&nbsp; rm /data/db/local.*</p>
<p>&nbsp; 接着再以--oplogSize来重新定义大小.</p>
<p>&nbsp; mongod --master --oplogSize 多少MB</p>
<p>&nbsp; 再以--autoresync的选项重启所有从节点.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>1.配置主节点</p>
<p>创建数据的存放目录与日志的存放目录:</p>
<p>mkdir /mongodb/master</p>
<p>mkdir /mongodb/log</p>
<p>&nbsp;</p>
<p>接着把主节点的配置写在一个配置文件中,从而来启动的时候能用--config这个参数来指定配置,配置文件内容如下.</p>
<p>dbpath=/mongodb/master</p>
<p>logpath=/mongodb/log/master.log</p>
<p>master=true</p>
<p>fork=true</p>
<p>port=27017</p>
<p>oplogSize=2048</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>2.配置从节点</p>
<p>创建数据的存放目录与日志的存放目录:</p>
<p>mkdir /mongodb/slave</p>
<p>mkdir /mongodb/log</p>
<p>&nbsp;</p>
<p>接着写从节点的配置文件.</p>
<p>dbpath=/mongodb/slave</p>
<p>logpath=/mongodb/log/slave.log</p>
<p>slave=true</p>
<p>source=192.168.1.2:27017</p>
<p>fork=true</p>
<p>port=27017</p>
<p>autoresync=true</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1059-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-11-05 20:36</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1055-1.html</guid>
			<title>adminmongo</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp; 1123&nbsp; git clone https://github.com/mrvautin/adminMongo</p>
<div>&nbsp;1124&nbsp; cd adminMongo/</div>
<div>&nbsp;1129&nbsp; npm install</div>
<div>&nbsp;1130&nbsp; npm start</div>
<div>&nbsp;</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1055-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-10-12 17:04</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1054-1.html</guid>
			<title>对mongodb 的 WiredTiger Storage Engine 的理解</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span style="color: rgb(79, 79, 79); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px;">今天看了mongodb的官方文档中的WiredTiger Storage Engine ，说说我对WiredTiger Storage Engine 的理解！</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　在mongodb3.2版本以后,wiredTiger 存储引擎为默认的储存引擎。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">Document Level Concurrency</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　WiredTiger 的写操作使用了Document 级别的并发控制，因此多个clients可以同时同一个collection 中的不同的document &nbsp;进行修改。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　为了尽可能多的读和写操作，WiredTiger 使用了optimistic &nbsp;concurrency control（乐观的并发控制），相当于乐观锁，WiredTiger的全局的专一的锁，仅仅存在于database 和 collections 级别，例如：drop 一个collections，需要一个database级别的锁。当存储引擎在database 和collection的锁之间发生冲突时，其中的一个将会引发数据库写的冲突导致mongdb 去重新进行此操作。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">Snapshots and Checkpoints</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　WiredTiger 使用 多版本并发控制（MVCC）。再开始的操作中，WiredTiger 为这个事务提供一个数据的时间点的快照（snapshot），一个快照呈现一组在内存中的数据的视图。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　当写进磁盘时，WiredTiger 把所有的在snapshot中的数据通过相同的方法传递到磁盘中的数据文件。把在数据文件中的久经耐用的数据作为一个检查站（checkpoint），这个检查站确保数据文件和上一个检查站的数据是一致的，包括最后一个检查站。eg:检查站可以作为数据的恢复的点。mongodb配置的WiredTiger 去创建的站点是在间隔60秒或者2 GB的日志数据。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　在写一个新的站点期间，如果前面一个站点仍然是有效的，就这点而论，如果mongodb 意外结束或者突然遇到一个错误，再重新开始之前，mongodb 可以从上一个有效的checkpoint恢复数据。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　当WiredTiger 元数据的表被原子性的更新到新的检查站点的说明文档时，这个新的站点变得可用和稳定，一但新的站点变的可用，WiredTiger会释放pages从旧的检查站点。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">Journal</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　WiredTiger 使用一个write-ahead 处理log, 并且结合检查站点去确保数据的耐久性。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　WiredTiger 日志呈现了所有的数据在检查站点之间的变化，如果mongodb在检查站点之间退出，它使用日志去重新从上一个检查站点更新所有的被修改的数据，信息更新的频率和mongodb把日志数据写到磁盘的频率相同。WiredTiger 的日志是使用了快速压缩库被压缩，如果自己想指定一个混合的压缩运算或者不压缩使用&nbsp;<tt class="xref mongodb mongodb-setting docutils literal" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"><a class="reference internal" title="storage.wiredTiger.engineConfig.journalCompressor" href="https://docs.mongodb.com/manual/reference/configuration-options/#storage.wiredTiger.engineConfig.journalCompressor" rel="nofollow" target="_blank" style="box-sizing: border-box; outline: 0px; color: rgb(0, 0, 0); text-decoration-line: none; cursor: pointer; overflow-wrap: break-word;">storage.wiredTiger.engineConfig.journalCompressor</a>&nbsp;</tt></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span class="pre" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">　　WiredTiger的最小的log 记录大小是128 bytes。如果一个log 记录小于等于128 bytes，&nbsp;WiredTiger 不会压缩这个log 记录。</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">Compression</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">　 在</span><span class="pre" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">mongodb中，使用WiredTiger ，mongodb 支持压缩为所有的collection 和index ,压缩是使用额外CPU的开支减少存储空间。默认的情况下，WiredTiger使用块级别的压缩，所有的collections 被使用快速压缩库，所有的索引（index）被使用前缀压缩。在压缩collections 的时候 ，块级别的压缩用&nbsp;<a class="reference internal" href="https://docs.mongodb.com/manual/reference/glossary/#term-zlib" rel="nofollow" target="_blank" style="box-sizing: border-box; outline: 0px; color: rgb(0, 0, 0); text-decoration-line: none; cursor: pointer; overflow-wrap: break-word;"><span class="xref std std-term" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">zlib</span></a>&nbsp; 也是可用的，去指定一个轮流的压缩运算或者不压缩，使用<a class="reference internal" title="storage.wiredTiger.collectionConfig.blockCompressor" href="https://docs.mongodb.com/manual/reference/configuration-options/#storage.wiredTiger.collectionConfig.blockCompressor" rel="nofollow" target="_blank" style="box-sizing: border-box; outline: 0px; color: rgb(0, 0, 0); text-decoration-line: none; cursor: pointer; overflow-wrap: break-word;"><tt class="xref mongodb mongodb-setting docutils literal" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"><span class="pre" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">storage.wiredTiger.collectionConfig.blockCompressor</span></tt></a>&nbsp;，假如你不想去压缩index,你可以看下<a class="reference internal" title="storage.wiredTiger.indexConfig.prefixCompression" href="https://docs.mongodb.com/manual/reference/configuration-options/#storage.wiredTiger.indexConfig.prefixCompression" rel="nofollow" target="_blank" style="box-sizing: border-box; outline: 0px; color: rgb(0, 0, 0); text-decoration-line: none; cursor: pointer; overflow-wrap: break-word;"><tt class="xref mongodb mongodb-setting docutils literal" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"><span class="pre" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">storage.wiredTiger.indexConfig.prefixCompression</span></tt></a>&nbsp;</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span class="pre" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">　　对于大多数工作的负载，默认的压缩设置平衡了存储效率和处理要求。</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">Memory Use</span></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;">　　</span>mongodb 使用WiredTiger，mongodb 利用WiredTiger内部的cache和文件系统的cache。</p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">　　在mongdb 3.4 的版本以后，WiredTiger 内部的cache将变得更大：50%内存减去1GB 或者是256MG,通过文件系统的cache ,mongodb 自动的使用所有的空闲的内存，这些内存是不被WiredTiger cache 或者其他进程使用的。数据是在文件系统的cache里被压缩的。去调整WiredTiger内部cache 的大小可以看<tt class="xref mongodb mongodb-setting docutils literal" style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"><a class="reference internal" title="storage.wiredTiger.engineConfig.cacheSizeGB" href="https://docs.mongodb.com/manual/reference/configuration-options/#storage.wiredTiger.engineConfig.cacheSizeGB" rel="nofollow" target="_blank" style="box-sizing: border-box; outline: 0px; color: rgb(0, 0, 0); text-decoration-line: none; cursor: pointer; overflow-wrap: break-word;">storage.wiredTiger.engineConfig.cacheSizeGB</a>。<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;" />
</tt></p>
<p style="box-sizing: border-box; outline: 0px; margin-bottom: 16px; font-size: 16px; color: rgb(79, 79, 79); line-height: 26px; overflow-wrap: break-word; font-family: Verdana, Arial, Helvetica, sans-serif;">切记 ，不要调整WiredTiger内部cache的大小超过默认值。</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1054-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-10-12 17:01</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1053-1.html</guid>
			<title>如何检查当前MONGODB是否启用了WIREDTIGER存储引擎？</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span style="color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px;">如何检查当前mongodb是否启用了WiredTiger存储引擎？</span></p>
<p style="margin-bottom: 20px; line-height: 1.6em; quotes: none; color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px; box-sizing: border-box !important;">可以至少通过以下2种方法 验证：</p>
<p style="margin-bottom: 20px; line-height: 1.6em; quotes: none; color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px; box-sizing: border-box !important;">1、在Linux/OSX上执行如下的命令</p>
<div class="codecolorer-container php blackboard" style="margin: 0px 0px 10px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13px; line-height: 1.4em; font-family: Monaco, &quot;Lucida Console&quot;, monospace; border: 1px solid rgb(159, 159, 159); color: rgb(248, 248, 248); background-color: rgb(12, 16, 33); overflow: auto; white-space: nowrap; box-sizing: border-box !important;">
<div class="php codecolorer" style="margin: 0px; padding: 5px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">WIREDTIGER_CONFIGURED<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">=</span>`ps&nbsp;<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">-</span>ef<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">|</span>grep mongod<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">|</span>grep&nbsp;<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">-</span>i storageengine<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">|</span>grep&nbsp;<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">-</span>ic wiredtiger`<br style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;" />
<span class="kw1" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; color: rgb(251, 222, 45); box-sizing: border-box !important;">echo</span>&nbsp;$<span class="br0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">{</span>WIREDTIGER_CONFIGURED<span class="br0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">}</span></div>
</div>
<p style="margin-bottom: 20px; line-height: 1.6em; quotes: none; color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px; box-sizing: border-box !important;">如果返回为1则说明当前系统中运行着一个以WiredTiger为存储引擎的mongod</p>
<p style="margin-bottom: 20px; line-height: 1.6em; quotes: none; color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px; box-sizing: border-box !important;">2、在Linux/OSX上执行如下的命令</p>
<div class="codecolorer-container php blackboard" style="margin: 0px 0px 10px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13px; line-height: 1.4em; font-family: Monaco, &quot;Lucida Console&quot;, monospace; border: 1px solid rgb(159, 159, 159); color: rgb(248, 248, 248); background-color: rgb(12, 16, 33); overflow: auto; white-space: nowrap; box-sizing: border-box !important;">
<div class="php codecolorer" style="margin: 0px; padding: 5px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;"><span class="kw1" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; color: rgb(251, 222, 45); box-sizing: border-box !important;">echo</span>&nbsp;<span class="st0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; color: rgb(97, 206, 60); box-sizing: border-box !important;">&quot;db.serverStatus()&quot;</span><span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">|</span>&nbsp;mongo<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">|</span>grep wiredTiger</div>
</div>
<p style="margin-bottom: 20px; line-height: 1.6em; quotes: none; color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px; box-sizing: border-box !important;">若返回信息中有wiredTiger，则说明该mongo连接到了一个启用了wiredTiger存储引擎的mongod.</p>
<p style="margin-bottom: 20px; line-height: 1.6em; quotes: none; color: rgb(85, 85, 85); font-family: &quot;Helvetica Neue&quot;; font-size: 16px; box-sizing: border-box !important;">注意对于启用了wiredTiger的文件路径&ndash;dbpath，无法再使用默认mmapv1存储引擎打开，例如：</p>
<div class="codecolorer-container php blackboard" style="margin: 0px 0px 10px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; font-size: 13px; line-height: 1.4em; font-family: Monaco, &quot;Lucida Console&quot;, monospace; border: 1px solid rgb(159, 159, 159); color: rgb(248, 248, 248); background-color: rgb(12, 16, 33); overflow: auto; white-space: nowrap; box-sizing: border-box !important;">
<div class="php codecolorer" style="margin: 0px; padding: 5px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">ac<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">:</span>mongodata maclean$ mongod&nbsp;<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">--</span>storageEngine wiredTiger&nbsp;<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">--</span>dbpath &nbsp;<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">/</span>Users<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">/</span>maclean<span class="sy0" style="margin: 0px; padding: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: 1.4em; box-sizing: border-box !important;">/</span>mongodata</div>
</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1053-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-10-12 17:00</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1052-1.html</guid>
			<title>mongodb注意点-存储引擎</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;1.MongoDB 3.2之后默认启动的是wiredTiger 引擎这个引擎和原来的引擎访问方式不一样。你用命令mongod&nbsp; --storageEngine mmapv1 --dbpath 数据目录 这样启动的是原来的数据引擎在用MongoVE连接就可以了</p>
<div>&nbsp;</div>
<div>2.WiredTiger</div>
<div>&nbsp;</div>
<div>MongoDB自身拥有MMAPv1引擎，在3.0版本中加入了之前收购的WiredTiger的存储引擎技术。</div>
<div>&nbsp;</div>
<div>通过 WiredTiger，MongoDB 3.0 实现了文档级别的并发控制(Concurrency Control)，因此大幅提升了大并发下的写负载。</div>
<div>&nbsp;</div>
<div>用户可以自己选择储存数据的压缩比例，MongoDB 3.0提供最高达80%的压缩率，不过压缩率越高数据处理的时间成本也越多，用户可以自行权衡应用。</div>
<div>MMAPv1</div>
<div>增强了集合(collection)级别的并发控制</div>
<div>启动WiredTiger</div>
<div>mongod --storageEngine wiredTiger</div>
<div>---------------------&nbsp;</div>
<div>作者：风灵使&nbsp;</div>
<div>来源：CSDN&nbsp;</div>
<div>原文：https://blog.csdn.net/wulex/article/details/51800612?utm_source=copy&nbsp;</div>
<div>版权声明：本文为博主原创文章，转载请附上博文链接！</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1052-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-10-12 16:59</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1051-1.html</guid>
			<title>Mongo3.4 Storage Engines存储引擎（将MongoDB实例更改为WiredTiger存储引擎）</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;教程提供了改变独立MongoDB实例的存储引擎为wiredtiger存储引擎的概述。</p>
<div>&nbsp;</div>
<div>注意：</div>
<div>&nbsp;</div>
<div>本教程使用mongodump和mongorestore工具导出和导入数据，确保MongoDB组件安装在你的系统之中，另外，确保使用WiredTiger运行的MongoDB实例有足够的存储空间供mongodump导出文件和数据文件。</div>
<div>&nbsp;</div>
<div>1.启动将要使用WiredTiger存储引擎的mongo实例</div>
<div>&nbsp;</div>
<div>2.使用mongodump导出数据</div>
<div>&nbsp;</div>
<div>mongodump --out &lt;exportDataDestination&gt;</div>
<div>适当的指定其他的参数选项，如果开启了authorization认证加上username和password</div>
<div>3.为使用WiredTiger存储引擎运行的mongod实例创建一个目录，mongod必须对这个目录拥有读和写的权限</div>
<div>&nbsp;</div>
<div>4.启动mongod实例并且指定存储引擎为WiredTiger和数据存储目录</div>
<div>&nbsp;</div>
<div>mongod --storageEngine wiredTiger --dbpath &lt;newWiredTigerDBPath&gt;</div>
<div>5.使用mongorestore导入数据文件</div>
<div>mongorestore &lt;exportDataDestination&gt;</div>
<div>---------------------&nbsp;</div>
<div>作者：随风yy&nbsp;</div>
<div>来源：CSDN&nbsp;</div>
<div>原文：https://blog.csdn.net/yaomingyang/article/details/74913707?utm_source=copy&nbsp;</div>
<div>版权声明：本文为博主原创文章，转载请附上博文链接！</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1051-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-10-12 16:58</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1049-1.html</guid>
			<title>mongodb</title>
			<author>admin</author>
			<description><![CDATA[<p>ubuntu 安装QT 5.0出现错误：Failed to load platform plugin &quot;xcb&quot;.</p>
<p>&nbsp;</p>
<p>apt-get install &quot;^libxcb.*&quot; libx11-xcb-dev libglu1-mesa-dev libxrender-dev</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>-----</p>
<p>&nbsp;</p>
<p>robo3t-1.2.1-linux</p>
<p>&nbsp;</p>
<p>apt-get install libgl1-mesa-dev</p>
<p>&nbsp;</p>
<p>-------</p>
<p>&nbsp;</p>
<p>use admin</p>
<p>db.runCommand({logRotate:1})</p>
<p>&nbsp;</p>
<p>----------</p>
<p>mongodb常见问题</p>
<p>https://www.cnblogs.com/bethal/p/5551967.html</p>
<p>&nbsp;</p>
<p>---------------</p>
<p>mongodb 命令行基本命令使用大全</p>
<p>https://blog.csdn.net/qq_27093465/article/details/54601598</p>
<p>&nbsp;</p>
<p>-------------------</p>
<p>apt-get install mongodb</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1049-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-61-1.html">mongodb</category>
			<pubDate>2018-09-05 13:28</pubDate>
		</item>
	</channel>
</rss>
