2017-04-06 11 views
0

tarantool의 마스터 - 마스터 복제에 동일한 구성 파일을 사용하려고합니다. 여기에 host1과 host2에 대한 테스터 .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()              

하지만

tarantoolctl start tester 

및 host2의

tarantoolctl start tester 

에 host1의

에서 실행할 때이 설정 파일 복제 기능이없는 두 개의 분리 된 tarantool을 만들 발견했다.

다음과 같이 host2의 tester.lua를 변경하면 작동합니다.

box.cfg{                    
    listen=3301,                  
    custom_proc_title='tester',  
    memtx_memory=6442450944,             
    replication={'replicator:[email protected]:3301','replicator:[email protected]:3301'} 
}             

동일한 구성 파일을 사용하는 방법이 궁금하십니까?

답변

0

복제 이후 복제에 동일한 구성을 사용할 수 없습니다. 별도의 복제 구성이 있어야합니다. 여기

는 예 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 복제를 구성한 - 그것은 정적으로 나는이 도움이 희망 복제를

을 구성한 .