Re: Data lost when primary nodes down.

2018-01-26 Thread Ilya Kasnacheev
Hello!

In Ignite, caches are usually partitioned. This means that data is split
into some number e.g. 128) partitions, which are stored on a different
nodes.
For example, for three node cluster, one node (10.5.42.95) will store 1/3
of data in primary paritions and another 1/3 data in backup partitions (if
you have backups = 1)
This ensures that if this node goes away, there's at least one copy of each
partition on the remaining ones.

But when you connect to this node with dbeaver or any other client, you can
access all the data. Everything, regardless on which node it is stored, is
accessible.

Regards,

-- 
Ilya Kasnacheev

2018-01-25 4:27 GMT+03:00 rizal123 :

> Hi Denis,
>
> Would you mind clarification my statement?
> I'm a little bit confuse with primary and backup nodes. And where the data
> is stored.
>
> Thanks
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>


Re: Data lost when primary nodes down.

2018-01-24 Thread rizal123
Hi Denis,

Would you mind clarification my statement?
I'm a little bit confuse with primary and backup nodes. And where the data
is stored.

Thanks




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: Data lost when primary nodes down.

2018-01-19 Thread rizal123
Hi Denis,

Thanks for your reply.

> 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) method.

If i have 3 nodes server, do i have to set up which is the primary and
backup nodes?
It is like paradigm DBMS Master and Slave? 
I will put F5 before invoke into my 3 nodes server. So the F5 will become
load balancer and also failover.
Is it fine?
What if i set second node and third nodes to 'Backup', and suddenly first
node down, then F5 will pointer to 2nd or 3rd nodes. How about
insert/put/update operations will be? Where is the data will be stored?


> 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

Yes I have implemented replication cache
(https://apacheignite.readme.io/docs/cache-modes).

> Do you mean, that you connected to different Ignite nodes, using JDBC
> driver, and ran queries? 
yes it is.

>In this case you will get the same result, regardless of where the data is
stored. 
In my case, data will be stored at this nodes (IP = 10.5.42.95) right?
>> 2. Dbeaver connect to IP = 10.5.42.95 

>If some data is missing on a local node, Ignite sends requests to other
nodes. 
I think the data will be stored on each cluster. I was wrong about this.

Would you mind to clarification about this...





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/


Re: Data lost when primary nodes down.

2018-01-18 Thread Denis Mekhanikov
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)

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 :

> 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/
>


Data lost when primary nodes down.

2018-01-17 Thread rizal123
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/