
mongodb
mongodb
数据库人生
专注于数据库
PostgreSQL;Oracle 11G OCA、OCP;OceanBase V2 OBCA、OBCP
展开
-
mongodb查看集合、索引相关信息
查询每个集合的索引数量。原创 2025-02-08 10:30:03 · 306 阅读 · 0 评论 -
mongostat 观察性能
repl:状态是否异常,如PRI、SEC、RTR为正常,若出现REC等异常值则需要修复。dirty:百分比是否较高,若持续高于10%则说明磁盘I/O存在瓶颈。qrw、arw:队列是否较高,若长时间大于0则说明此时读写速度较慢。插入、删除、修改、查询的速率是否产生较大波动,是否超出预期。使用 --discover 可以自动带出副本集所有节点。netIn、netOut:是否超过网络带宽阈值。也可以使用指定多节点连接的方式。conn:连接数是否太多。原创 2025-02-06 16:42:24 · 144 阅读 · 0 评论 -
mongodb 使用内存过大分析
内存使用swap 使用。原创 2025-02-06 09:43:35 · 462 阅读 · 0 评论 -
MongoDB Security
mongodb security转载 2022-11-24 10:21:51 · 158 阅读 · 0 评论 -
replicate set 修改 oplog 大小
mongodb原创 2022-11-22 16:29:41 · 278 阅读 · 0 评论 -
mongodb 5.0 启动报错 Package ‘mongodb-org-server‘ isn‘t signed with proper key
os: centos 7.6db: mongodb 5.0版本# cat /etc/centos-releaseCentOS Linux release 7.6.1810 (Core) ### yum list installed|grep -i mongomongodb-database-tools.x86_64 100.5.0-1 @mongodb-org-5.0mongodb-mongosh.x86_64原创 2021-08-31 11:22:01 · 2203 阅读 · 0 评论 -
mongodb 副本集重新配置
> db.version();3.2.6> conf=rs.conf()> conf.members[0].host="192.168.56.200:27017";> rs.reconfig(rsconf,{"force":true});原创 2018-04-08 18:08:42 · 8144 阅读 · 0 评论 -
debian 8.2 + apt-get + mongodb 3.2 + replica set
安装debian 8.2安装 mongodb 3.2192.168.0.100 debian1 192.168.0.101 debian2可以参考博客安装。配置 replica set修改/etc/mongod.conf两台机器均修改 /etc/mongod.conf ,添加副本集信息 # vi /etc/mongod.conf ##复制集配置 replicati原创 2017-11-16 19:09:01 · 390 阅读 · 1 评论 -
mongodb 副本集去salve节点维护
使用的是mongodb 3.2,需要对其中的一个slave节点扩充目录,正确的做法如下1、primary 节点上 去slave节点负载# mongoMongoDB shell version: 3.2.6connecting to: testmonset:PRIMARY> use adminswitched to db adminmonset:PRIMARY> db.auth('原创 2018-01-22 08:28:49 · 558 阅读 · 0 评论 -
mongodb sharding ( replica set + sharding) 添加shard节点
os: centos 7.4 monggo: 3.6.6mongodb replicat set + sharding 规划如下:192.168.56.101 node1 configserver replset(27017、27018、27019)192.168.56.102 node2 mongos(27017、27018、27019)192.168.56.103 nod...原创 2018-07-24 16:37:54 · 1139 阅读 · 0 评论 -
mongodb sharding ( replica set + sharding) 移除shard节点
os: centos 7.4 monggo: 3.6.6mongodb replicat set + sharding 规划如下:192.168.56.101 node1 configserver replset(27017、27018、27019)192.168.56.102 node2 mongos(27017、27018、27019)192.168.56.103 nod...原创 2018-07-24 18:23:54 · 536 阅读 · 0 评论 -
mongodb sharding 的安装( replica set + sharding)
os: centos 7.4 monggo: 3.6.6mongo 作为一款优秀的nosql产品,sharding功能是必须的,其包含如下组件。config server: 存储集群的元数据(metadata),即数据的哪一部分放在哪一个shard上,router将会利用这些元数据将请求分发到对应的shards上,shards上chunk的迁移也是config server来控制的。...原创 2018-07-24 15:27:34 · 1016 阅读 · 0 评论 -
mongo 同步数据到 postgrsql
os: centos 7.4 mongodb:3.2 postgresql: 9.6 mosql:MoSQL is no longer being actively maintained。可惜了,mosql现在已经不再维护。# mosql --helpUsage: /usr/local/rvm/rubies/ruby-1.9.3-p551/bin/mosql [options]...原创 2018-06-26 17:06:22 · 1292 阅读 · 3 评论 -
mosql 安装
os: centos 7.5 ruby:2.4.4 mosql:0.4.3安装curl# yum install curlLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun....原创 2018-07-09 14:23:29 · 538 阅读 · 0 评论 -
mongodb 常用的几个网址
org https://www.mongodb.com/https://www.mongodb.com/download-center?jmp=tutorials#community https://docs.mongodb.com/http://www.mongoing.com/原创 2018-04-16 10:41:05 · 444 阅读 · 0 评论 -
debian 8.2 + apt-get + mongodb 3.2
安装debian 8.2os 透明大页设置https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/ 检查#cat /sys/kernel/mm/transparent_hugepage/enabled #cat /sys/kernel/mm/transparent_hugepage/defrag 均应该输出如下原创 2017-11-16 18:48:47 · 733 阅读 · 0 评论 -
linux 查看 mongodb 连接数
netstat -antp|grep -i 27017 | awk '{print $5}'| cut -d: -f1 | sort | uniq -c | sort -n适当修改就可以查看其他信息原创 2018-01-09 16:41:18 · 5121 阅读 · 0 评论 -
sort operation used more than the maximum 33554432 bytes of RAM. Add an index,or specify a smaller
生产环境mongodb 报错, sort operation used more than the maximum 33554432 bytes of RAM. Add an index,or specify a smaller limitmongodb 版本 3.2.6,下面是官方文档的描述Sort Operations If MongoDB cannot use an index ...原创 2018-02-12 17:39:39 · 1042 阅读 · 0 评论 -
mongodb kill -9 之后无法正常启动
今天在本地虚拟机测试了mongodb 的 kill -9 处理方式。 总结了一下。mongodb 3.2.6# ps -ef|grep -i mongod# kill -9 27332# cd /var/lib/mongodb/# rm ./mongod.lock# rm ./storage.bson # mongod --dbpath /var/lib/mongodb --...原创 2018-02-24 08:52:08 · 1566 阅读 · 0 评论 -
mongodb 用户的一些操作
mongodb 版本> version();3.2.6查看用户> db.system.users.find();> db.getUsers();删除用户> db.dropUser('peiyb')创建用户> db.createUser({user:"peiyb",pwd:"peiybpeiyb",roles:[{role:"ro...原创 2018-04-09 09:25:18 · 607 阅读 · 0 评论 -
使用 mtools 搭架 mongodb 的自动化日志分析平台
mtools 是一款优秀的开源工具,是由 mongodb 公司的工程师个人维护的,在git上可以下载: https://github.com/rueckstiess/mtools/tree/master创建平台目录# mkdir /apps# cd /apps# ls -l总用量 16-rw-r--r-- 1 root root 225 6月 5 18:20 log_d...原创 2018-06-05 19:41:24 · 604 阅读 · 0 评论 -
mongodb 使用 profile + mtools 来分析慢查询
os:centos 7.4 mongdbo:3.2 mtools:1.4.1mongodb 是一款优秀的nosql数据库,高灵活性和高性能。所以有必要监控mongodb的慢查询,以便进一步缩短响应时间。 mtools是一组用来解析和过滤MongoDB日志文件的脚本。profile 设置由于是初次设置,定义慢查询为 1000ms。db.getProfilingLevel...原创 2018-05-31 21:01:52 · 1236 阅读 · 0 评论 -
rvm,ruby的安装
os: centos 7.5 ruby:2.4.4安装rvm# curl -L get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Uplo...原创 2018-07-10 11:15:39 · 3055 阅读 · 1 评论 -
mongodb 本地快速复制collection
mongodb 的版本是 3.2.6,在数据库内要复制一个collection,可以采用以下方式原始表:t_table 目标表:t_tmp1db.createCollection(“t_tmp1”);db.t_tmp1.createIndex({“custno”:1},{“background”:1})db.t_table.aggregate({$match: {}}, {$out: ‘t_tmp原创 2017-10-25 21:10:00 · 4875 阅读 · 2 评论