2017-04-06 24 views
0

我正在嘗試使用相同的配置文件進行tarantool的master-master複製。這是host1和host2的tester.lua。什麼是master-master tarantool複製設置的正確初始腳本?

box.cfg{                    
    listen=3301,                  
    custom_proc_title='tester',  
    memtx_memory=6442450944,             
    replication={'replicator:[email protected]:3301','replicator:[email protected]: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:[email protected]:3301','replicator:[email protected]:3301'} 
}             

我很好奇如何使用相同的配置文件?

回答

相關問題