0

I'm trying to use the same config file for master-master replication of tarantool. Here is the tester.lua for host1 and host2.

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()                                                      

But when I run on host1

tarantoolctl start tester

and on host2

tarantoolctl start tester

I found this config file create two separated tarantool without replication function.

If I change the tester.lua of host2 as follow, it works.

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

I'm wonder how to use the same config file?

Daniel YC Lin
  • 15,050
  • 18
  • 63
  • 96

1 Answers1

1

You can't use the same configuration for replication since replication. You have to have separate replication configuration.

Here is examples M-M replication (I like this way to configure this feature):

https://github.com/dedok/tarantool-on-edison/blob/master/examples/security-system/in_cloud.lua#L75 - it has dynamically configured replication

https://github.com/dedok/tarantool-on-edison/blob/master/examples/security-system/in_device.lua#L28 - it has statically configured replication

I hope this help.