YCSB测试工具应用之Mongo压力测试
YCSB测试工具应用之Mongo压力测试https://github.com/brianfrankcooper/YCSB/tree/master/mongodb安装javayum install java-devel安装mavenwget http://ftp.heanet.ie/mirrors/www.apache.org/dist/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.tar.gztar xzf apache-maven-*-bin.tar.gz -C /usr/loca...
Mongodb之索引
创建单列索引1(升序);-1(降序)db.t3.createIndex( { "id" : 1 } )后台创建索引db.t3.createIndex( { domainname: 1}, {background: true} )创建子文档索引db.people.createIndex( { "address.zipcode": 1 } )查询子文档db.users.find({"address.city":"Los Angeles"}) 创建组合索引db.t3.ensureI...
Mongo细粒度权限控制
创建角色:use xxx db.createRole( { role: "xxx_dbmon_role", privileges: [ { resource: { db: "xxx", collection: "system.profile" }, actions: [ "find" ] }, { resource: { db: ...
monogdb使用中的坑
在MongoDB中,内排序大内存限制最大为100M,如果执行一个更大的排序,需要使用 allowDiskUse 选项来将数据写到临时文件来排序。在查询语句中添加 allowDiskUse 选项:db.bigdata.aggregate([ {$group : {_id : "$range", total : { $sum : 1 }}}, {$sort : {total : -1}}], {allowDiskUse: true});...
mongodb 复制集添加新节点
mongodb 复制集添加新节点:向已有的replica set 添加新成员,新加的成员可以是空的,当然也可以是从其他节点的数据拷贝,添加新成员时,必须在新的机器上先起来一个mongodb服务,必须指出要加入的replica set 集群的名字基本语法如下(其他是默认的),然后再在replica set的master 库上执行添加操作,删除原数据,该新...
Mongodb从库不同步故障处理
mongodb不同步问题:日志报错如下:2015-11-23T08:44:46.697+0800 I REPL [rsBackgroundSync] replSet error RS102 too stale to catch up2015-11-23T08:54:46.972+0800 I REPL [rsBackgroundSync] replSet error RS102 too stale to catch up2015-11-23T09:04:47.176+0800 I REPL ...
mongo 3.0.4 开启慢查询
mongo 开启慢查询1.使用profiler use mongewa db.auth('gewaradb','gewara2008') db.getProfilingStatus() db.setProfilingLevel(1,50);可以取0,1,2 三个值,他们表示的意义如下: 0 – 不开启
Mongodb与Mysql SQL操作对比
<div style="font-family:Arial;font-size:14px;line-height:26px;white-space:normal;background-color:#FFFFFF;"> mongodb以BSON结构(二进制)进行存储,对海量数据存储有着很明显的优势。下面是Mongodb与Mysql的操作命令的对比。</div><div style="font-family:Arial;font-size:14px;line-height:26px;white-s...
Mongodb3.0.4滚动升级到3.0.5
环境:PRIMARY:SECONDARY:ARBITER环境检查:查看哪些从库rs.status()查看Replica set的配置rs.conf()查看活跃节点db.isMaster()步骤:升级
mongodb 监控
<br /> 监控:<br /> 连接数:<br /> echo "db.serverStatus().connections"| mongo --port 40001 -u admin -p 'AdminPass123' --authenticationDatabase admin| grep current| cut -d ":" -f 3|cut -d "," -f 1 |cut -d " " -f 2<br /><br /><br /> 物理内存:<br />&nb...
Mongodb日志按天分割
Mongodb日志存放目录:/home/data/mongodb/mongodb_log<br /><br /><br />实现目的:<br />对Mongodb数据库日志按天保存,并且只保留最近7天的日志记录。<br /><br />具体操作:<br />使用Mongodb数据库自带的命令来切割日志<br /><br />ps -def | grep mongod<br />kill -SIGUSR1 <mongod process id><br ...
使用YCSB测试MongoDB的微分片性能
<header class="entry-header" style="box-sizing:border-box;margin:0px auto 30px;max-width:1440px;width:1440px;padding:0px 536px 0px 60px;color:#202225;font-family:'Hiragino Sans GB', Tahoma, Arial, 'Microsoft Yahei', 微软雅黑, STXihei, 华文细黑, sans-serif;font-size:16px;line-height:24px;white-space:...
MongoDB干货系列1-定期巡检之Mtools
<header class="entry-header" style="box-sizing:border-box;margin:0px auto 30px;max-width:1440px;width:1440px;padding:0px 536px 0px 60px;color:#202225;font-family:'Hiragino Sans GB', Tahoma, Arial, 'Microsoft Yahei', 微软雅黑, STXihei, 华文细黑, sans-serif;font-size:16px;line-height:24px;white-space:...