本文整理汇总了Python中lib.tarantool_server.TarantoolServer.reconfigure方法的典型用法代码示例。如果您正苦于以下问题:Python TarantoolServer.reconfigure方法的具体用法?Python TarantoolServer.reconfigure怎么用?Python TarantoolServer.reconfigure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.tarantool_server.TarantoolServer
的用法示例。
在下文中一共展示了TarantoolServer.reconfigure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: replica_memcached
# 需要导入模块: from lib.tarantool_server import TarantoolServer [as 别名]
# 或者: from lib.tarantool_server.TarantoolServer import reconfigure [as 别名]
replica_memcached("get 6\r\n")
print """# flush all k-v on master and try to get them from replica"""
master_memcached("flush_all\r\n", silent=True)
wait_for_empty_space(replica)
replica_memcached("get 10\r\n")
print """# check that expiration is working properly on replica"""
master_memcached("set 1 0 1 %d\r\n%s\r\n" % (len(sonet[0]), sonet[0]), silent=True)
lsn = wait()
replica_memcached("get 1\r\n")
replica.wait_lsn(lsn + 1)
replica_memcached("get 1\r\n")
print """# check that expiration is working properly, when replica becomes master"""
master_memcached("set 1 0 1 %d\r\n%s\r\n" % (len(sonet[0]), sonet[0]), silent=True)
lsn = wait()
replica.reconfigure("replication/cfg/replica_to_master.cfg")
replica_memcached("get 1\r\n")
replica.wait_lsn(lsn + 1)
replica_memcached("get 1\r\n")
# restore default suite config
replica.stop()
replica.cleanup(True)
master.stop()
master.deploy(self.suite_ini["config"])
# vim: syntax=python
示例2: insert_tuples
# 需要导入模块: from lib.tarantool_server import TarantoolServer [as 别名]
# 或者: from lib.tarantool_server.TarantoolServer import reconfigure [as 别名]
# insert to master
insert_tuples(master, id, id + ID_STEP)
# select from replica
select_tuples(replica, id, id + ID_STEP, master.get_param("lsn"))
id += ID_STEP
# insert to master
insert_tuples(master, id, id + ID_STEP)
# select from replica
select_tuples(replica, id, id + ID_STEP, master.get_param("lsn"))
id += ID_STEP
print "swap servers"
# reconfigure replica to master
replica.reconfigure("replication/cfg/replica_to_master.cfg", silent = False)
# reconfigure master to replica
master.reconfigure("replication/cfg/master_to_replica.cfg", silent = False)
# insert to replica
insert_tuples(replica, id, id + ID_STEP)
# select from master
select_tuples(master, id, id + ID_STEP, replica.get_param("lsn"))
id += ID_STEP
# insert to replica
insert_tuples(replica, id, id + ID_STEP)
# select from master
select_tuples(master, id, id + ID_STEP, replica.get_param("lsn"))
id += ID_STEP