In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Rs is a global variable, which contains replication-related helper functions, most of which are just wrappers for database commands, such as
> db.adminCommand ({"replSetInitiate": config})
Just like
> rs.initiate (config)
Commands are equivalent, but the latter is obviously easier to operate; it is easier to learn more about auxiliary functions.
Execute rs.help () to see the available helper functions, as follows:
Spock:PRIMARY > rs.help () rs.status () {replSetGetStatus: 1} checks replset status rs.initiate () {replSetInitiate: null} initiates set with default settings rs.initiate (cfg) {replSetInitiate: cfg} initiates set with configuration cfg rs.conf () get the current configuration object from local.system.replset rs.reconfig (cfg) updates the configuration of a running replica set with cfg (disconnects) rs.add ( Hostportstr) add a new member to the set with default attributes (disconnects) rs.add (membercfgobj) add a new member to the set with extra attributes (disconnects) rs.addArb (hostportstr) add a new member which is arbiterOnly:true (disconnects) rs.stepDown ([secs]) step down as primary (momentarily) (disconnects) rs.syncFrom (hostportstr) make a secondary to sync from the given member rs.freeze (secs) make a node ineligible to become primary for the time specified rs.remove (hostportstr) remove a host from the replica set (disconnects) rs.slaveOk () shorthand for db.getMongo (). SetSlaveOk () rs.printReplicationInfo () check oplog size and time range rs.printSlaveReplicationInfo () check replica set members and replication lag db.isMaster () check who is primaryreconfiguration helpers disconnect from the database so the shell will display an error Even if the command succeeds. See also http://:28017/_replSet for additional diagnostic info
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.