Re: Creating a distributed cache via cacheManager (JCACHE)

2017-04-18 Thread vkulichenko
Hi,

Please properly subscribe to the mailing list so that the community can
receive email notifications for your messages. To subscribe, send empty
email to user-subscr...@ignite.apache.org and follow simple instructions in
the reply.


mikep-sl wrote
> I have the same problem. The caches are are local and not shared.
> 
> We are using 1.9 and the example-cache.xml config.
> 
> In the client config is:
> 
>  
> 
> With the common VM TCP lookup.

Please provide more information. Configs, code, exact steps you're doing,
etc.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Creating-a-distributed-cache-via-cacheManager-JCACHE-tp9310p12024.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Creating a distributed cache via cacheManager (JCACHE)

2016-11-30 Thread vkulichenko
Hi,

Try to remove configureAndStartCluster() call. I believe you actually have
an exception during the CacheManager start.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Creating-a-distributed-cache-via-cacheManager-JCACHE-tp9310p9318.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Creating a distributed cache via cacheManager (JCACHE)

2016-11-30 Thread veyroke
Hi Val,

My team is working on a cache component, we want to take advantage of
JSR-107. So instead of creating the cache via the Ignite.getOrCreate(..), a
*cacheManager * gets exposed instead.

 I followed your recommendation on 
http://stackoverflow.com/questions/35017564/can-i-use-the-jcache-api-for-distributed-caches-in-apache-ignite
<http://stackoverflow.com/questions/35017564/can-i-use-the-jcache-api-for-distributed-caches-in-apache-ignite>
  
to create a cache via JCACHE.

However, the cache gets created as a *local *cache, instead of a
*distributed *one. I guess i may be missing something in my
configuration/code.

My POC code looks as follows:

 /private static Cache<String, String> *configureJCache*(Ignite ignite) {   
javax.cache.spi.CachingProvider cachingProvider =
Caching.getCachingProvider();

   CacheManager cacheMgr = cachingProvider.getCacheManager();
  
   CacheConfiguration<String, String> cfg = new CacheConfiguration<>();
   cfg.setCacheMode(CacheMode.PARTITIONED);

   return cacheMgr.createCache("cache", cfg);
}/

The cluster gets programmatically configured, and it is started before
calling the above method as follows:

  /  Ignite ignite = configureAndStartCluster(arguments);
   mCache = *configureJCache*(ignite);/

IgniteVisor shows the following topology

/visor> top
Hosts: 1
+==+
|  Int./Ext. IPs  |   Node ID8(@)| Node Type | OS  |
CPUs |  MACs   | CPU Load |
+==+
| 0:0:0:0:0:0:0:1 | 1: D4515BF8(@n0) | Server| Windows 7 amd64 6.1 | 8   
| A4:4E:31:CA:1C:0C   | 0.00 %   |/


but no cache available.

/visor> cache
(wrn) : No caches found./

I also started a two-server cluster, and put an element into the cache in
Node1. Node2 ,however, complains that the cache does not exist when trying
to get a value.

The Ignite version is 1.7, running on windows OS.  As mentioned earlier the
cluster get programmatically configured , no XML involved. The configuration
looks as follows;

/IgniteConfiguration cfg   = new IgniteConfiguration();
TcpDiscoverySpi discovery   = new TcpDiscoverySpi();
TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); 
ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500","127.0.0.1:47501",
"127.0.0.1:47502" ));
discovery.setIpFinder(ipFinder);
cfg.setDiscoverySpi(discovery);/

Any pointer on what i may be missing would be greatly appreciated. 

Thank you
P.S I also validate the the Ignite cachingProvider was registered.

-Rodo




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Creating-a-distributed-cache-via-cacheManager-JCACHE-tp9310.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.