SECONDARY> show dbslocal 1.203125GBtest? (empty)SECONDARY> show dbslocal 1.203125GBtest? (empty)SECONDARY> use localswitched to db localSECONDARY> show collections;meoplog.rs??????????? 數(shù)據(jù)語(yǔ)句是先存儲(chǔ)在該文件中的,100ms寫入磁盤replset.minvalidsystem.indexessystem.replsetSECONDARY>
If?true, this member will participate in vote but receive no data.
1.6
buildIndexes
true
When?false, prevent secondary indexes from being created on this member. This is typically used on machines that are pure "backup" machines that are never queried. By not having the secondary indexes, the member performs less works on writes and requires less ram. Note the _id index is still created. Can only be set to?false?if?priority:0. It is rare to use this option.
1.6
hidden
false
If?true, do not advertise the member's existence to clients in?isMaster?command responses. Hidden replicas makes sense for replicas of data which have very different use patterns (reporting, integration, backup, etc.) than the main set of replicas; this option allows you to keep from sending normal non-primary queries to the node.
1.7
priority
1.0
Priority of the server for elections. Higher priority servers will be preferred as primary. (more information)
1.6, 1.9
tags
{}
An document representing the location of this server. Tags can be used for location-aware write guarantees and read locality, see?Data Center Awareness
1.9.1
slaveDelay
0
Number of seconds to remain behind the primary. A value of 0 implies "as up-to-date as possible".? Used to recover from human errors (e.g.: accidentally dropping a database). Can only be set on members with priority 0. Slave delay members are a great way to keep a rolling backup from a certain amount of time in the past.
1.6.3
votes
1
Number of votes this member has in an election. Generally you should not change this. (more information)
1.6
七、移除節(jié)點(diǎn):
rs.remove("IP:27017")rs.remove("IP")
八、replica?的成員級(jí)別類型:?
prority 優(yōu)先級(jí);Delayed 同步間隔;Hidden 隱藏
You must send the rs.reconfig() command to a set member that can become primary. In the above example, if you issue the rs.reconfig() operation to the member with the _id of 0, the operation will fail.這個(gè)是隱藏的解釋,其它的就不用說了。
Perform a full resync. If you stop the failed?mongod, delete all data in the dbpath (including subdirectories), and restart it, it will automatically resynchronize itself.?Obviously it would be better/safer to back up the data first. If disk space is adequate, simply move it to a backup location on the machine if appropriate.?Resyncing may take a long time if the database is huge or the network slow – even idealized one terabyte of data would require three hours to transmit over gigabit ethernet.Copy data from another member: You can copy all the data files from another member of the set IF you have a snapshot of that member's data file's. This can be done in a number of ways. The simplest is to stop?mongod?on the source member, copy all its files, and then restart?mongod?on both nodes. The Mongo?fsync and lock?feature is another way to achieve this if you are using EBS or a SAN. On a slow network, snapshotting all the datafiles from another (inactive) member to a gziped tarball is a good solution. Also similar strategies work well when using SANs and services such as Amazon Elastic Block Service snapshots.Find a member with older data:?Note: this is only possible (and occurs automatically) in v1.8+. If another member of the replica set has a large enough oplog or is far enough behind that the stale member can sync from it, the stale member can bootstrap itself from this member.
十四、限制說明:
A set can contain·???????? 最多有12個(gè)成員·???????? 最多只能在7個(gè)成員中進(jìn)行選舉
補(bǔ)充點(diǎn):節(jié)點(diǎn)的類型
·???????? Primary?- Can be thought of as "master" although which server is primary can vary over time. Only 1 server is primary at a given point in time.·???????? Secondary?- Can be thought of as a slave in the cluster; varies over time.·???????? Recovering?- getting back in sync before entering Secondary mode.