2016-01-14 20 views
0

我使用Hazelcast作为分布式键值存储。我将存储约。其中100k个密钥 为了在整个hazelcast群集节点之间保持更强的数据一致性,我正在使用IMap的同步备份作为分布式数据结构。面临着榛木备份的问题 - 同步备份不起作用

在2个Unix盒子中运行2个节点的榛树簇, 问题:在两个节点中加载1000条记录的样本数据时,我没有看到备份同步发生,尽管我已经明确将同步备份设置为1 ,从日志中进行验证,还有榛子管理中心。 当我关闭群集的一个hazelcast节点时,数据会丢失,即数据没有从同步备份恢复。

任何人都可以请建议,如果下面提到的任何配置丢失或冲突与同步备份?

请从下面简要hazelcast.xml配置我使用做我的POC:

<group> 
    <name>abc</name> 
    <password>xyz</password> 
</group>  

<map name="default"> 
    <in-memory-format>BINARY</in-memory-format> 
    <backup-count>1</backup-count> 
    <async-backup-count>0</async-backup-count> 
    <read-backup-data>false</read-backup-data> 
    <time-to-live-seconds>0</time-to-live-seconds> 
    <max-idle-seconds>86400</max-idle-seconds> 
    <eviction-policy>LRU</eviction-policy> 
    <max-size policy="used_heap_size">300</max-size> 
    <eviction-percentage>25</eviction-percentage> 
    <min-eviction-check-millis>100</min-eviction-check-millis> 
    <merge-policy>com.hazelcast.map.merge.PutIfAbsentMapMergePolicy</merge-policy> 
    <statistics-enabled>true</statistics-enabled> 
    <map-store enabled="true" initial-mode="LAZY"> 
     <!--<factory-class-name>com.mypackage.FileSystemMapStoreFactory</factory-class-name>--> 
     <class-name>com.java.poc.TestMapStore</class-name> 
     <write-delay-seconds>0</write-delay-seconds> 
     <!--<write-batch-size>1000</write-batch-size>--> 
     <write-coalescing>false</write-coalescing> 
    </map-store> 
</map> 

<serialization> 
    <portable-version>0</portable-version> 
    <use-native-byte-order>true</use-native-byte-order><!-- Set to true to use native byte order for the underlying platform --> 
    <byte-order>BIG_ENDIAN</byte-order> 
    <enable-compression>false</enable-compression><!-- Enables compression if default Java serialization is used --> 
    <enable-shared-object>false</enable-shared-object><!-- Enables shared object if default Java serialization is used --> 
    <allow-unsafe>true</allow-unsafe><!-- Set to true to allow unsafe to be used --> 
    <check-class-def-errors>true</check-class-def-errors> 
    <data-serializable-factories><!-- The DataSerializableFactory class to be registered --> 
     <data-serializable-factory factory-id="1">com.java.poc.DataSerializableFactoryImpl</data-serializable-factory> 
    </data-serializable-factories> 
</serialization> 

回答

0

你看到连接在一起的节点,当您启动起来?有时多播发现不起作用(基于网络配置),因此节点构建两个独立的群集。