mongodb
文章平均质量分 65
達爾蓋的旗幟
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
用户及角色管理(上)
用户及角色管理(上) db版本2.6.4 系统内建角色如下 Database User Roles: read readWrite Database Administration Roles: dbAdmin dbOwner userAdmin Cluster Administration Roles: clusterAmin clusterManager原创 2014-10-21 18:00:50 · 823 阅读 · 0 评论 -
修改(Secondary,Primary set)Oplog文件大小
1.Restart a Secondary in Standalone Mode on a Different Port db.shutdownServer() mongod --port 37017 --dbpath /data/standby 2.Create a Backup of the Oplog (Optional) mongodump --db local --原创 2014-10-29 17:01:08 · 776 阅读 · 0 评论 -
将Secondary成员转变为Arbiter成员
1.If your application is connecting directly to the secondary, modify the application so that MongoDB queries don’t reach the secondary. 2.Shut down the secondary. 3.Remove the secondary from the re原创 2014-10-29 16:34:32 · 688 阅读 · 0 评论 -
复制集初体验-不带安全的三成员复制集
环境准备: 搭建3台虚拟机 保证3台互通 在每台/etc/hosts添加主机名 ip记录即可 host1:primary host2: standby host3: mail 1.分别启动mongod实例,rs名字为 rs0 mongod --replSet "rs0" --dbpath /data/primary mongod --replSet "rs0" --dbpath /da原创 2014-10-29 15:17:49 · 522 阅读 · 0 评论 -
复制集成员配置管理
1.修改成员priority The value of priority can be any floating point (i.e. decimal) number between 0 and 1000. The default value for the priority field is 1.The higher the number, the higher the priority.原创 2014-10-29 16:28:45 · 541 阅读 · 0 评论 -
用户管理实验-认证
1. 不已认证方式启动数据库 # mongod 2.在admin数据库下创建管理test数据库的用户root > use admin switched to db admin > db.createUser( ... { ... user: "root", ... pwd: "redhat", ... roles: ... [ ... { ...原创 2014-10-28 17:42:19 · 1012 阅读 · 0 评论 -
mongo之Wtire Concern(安全写级别)
The mongo shell and the MongoDB drivers use Acknowledged as the default write concern. //mongo shell和monogdb驱动将Acknowledged 作为默认的写安全级别 Read Isolation(读隔离) MongoDB allows clients to read documents ins原创 2014-10-23 12:07:04 · 1885 阅读 · 0 评论 -
查询返回的字段显示($,$slice,$elemMatch)
1.查看容器中的所有文档 db.inventory.find() { "_id" : ObjectId("5446ebddd251b112db5bf7bc"), "item" : "ABC1", "details" : {"model" : "14Q3","manufacturer" : "XYZ Company"}, "stock" : [ { "size" : "S", "q原创 2014-10-22 16:29:53 · 999 阅读 · 0 评论 -
mongod CRUD
一:插入数据 1.直接插入 db.inventory.insert( { item: "ABC1", details: { model: "14Q3", manufacturer: "XYZ Company" }, stock: [ { size: "S", qty: 25 }, { size: "M", qty: 5原创 2014-10-22 14:44:18 · 535 阅读 · 0 评论 -
用户及角色管理(下)
1.创建角色 use admin db.createRole({ role: "myRole", privileges: [ { resource: { cluster: true }, actions: [ "addShard" ] }, { resource: { db: "local", collection: "" }, actions: [ "insert"原创 2014-10-21 21:10:47 · 541 阅读 · 0 评论 -
启动和关闭数据库
mongodb针对不同操作系统有不同的安装包,直接解压就可以用将mongodb/bin加入到环境变量中方便使用 通过mongod -h可以查看使用说明,通常通过一个配置文件来启动,那样更方便和灵活 举例如下: cat mongod.conf dbpath = /Users/ranyuan/Desktop/mongodb/data //数据文件存放位置 logpa原创 2014-10-21 19:11:17 · 614 阅读 · 0 评论 -
复制集概念
复制集的概念篇: 复制集:Replica Set,一个复制集中只能有一个primary set,一个复制中最多有12个成员,并且最多只有7个能同时投票。 成员分类: 1.Replica Set Priamry:接受所有写操作,也可以是所有读操作。 2.Replica Set Secondary Members :应用Priamry的oplog日志来复制数据,原创 2014-10-28 16:39:20 · 904 阅读 · 0 评论
分享