Distributed in-memory only cache XML for non-Spring users

classic Classic list List threaded Threaded
6 messages Options
pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Distributed in-memory only cache XML for non-Spring users

asked by madhava

The examples XMLs I have seen are assuming Spring framework. We use Google Guice for dependency injection. What is a good sample XML file to start up replicated cache nodes? Is the data stored in cache visible through visor or REST API etc by default? I would like to restrict access to the distributed cache only to the programs that are using it (to protect sensitive data) and not persist the data to file/database.

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss

pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Distributed in-memory only cache XML for non-Spring users

This post was updated on .
commented by yakov zhdanov

You can configure Ignite programmatically. Take a look at IgniteConfiguration and CacheConfiguration classes. In this example provided with Ignite we configure Ignite from code - MemcacheRestExample

You can disable rest access by setting IgniteConfiguration.setConnectorConfiguration(null);

GridGain (built on top of Ignite) has security and audit APIs which may help in your case.

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss

pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Distributed in-memory only cache XML for non-Spring users

commented by madhava

Thank you. MemcacheRestExample did help me some.

I was hoping for an example where 1) Two data nodes on two different servers are started (each node bound to a specific IP address on the these multi-ip servers) and either of such data nodes create a replicated cache at the startup, 2) A client node tries to connect join either or both of these data nodes cluster to query or modify cache.

As this all has to be done in java, I have been browsing through source code to find right way to do that.

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss

pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Distributed in-memory only cache XML for non-Spring users

commented by sergey kozlov

Hi MadhavA.

Please take a look on code pasted in http://pastebin.com/0LnDCAjt.

Briefly about the code: Ignite and cache configuration defined in Node.java Server node creates new cache (if one doesn't exist) named 'mycache' and checks its size every 5sec. Client node puts into 'mycache' new values and exits but server nodes have the content because the replication cache means full copy of content on each node.

Note: you should define ip address of node via command-line.

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss

pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Distributed in-memory only cache XML for non-Spring users

This post was updated on .
commented by madhava

Basically the Server Node started on Node1. Then When I try to start Client on Node 2, I get the exception "class org.apache.ignite.cluster.ClusterTopologyException: Failed to map keys for cache (all partition nodes left the grid)"

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss

pgarg pgarg
Reply | Threaded
Open this post in threaded view
|

Re: Distributed in-memory only cache XML for non-Spring users

commented by madhava

It was my mistake. The first address in the list is used to bind localhost to and it can't be a loopback address like 127.0.0.1. After I changed the first address to a non-loopback address (that is reachable from other nodes), it worked!

-----
This post is migrated from now discontinued Apache Ignite forum at
http://apacheignite.readme.io/v1.0/discuss