Found that the Ignite Metrics logging is a bit excessive so decided to disabled it.
As indicated in the screenshot, it should be done by setting setMetricsLogFrequency to 0.
However, it does not work. Below is my code for creating IgniteConfiguration. Note that Ignite is created with client mode.
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setMetricsLogFrequency(0); // Trying to disabled it!
cfg.setIgniteInstanceName("IgnitePod");
cfg.setClientMode(true);
cfg.setAuthenticationEnabled(true);
// Ignite persistence configuration.
DataStorageConfiguration storageCfg = new DataStorageConfiguration();
storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
cfg.setDataStorageConfiguration(storageCfg);
cfg.setDiscoverySpi(spi);
Ignite ignite = Ignition.start(cfg);
Any idea on how to solve this?
It is a different Ignite instance. Your one is called "IgnitePod" but this one is "CacheManager_0". You need to adjust its config, too.
Related
I have Wildfly 26.1.2 and Infinispan 13.0.10.Final.
We already have a cluster and Wildfly Infinispan subsystem with cache containers, transport, jgroups, and local caches.
Now we want to use clustered-locks, and I need to create ClusteredLockManager
If I read the manuals here
https://infinispan.org/docs/stable/titles/embedding/embedding.html
They say
// Set up a clustered Cache Manager.
GlobalConfigurationBuilder global = GlobalConfigurationBuilder.defaultClusteredBuilder();
// Configure the cache mode, in this case it is distributed and synchronous.
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.clustering().cacheMode(CacheMode.DIST_SYNC);
// Initialize a new default Cache Manager.
DefaultCacheManager cm = new DefaultCacheManager(global.build(), builder.build());
// Initialize a Clustered Lock Manager.
ClusteredLockManager clm1 =
EmbeddedClusteredLockManagerFactory.from(cm);
In the logs, I see it creates a NEW cluster with a default name (ISPN), and I need to put here all the configurations (at least with jgroups and transport), and duplicate them from the inifinispan-wildfly subsystems
But I don't want to do it because I already have configured cluster in my standalone-ec2-full-ha.xml file with Infinispan caches containers and managers and all that stuff
Can I somehow create my ClusteredLockManager using an already-defined configuration and infinispan-cluster from a standalone-ec2-full-ha.xml file?
Or can I define a config for ClusteredLockManager in my Wildfly subsystem?
And just inject it as a resource in Java Code
If I do something like
#Resource(name = "java:jboss/infinispan/container/cacheManager")
private EmbeddedCacheManager cacheManager;
...
ClusteredLockManager lockManager = EmbeddedClusteredLockManagerFactory.from(cacheManager);
It returns null. And the factory can create ClusteredLockManager only from cacheManager.
Are there any options for creating ClusteredLockManager using the existing cluster and wildfly-infinispan-subsystems configuration?
I am getting the following exception when querying a cache
javax.cache.CacheException: Indexing is disabled for cache: DEFAULT. Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.
The cache configuration is set using a template
// template for cache configurations
CacheConfiguration cacheCfg = new CacheConfiguration("cacheTemplate");
cacheCfg.setBackups(backups);
cacheCfg.setCacheMode(CacheMode.PARTITIONED);
cacheCfg.setIndexedTypes(Key.class, Payload.class);
ignite.addCacheConfiguration(cacheCfg);
Shouldn't that work? Or do I need to set the configuration explicitely, in which case, what is the point of having a template?
I am having an application which is using the IgniteDb as a cache provider .It uses the discovery url as:
127.0.0.1:47500..47509.
Now i want to connect to this cache using java code in eclipse. I have written the code as:
IgniteConfiguration cfg = new IgniteConfiguration().setBinaryConfiguration(
new BinaryConfiguration().setNameMapper(new BinaryBasicNameMapper(true)));
TcpDiscoveryMulticastIpFinder discoveryMulticastIpFinder = new TcpDiscoveryMulticastIpFinder();
Set<String> set = new HashSet<>();
set.add("127.0.0.1:47500..47509");
cfg.setPeerClassLoadingEnabled (true);
TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
discoveryMulticastIpFinder.setAddresses(set);
discoverySpi.setNetworkTimeout (5000);
discoverySpi.setClientReconnectDisabled(true);
cfg.setDiscoverySpi(discoverySpi);
discoverySpi.setIpFinder(discoveryMulticastIpFinder);
cfg.setDiscoverySpi(discoverySpi);
Ignite ignite = Ignition.getOrStart(cfg);
IgniteCache<Integer, Person> cache = ignite.getOrCreateCache("person");
// Code to call cache put or get here
// putCache(cache);
//getCache(cache);
System.out.println("All Available Cache on server : "+ignite.cacheNames());
But on running the erro i am getting the error as:
Caused by: class org.apache.ignite.spi.IgniteSpiException: Local node and remote node have different version numbers
(node will not join, Ignite does not support rolling updates, so versions must be exactly the same)
[locBuildVer=2.7.5, rmtBuildVer=2.8.0,
locNodeAddrs=[aschauha-t470.apac.tibco.com/0:0:0:0:0:0:0:1, aschauha-t470.apac.tibco.com/10.98.51.252, /127.0.0.1, /192.168.0.101],
rmtNodeAddrs=[aschauha-t470.apac.tibco.com/0:0:0:0:0:0:0:1, aschauha-t470.apac.tibco.com/10.98.51.252, /127.0.0.1, /192.168.0.101],
locNodeId=e66eeea7-5427-4fe7-8368-884641af534b, rmtNodeId=35ad5deb-d212-4a85-812e-ec7d44caa4a8]
at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.checkFailedError(TcpDiscoverySpi.java:1997)
at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:1116)
at org.apache.ignite.spi.discovery.tcp.ServerImpl.spiStart(ServerImpl.java:427)
at org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi.spiStart(TcpDiscoverySpi.java:2099)
at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi(GridManagerAdapter.java:297)
... 10 more
Please help me in resolving the issue.
Also, the code which i mentioned above, is it the right way of connecting to the ignite db acting as cache for application?
Error message tells everything needed:
Caused by: class org.apache.ignite.spi.IgniteSpiException: Local node and remote node have different version numbers
(node will not join, Ignite does not support rolling updates, so versions must be exactly the same)
[locBuildVer=2.7.5, rmtBuildVer=2.8.0,
Ignite supports clusters from the same nodes only, so, you should either upgrade your local node to 2.8.0 or downgrade remote node to 2.7.5.
Using Apache Ignite Websession Persistence with Weblogic. The HttpServletResponse.encodeURL method does not work as expected. The issue I'm facing are as follows when cookies are disabled from the browser.
1) Request is sent to node-1 and Ignite creates a new session and when you call HttpServletResponse.encodeURL it appends the 'jsessionId' to the URL and is fine.
2) When you hit the node-2 with the encoded URL from node-1, Ignite is able to pull the session from the Ignite Cache and doesn't create a new session, but when you call encodeURL it doesn't append the 'jsessionid'. This is because the response object has a reference to the Weblogic's HTTPRequest/session objects and not the Ignite wrapper HTTPServleteRequestObjects and it doesn't append the sessionId to the URL.
The only way I can workaround this issue is to override the implementation of encodeURL and encodeRedirectURL methods which I don't prefer as it could be error prone.
Has anybody else faced this issue and found a good solution ?
Is there any setOrCreateCache method in ignite? I just find a getOrCreateCache method.
I want to modify cache settings on a running ignite instance. How to?
My ignite version is 1.9.0. Thanks.
Here is my codes:
IgniteCache<Integer, String> cache = ignite.getOrCreateCache("myCacheName"); // I've created a cache
// How to change the config of myCacheName?
You can dynamically create cache on running ignite by using getOrCreateCache(CacheConfiguration cacheCfg) method. It's possible to dynamically configure cache before create it.