Exemple #1
0
 def startSlave(db_path, master, **kwargs):
     '''
         Mandatory parameter: master address
         Example:
             mongo = Mongo()
             mongo.startSlave("192.168.2.100:27020")
             
     '''
     slave = Replication(is_master=False, **kwargs)
     slave.dbPath(db_path)
     slave.source(master)
     slave.initParamaters()
     slave.start()
Exemple #2
0
 def startSlave(db_path, master, **kwargs):
     '''
         Mandatory parameter: master address
         Example:
             mongo = Mongo()
             mongo.startSlave("192.168.2.100:27020")
             
     '''
     slave = Replication(is_master=False, **kwargs)
     slave.dbPath(db_path)
     slave.source(master)
     slave.initParamaters()
     slave.start()
Exemple #3
0
 def startMaster(db_path, **kwargs):
     master = Replication(is_master=True, **kwargs)
     master.dbPath(db_path)
     master.initParamaters()
     master.start()
Exemple #4
0
 def slaveStatus(**kwargs):
     slave = Replication(is_master=False, **kwargs)
     return slave.slaveInfo()
Exemple #5
0
 def masterStatus(**kwargs):
     master = Replication(is_master=True, **kwargs)
     return master.masterInfo()
Exemple #6
0
 def startMaster(db_path, **kwargs):
     master = Replication(is_master=True, **kwargs)
     master.dbPath(db_path)
     master.initParamaters()
     master.start()
Exemple #7
0
 def slaveStatus(**kwargs):
     slave = Replication(is_master=False, **kwargs)
     return slave.slaveInfo()
Exemple #8
0
 def masterStatus(**kwargs):
     master = Replication(is_master=True, **kwargs)
     return master.masterInfo()