本文整理汇总了Python中lib.tarantool_server.TarantoolServer.name方法的典型用法代码示例。如果您正苦于以下问题:Python TarantoolServer.name方法的具体用法?Python TarantoolServer.name怎么用?Python TarantoolServer.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.tarantool_server.TarantoolServer
的用法示例。
在下文中一共展示了TarantoolServer.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TarantoolServer
# 需要导入模块: from lib.tarantool_server import TarantoolServer [as 别名]
# 或者: from lib.tarantool_server.TarantoolServer import name [as 别名]
replica.admin('box.info.server.id ~= %d' % replica_id)
replica.admin('box.info.server.ro')
# Backward-compatibility: box.info.server.lsn is -1 instead of nil
replica.admin('box.info.server.lsn == -1')
replica.admin('box.info.vclock[%d] == 0' % replica_id2)
print '-------------------------------------------------------------'
print 'JOIN replica to read-only master'
print '-------------------------------------------------------------'
#gh-1230 Assertion vclock_has on attempt to JOIN read-only master
failed = TarantoolServer(server.ini)
failed.script = 'replication-py/failed.lua'
failed.vardir = server.vardir
failed.rpl_master = replica
failed.name = "failed"
try:
failed.deploy()
except Exception as e:
line = "ER_READONLY"
if failed.logfile_pos.seek_once(line) >= 0:
print "'%s' exists in server log" % line
print '-------------------------------------------------------------'
print 'Sync master with replica'
print '-------------------------------------------------------------'
# Sync master with replica
replication_source = yaml.load(replica.admin('box.cfg.listen', silent = True))[0]
sys.stdout.push_filter(replication_source, '<replication_source>')
master.admin("box.cfg{ replication_source = '%s' }" % replication_source)
示例2: TarantoolServer
# 需要导入模块: from lib.tarantool_server import TarantoolServer [as 别名]
# 或者: from lib.tarantool_server.TarantoolServer import name [as 别名]
replica.cleanup()
master.admin('box.space._cluster:delete{%d} ~= nil' % replica_id)
print '-------------------------------------------------------------'
print 'JOIN replica to read-only master'
print '-------------------------------------------------------------'
# master server
master = server
master.admin('box.cfg { read_only = true }')
#gh-1230 Assertion vclock_has on attempt to JOIN read-only master
failed = TarantoolServer(server.ini)
failed.script = 'replication-py/failed.lua'
failed.vardir = server.vardir
failed.rpl_master = master
failed.name = "failed"
failed.crash_expected = True
try:
failed.deploy()
except Exception as e:
line = "ER_READONLY"
if failed.logfile_pos.seek_once(line) >= 0:
print "'%s' exists in server log" % line
master.admin('box.cfg { read_only = false }')
print '-------------------------------------------------------------'
print 'JOIN replica with different replica set UUID'
print '-------------------------------------------------------------'
failed = TarantoolServer(server.ini)