0

我正在尝试使用相同的配置文件进行 tarantool 的主-主复制。这是 host1 和 host2 的 tester.lua。

box.cfg{                                                                             
  listen=3301,                                                                       
  custom_proc_title='tester',      
  memtx_memory=6442450944,                                                   
  replication={'replicator:password@host1:3301','replicator:password@host2:3301'}  
}                                                                                    
box.schema.space.create('tester',{id=512, if_not_exists=true})                       
box.schema.user.grant('guest', 'read,write,execute', 'universe')                     
s=box.space.tester                                                                   
s:create_index('primary',{type='tree',parts={1,'unsigned'}})                         
box.schema.user.create('replicator',{password='password'})          
box.schema.user.grant('replicator','execute','role','replication')  
box.snapshot()                                                      

但是当我在 host1 上运行时

tarantoolctl start tester

在host2上

tarantoolctl start tester

我发现这个配置文件创建了两个没有复制功能的独立 tarantool。

如果我如下更改 host2 的 tester.lua,它就可以工作。

box.cfg{                                                                             
  listen=3301,                                                                       
  custom_proc_title='tester',      
  memtx_memory=6442450944,                                                   
  replication={'replicator:password@host1:3301','replicator:password@host2:3301'}  
}                                                   

我想知道如何使用相同的配置文件?

4

1 回答 1

1

自复制以来,您不能使用相同的配置进行复制。您必须有单独的复制配置。

以下是 MM 复制示例(我喜欢这种方式来配置此功能):

https://github.com/dedok/tarantool-on-edison/blob/master/examples/security-system/in_cloud.lua#L75 - 它已动态配置复制

https://github.com/dedok/tarantool-on-edison/blob/master/examples/security-system/in_device.lua#L28 - 它具有静态配置的复制

我希望这会有所帮助。

于 2017-04-24T14:43:44.303 回答