上一页 1 2 3 4 5 6 7 8 ··· 14 下一页
摘要: 主从复制1.启动时使用主从复制(1)启动一个主服务器: mongod --dbpath D:\mongodb\data --master(2)启动一个从服务器: mongod --dbpath D:\MongoDB\Data_10000 --port 10000 --slave --source localhost:27017(3)再启动一个从服务器:mongod --dbpath D:\MongoDB\Data_10001 --port 10001 --slave --source localhost:27017发现如下几点:(1)当主从服务器都启动时,使用shell登录从服务器,然后使用i 阅读全文
posted @ 2011-09-04 23:26 再快一点 阅读(495) 评论(0) 推荐(0) 编辑
摘要: 测试条件:Windows+MongoDB 1.8.2先插入测试数据:for(var i=1; i<20; i++){ var num=i%6; db.test.insert({_id:i,name:"user_"+i,age:num});}1.普通分组查询db.test.group({key:{age:true},initial:{num:0},$reduce:function(doc,prev){ prev.num++}});db.runCommand({group: { ns:"test", key:{age:true}, initial:{n 阅读全文
posted @ 2011-08-31 23:40 再快一点 阅读(36936) 评论(1) 推荐(3) 编辑
摘要: 测试环境:PHP5.3 +mongo-1.1.4-php5.3vc6ts的php_mongo.dll使用mongostat观察发现:1.mongostat本身也占用一个数据库连接2.PHP的mongo扩展默使用短连接,类似如此代码:new Mongo("mongodb://192.168.1.108/test"),这种短连接一般在超出变量作用域后会自己关闭3.PHP也可以使用长连接:for($i=0;$i<100;$i++){//mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db // 阅读全文
posted @ 2011-08-28 17:53 再快一点 阅读(2782) 评论(0) 推荐(0) 编辑
摘要: <?php$db = new Mongo ();$res = $db->wq->post->find ();foreach ( $res as $key => $val ) { echo "$key => "; EchoArray ( $val ); echo "<br/>";}function EchoArray($ele) { if (is_array ( $ele )) { echo "["; $i = 0; $count = count ( $ele ); foreach ( $ 阅读全文
posted @ 2011-08-27 18:54 再快一点 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 假设httpd.conf里的 DocumentRoot 为 DocumentRoot "D:/Apache3W"使用<Directory>指令设置url重写,在httpd.conf写如下内容<Directory "D:/Apache3W"> RewriteEngine on RewriteRule ^([^\.]+)$ $1.php Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all</Directory>&l 阅读全文
posted @ 2011-08-26 12:17 再快一点 阅读(6956) 评论(0) 推荐(0) 编辑
摘要: 火狐:ClientWidth和ClientHeight:包括width,height和对应的paddingoffsetWidth和offsetHeight:包括width,height和对应的padding,以及对应的borderscrollWidth和scrollHeight:包括width,height和对应的padding,以及对应的borderchrome:ClientWidth和ClientHeight:包括width,height和对应的paddingoffsetWidth和offsetHeight:包括width,height和对应的padding,以及对应的borderscro 阅读全文
posted @ 2011-08-24 22:18 再快一点 阅读(944) 评论(1) 推荐(0) 编辑
摘要: <html xmlns="http://www.w3.org/1999/xhtml"><head> <title>JavaScript实现的可以拖动排版可以关闭的DIV层丨芯晴网页特效丨CsrCode.Cn</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <style type="text/css"> body { margin: 0p 阅读全文
posted @ 2011-08-21 19:45 再快一点 阅读(3036) 评论(0) 推荐(0) 编辑
摘要: 下载zlib(因为php的memcache扩展模块使用了函数»zlib 来支持数据压缩,因此安装此模块需要安装Zlib模块。):http://sourceforge.net/projects/libpng/files/zlib/1.2.5/zlib-1.2.5.tar.gz/download 下载memcache的php扩展:http://pecl.php.net/get/memcache-3.0.6.tgz由于Ubuntu11.04默认没有安装zlib,所以首先安装 zlibtar-xzvfzlib-1.2.5.tar.gzcdzlib-1.2.5./configure--pref 阅读全文
posted @ 2011-08-19 12:00 再快一点 阅读(3759) 评论(0) 推荐(0) 编辑
摘要: pecl的memcache扩展(注意,不是memcache的扩展,两者不同)中连接memcache服务器有两种方式:1.短连接(Memcache::connect)使用方法 Memcache::connect()打开的连接在脚本执行结束后会自动关闭。当然,你也可以使用方法 Memcache::close()来主动关闭2.长连接(Memcache::connect)这个连接不会在脚本执行结束后或者Memcache::close()被调用后关闭,持久化连接仅仅会在web服务器关机/重启时关闭。memcache的分布式是通过Memcache::addServer这个方法实现的,下面在windows. 阅读全文
posted @ 2011-08-16 20:03 再快一点 阅读(15488) 评论(1) 推荐(1) 编辑
摘要: 转自http://edu.codepub.com/2011/0426/31119.phpifexists(select*fromdbo.sysobjectswhereid=object_id(N'[dbo].[p_exporttb]')andOBJECTPROPERTY(id,N'IsProcedure')=1)dropprocedure[dbo].[p_exporttb]GOcreateprocp_exporttb@sqlstrsysname,--查询语句,如果查询语句中使用了orderby,请加上top100percent,注意,如果导出表/视图,用上面的存 阅读全文
posted @ 2011-08-15 11:04 再快一点 阅读(4833) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 14 下一页