Apache Ignite

GridGain Developer Hub - Apache Ignitetm

Welcome to the Apache Ignite developer hub run by GridGain. Here you'll find comprehensive guides and documentation to help you start working with Apache Ignite as quickly as possible, as well as support if you get stuck.

 

GridGain also provides Community Edition which is a distribution of Apache Ignite made available by GridGain. It is the fastest and easiest way to get started with Apache Ignite. The Community Edition is generally more stable than the Apache Ignite release available from the Apache Ignite website and may contain extra bug fixes and features that have not made it yet into the release on the Apache website.

 

Let's jump right in!

 

Documentation     Ask a Question     Download

 

Javadoc     Scaladoc     Examples
Ask A Question

Questions

2
ANSWERED

Problem in starting the server node via java program

My code is :- import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCompute; import org.apache.ignite.IgniteException; import org.apache.ignite.Ignition; public class ExampleNodeStartup { public static void main(String[] args) throws IgniteException{ Ignite ignite= Ignition.start(); IgniteCompute compute = ignite.compute(); // Execute a job and wait for the result. String res = compute.call(() -> { // Print hello world on some cluster node. System.out.println("Hello World"); return "Hello World"; }); } } The error which i get is :- Exception in thread "main" class org.apache.ignite.IgniteException: Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl] at org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:618) at org.apache.ignite.Ignition.start(Ignition.java:273) at ExampleNodeStartup.main(ExampleNodeStartup.java:11) Caused by: class org.apache.ignite.IgniteCheckedException: Failed to create Ignite component (consider adding ignite-spring module to classpath) [component=SPRING, cls=org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl] at org.apache.ignite.internal.IgniteComponentType.componentException(IgniteComponentType.java:273) at org.apache.ignite.internal.IgniteComponentType.create0(IgniteComponentType.java:264) at org.apache.ignite.internal.IgniteComponentType.create(IgniteComponentType.java:175) at org.apache.ignite.internal.IgnitionEx.loadConfigurations(IgnitionEx.java:546) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:737) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:697) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:651) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:426) at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:406) at org.apache.ignite.Ignition.start(Ignition.java:270) ... 1 more Caused by: java.lang.ClassNotFoundException: org.apache.ignite.internal.processors.spring.IgniteSpringProcessorImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:260) at org.apache.ignite.internal.IgniteComponentType.create0(IgniteComponentType.java:250) ... 9 more Whats the exact problem and what are the steps to run?..Do we have to run the command bin/ignite.sh..???

Posted by Piyali about a year ago

5
ANSWERED

Serialization Exception when trying to query cache on remote node.

I though I would start a fresh question and make sure I didn't fudge up renaming my types before posting in public location. Using 1.0. When I run a query on a remote node, I get a serialization exception... Apr 14, 2015 4:18:27 PM org.apache.ignite.logger.java.JavaLogger error SEVERE: Error sending reply for job [nodeId=e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, jobId=769f499bc41-7adb4843-c99d-4896-8aea-284f53366934, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=com.xxx.service.MyService2$$Lambda$69/1280666626, dep=LocalDeployment [super=GridDeployment [ts=1429042694671, depMode=SHARED, clsLdr=sun.misc.Launcher$AppClassLoader@55f96302, clsLdrId=f0a0599bc41-7adb4843-c99d-4896-8aea-284f53366934, userVer=0, loc=true, sampleClsName=java.lang.String, pendingUndeploy=false, undeployed=false, usage=0]], taskClsName=com.xxx.service.MyService2$$Lambda$69/1280666626, sesId=669f499bc41-e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, startTime=1429042707780, endTime=9223372036854775807, taskNodeId=e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, clsLdr=sun.misc.Launcher$AppClassLoader@55f96302, closed=false, cpSpi=null, failSpi=null, loadSpi=null, usage=1, fullSup=false, subjId=e265c5c8-d18b-4ce9-9d36-5be1bdf774e7, mapFut=IgniteFuture [orig=GridFutureAdapter [resFlag=0, res=null, startTime=1429042707735, endTime=0, lsnr=null, state=INIT]]], jobId=769f499bc41-7adb4843-c99d-4896-8aea-284f53366934], job=C1 [arg=com.xxx.model.MyTrx2@4a62b3dd]] class org.apache.ignite.IgniteCheckedException: Failed to serialize object: [Entry [key=3, val=com.xxx.model.MyTrx2@552381d5]] at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.marshal(OptimizedMarshaller.java:186) at org.apache.ignite.internal.processors.job.GridJobWorker.finishJob(GridJobWorker.java:706) at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:527) at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:423) at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:107) at org.apache.ignite.internal.processors.job.GridJobProcessor.processJobExecuteRequest(GridJobProcessor.java:1118) at org.apache.ignite.internal.processors.job.GridJobProcessor$JobExecutionListener.onMessage(GridJobProcessor.java:1714) at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:664) at org.apache.ignite.internal.managers.communication.GridIoManager.access$1500(GridIoManager.java:57) at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:627) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.NotSerializableException: Must implement java.io.Serializable or set OptimizedMarshaller.setRequireSerializable() to false (note that performance may degrade if object is not Serializable): org.apache.ignite.internal.processors.cache.CacheEntryImpl at org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:703) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:217) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeHashMap(OptimizedObjectOutputStream.java:357) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeHashSet(OptimizedObjectOutputStream.java:373) at org.apache.ignite.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:655) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:217) at org.apache.ignite.marshaller.optimized.OptimizedObjectOutputStream.writeObjectOverride(OptimizedObjectOutputStream.java:131) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:344) at org.apache.ignite.marshaller.optimized.OptimizedMarshaller.marshal(OptimizedMarshaller.java:181) ... 12 more This is how I query: http://pastebin.com/9ipi3q2u The model: http://pastebin.com/MbH2cL3H

Posted by John Smith about a year ago

8

Cache not loading correctly

I have a problem with a cache loader service that loads data into a cache at process start-up. If I run a single node, everything works fine and my log message shows the exact same number of items added to the cache as the calls: `ignite.jcache(cacheName).localSize(CachePeekMode.PRIMARY)` and `ignite.jcache(cacheName).size(CachePeekMode.PRIMARY)` return. If I then start more nodes running, then everything works as I'd expect and the full cache is balanced correctly across the cluster. The cache size remains the same overall, and the local caches show numbers indicating that the data has been shared between them correctly. Problems appear though when I start multiple nodes at the same time. My log message confirms that the same number of records were added to the cache but `ignite.jcache(cacheName).localSize(CachePeekMode.PRIMARY)` and `ignite.jcache(cacheName).size(CachePeekMode.PRIMARY)` both return a significantly lower number. On the last run my logs show that 1,163,076 records were added to the cache, but both the above method calls show only 376,879 entries. Running `ignite.jcache(cacheName).localSize(CachePeekMode.PRIMARY)` on the other nodes in the cluster consistently returns `0`. Have you seen problems like this, and can you suggest a fix? This looks like a cache balancing problem during the discovery phase to me. I don't want to have to start the primary node before the others at this will complicate the deployment and will mean that one node will have to hold all the records until the other nodes are running. Thanks, Steve.

Posted by Steve Neal about a year ago

3
ANSWERED

Trouble working with Data Grid Getting Started examples

Hello, I am having issues working with the grid examples provided in http://apacheignite.readme.io/v1.0/docs/getting-started I have the following code in main.java (modified for Java6): ```java import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; public class IgniteGettingStarted { public static void main(String[] args) { final String CACHE_NAME = IgniteGettingStarted.class.getSimpleName(); try { Ignite ignite = Ignition.start("examples/config/example-cache.xml"); IgniteCache<Integer, String> cache = ignite.cache(CACHE_NAME); // Store keys in cache (values will end up on different cache nodes). for (int i = 0; i < 10; i++) cache.put(i, Integer.toString(i)); for (int i = 0; i < 10; i++) System.out.println("Got [key=" + i + ", val=" + cache.get(i) + ']'); } catch (Exception e) { e.printStackTrace(); } } } ``` When running the main method I get the following error: ``` 11:29:03,775 INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/home/nltran/ignite-fabric-1.0.0-incubating/examples/config/example-cache.xml] 11:29:04,015 INFO org.springframework.context.support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext@1936f0f5: startup date [Wed May 06 11:29:04 CEST 2015]; root of context hierarchy [11:29:04] __________ ________________ [11:29:04] / _/ ___/ |/ / _/_ __/ __/ [11:29:04] _/ // (7 7 // / / / / _/ [11:29:04] /___/\___/_/|_/___/ /_/ /___/ [11:29:04] [11:29:04] ver. 1.0.0#20150329-sha1:5fc2cd05 [11:29:04] 2015 Copyright(C) Apache Software Foundation [11:29:04] [11:29:04] Quiet mode. [11:29:04] ^-- Logging to file '/home/nltran/ignite-fabric-1.0.0-incubating/work/log/ignite-875c62e2.0.log' [11:29:04] ^-- To see **FULL** console log here add -DIGNITE_QUIET=false or "-v" to ignite.{sh|bat} [11:29:04] [11:29:04] Configured plugins: [11:29:04] ^-- None [11:29:04] [11:29:07] Performance suggestions for grid (fix if possible) [11:29:07] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true [11:29:07] ^-- Decrease number of backups (set 'keyBackups' to 0) [11:29:07] [11:29:07] To start Console Management & Monitoring run ignitevisorcmd.{sh|bat} [11:29:07] [11:29:07] Ignite node started OK (id=875c62e2) [11:29:07] Topology snapshot [ver=5, nodes=3, CPUs=4, heap=1.5GB] java.lang.IllegalArgumentException: Cache is not started: IgniteGettingStarted at org.apache.ignite.internal.processors.cache.GridCacheProcessor.publicJCache(GridCacheProcessor.java:2271) at org.apache.ignite.internal.IgniteKernal.cache(IgniteKernal.java:2256) at org.apache.flink.ps.impl.IgniteGettingStarted.main(IgniteGettingStarted.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) ``` I have set the IGNITE_HOME environment variable prior to the execution. My pom.xml includes apache-ignite-core and apache-ignite-spring. Can anyone tell me what is missing? Best regards,

Posted by Tran Nam-Luc about a year ago