Hi! You didn't configure any backups for your cache, so, there is only one node for every key in the cluster. In order to configure backups for cache, use CacheConfiguration.setBackups(int) <https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/CacheConfiguration.html#setBackups(int)> method.
Note, that there is no such thing as "primary node" in general. Every key has its own primary and backup nodes. Different keys have different primary nodes. It is briefly covered here: https://apacheignite.readme.io/docs/primary-and-backup-copies Another option is to make the cache replicated, but it will make insert/put/update operations slower. Covered here: https://apacheignite.readme.io/docs/cache-modes > Check both nodes with Dbeaver, running statement 'Select * from M_Message'. Do you mean, that you connected to different Ignite nodes, using JDBC driver, and ran queries? In this case you will get the same result, regardless of where the data is stored. If some data is missing on a local node, Ignite sends requests to other nodes. So, if you get some data, while being connected to some particular node, it doesn't mean, that this data is stored locally. Denis чт, 18 янв. 2018 г. в 6:57, rizal123 <[email protected]>: > Hi, > > I have experiment create 2nodes server. (IP: 10.5.42.95 and 10.5.42.96) > With this Ignite Configuration: > IgniteConfiguration cfg = new IgniteConfiguration(); > cfg.setIgniteInstanceName("BrandCluster"); > TcpDiscoveryVmIpFinder ipFinder = new > TcpDiscoveryVmIpFinder(); > ipFinder.setAddresses(Arrays.asList("10.5.42.95:47500 > ..47509", > "10.5.42.96:47500..47509")); > > TcpDiscoverySpi discovery = new TcpDiscoverySpi(); > discovery.setLocalPort(47500); > discovery.setIpFinder(ipFinder); > cfg.setDiscoverySpi(discovery); > > And this is Cache Configuration: > CacheConfiguration ccfg = new CacheConfiguration(); > ccfg.setName("MMessageLogCache"); > ccfg.setCacheMode(CacheMode.PARTITIONED); > ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); > ccfg.setOnheapCacheEnabled(true); > ccfg.setSqlSchema("PUBLIC"); > ccfg.setReadThrough(true); > ccfg.setWriteThrough(true); > > ccfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC); > ccfg.setCacheStoreFactory(cacheStoreFactory); // Cache > store > to oracle > ccfg.setWriteBehindEnabled(true); > ccfg.setWriteBehindFlushSize(3); > ccfg.setWriteBehindFlushFrequency(15000); // 15 seconds > > My Case: > 1. Client using DBeaver (for testing this case). > 2. Dbeaver connect to IP = 10.5.42.95 (Primary Node). > 3. Running statement "Insert Into M_Message ... XYZ ... " > 4. Check both nodes with Dbeaver, running statement 'Select * from > M_Message'. > 5. Data 'XYZ' is present on both node. > 6. Shutdown Primary Node (Kill -9). > 7. The data 'XYZ' also lost at second node. > 8. I have set 'Write behind enable', and use frequency 15seconds or 3 > (inserted row). > 9. So the data never stored to oracle, because the data at second node is > also lost. > > Please let me know if there is misconfiguration... > > > > -- > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ >
