摘要: linux 时间相关命令小结 作者:xingxingge 发布于:2014-1-7 20:24 Tuesday 分类:Linux Shell 编辑 简单总结下linux中时间相关命令date,hwclock,clock的用法 1. date命令: (1)修改系统时间:格式:date MMDDHHMM 阅读全文
posted @ 2021-06-08 10:12 hexel 阅读(58) 评论(0) 推荐(0) 编辑
摘要: find命令在工作中用的是相当多的,下面总结下find命令的常见用法: 1.查找文件或者路径: [root@hexel ~/shell]#find /etc -name ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconf 阅读全文
posted @ 2021-05-23 00:14 hexel 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 初始化序列: mongos> db.counters.insert({ _id: "userid", seq: 0 } ) 写一个函数,用于更新序列值。 function getNextSequence(name){ var result=db.counters.findAndModify({ qu 阅读全文
posted @ 2021-05-02 18:59 hexel 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 1.安装check_mongodb.py yum install git cd /usr/local/nagios/libexec/ wget --no-check-certificate https://github.com/mzupan/nagios-plugin-mongodb/archive 阅读全文
posted @ 2021-05-02 18:58 hexel 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 分片:数据库横向扩展的一种办法 1.1.1 分片目标: 全部工作自动化进行;保持不同片间的数据平衡;尽量最小化不同片间交叉的数据块大小;分布式存储,从而实现分布式读写,负载平衡 1.1.2 分片三大组件: 分片:一个分片就是一个数据库实例或者一个副本集,用来存放数据库集合的部分数据 配置服务器: 阅读全文
posted @ 2021-05-02 18:57 hexel 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 删除复合条件的一行记录可以用如下语法: db.test.remove({C_ID:"2"},1) 如果是分片环境 mongos> db.test.remove({CT1:"2"},1) can only delete with a non-shard key pattern if can delet 阅读全文
posted @ 2021-05-02 18:56 hexel 阅读(63) 评论(0) 推荐(0) 编辑
摘要: https://jira.mongodb.org/browse/SERVER-7246 In v2.4.9 only (this is set by default in v2.6.0 and later), it is necessary to use the following two star 阅读全文
posted @ 2021-05-02 18:55 hexel 阅读(45) 评论(0) 推荐(0) 编辑
摘要: MongoDB的聚合框架实现sum()、avg()、group by等聚合操作。通过聚合框架,还可对返回的结果进行处理,实现一些特殊需求,例如数据过滤、别名显示、增加字段、提取子字段等。 1 聚合框架组件 聚合框架包含两大组件:管道和表达式。 1.1管道 管道与unix管道类似,实质就是把扫描的数据 阅读全文
posted @ 2021-05-02 18:53 hexel 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 副本集数据同步机制 实例启动后,副本集成员首先通过一次初始化同步来复制数据,然后就开始利用oplog日志和主节点连续进行数据同步。如下日志反应这一过程 点击(此处)折叠或打开 Wed Jul 17 13:18:39.473 [rsSync] replSet initial sync pending 阅读全文
posted @ 2021-05-02 18:50 hexel 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 9 操作 9.1 建立副本集: [mongo_3 /mongodb]# numactl --interleave=all mongod --replSet sh1 --port 10000 --dbpath=/mongodb/sh1/data \ > --logpath=/mongodb/sh1/l 阅读全文
posted @ 2021-05-02 18:49 hexel 阅读(242) 评论(0) 推荐(0) 编辑