You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by nithin91 <ni...@franklintempleton.com> on 2020/05/18 14:46:09 UTC
Deploying Ignite Code
Hi
Can any let me know whether should i deploy my Ignite Project developed in
UNIX in each and every node.If Yes, then should it be deployed on the bin
folder shipped with ignite or can it be kept in any folder.
Currently we are following steps
1. We created a bean file which has all the cache configuration details and
data region configuration details.
2. Content of this xml file is copied into the default-config.xml file
shipped with ignite present on each Linux server node and then starting each
server node using nohup ./ignite.sh
3. From my local system using the same xml file but adding an additional
property Client mode=true
and then running a standalone java program to load the cache.
With the help of peerclassloading enabled=True, i am able to execute my
java program without deploying the classes in each server node.
But this method of execution is not working, if i use cache.invoke or
cache.invokeall methods as i am getting ClassNotfoundException even though
the class is present in my local machine.
Can you please let me know how to overcome this error.
Following is the log generated by the program
[20:08:21] __________ ________________
[20:08:21] / _/ ___/ |/ / _/_ __/ __/
[20:08:21] _/ // (7 7 // / / / / _/
[20:08:21] /___/\___/_/|_/___/ /_/ /___/
[20:08:21]
[20:08:21] ver. 2.7.6#20190911-sha1:21f7ca41
[20:08:21] 2019 Copyright(C) Apache Software Foundation
[20:08:21]
[20:08:21] Ignite documentation: http://ignite.apache.org
[20:08:21]
[20:08:21] Quiet mode.
[20:08:21] ^-- Logging by 'JavaLogger [quiet=true, config=null]'
[20:08:21] ^-- To see **FULL** console log here add -DIGNITE_QUIET=false
or "-v" to ignite.{sh|bat}
[20:08:21]
[20:08:21] OS: Windows 10 10.0 amd64
[20:08:21] VM information: Java(TM) SE Runtime Environment 1.8.0_131-b11
Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.131-b11
[20:08:21] Please set system property '-Djava.net.preferIPv4Stack=true' to
avoid possible problems in mixed environments.
[20:08:21] Initial heap size is 254MB (should be no less than 512MB, use
-Xms512m -Xmx512m).
[20:08:21] Configured plugins:
[20:08:21] ^-- None
[20:08:21]
[20:08:21] Configured failure handler: [hnd=StopNodeOrHaltFailureHandler
[tryStop=false, timeout=0, super=AbstractFailureHandler
[ignoredFailureTypes=[SYSTEM_WORKER_BLOCKED,
SYSTEM_CRITICAL_OPERATION_TIMEOUT]]]]
[20:08:27] Message queue limit is set to 0 which may lead to potential OOMEs
when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to
message queues growth on sender and receiver sides.
[20:08:27] Security status [authentication=off, tls/ssl=off]
[20:08:28] REST protocols do not start on client node. To start the
protocols on client node set '-DIGNITE_REST_START_ON_CLIENT=true' system
property.
[20:09:00] Performance suggestions for grid (fix if possible)
[20:09:00] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
[20:09:00] ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC' to JVM
options)
[20:09:00] ^-- Specify JVM heap max size (add '-Xmx<size>[g|G|m|M|k|K]' to
JVM options)
[20:09:00] ^-- Set max direct memory size if getting 'OOME: Direct buffer
memory' (add '-XX:MaxDirectMemorySize=<size>[g|G|m|M|k|K]' to JVM options)
[20:09:00] ^-- Disable processing of calls to System.gc() (add
'-XX:+DisableExplicitGC' to JVM options)
[20:09:00] Refer to this page for more performance suggestions:
https://apacheignite.readme.io/docs/jvm-and-system-tuning
[20:09:00]
[20:09:00] To start Console Management & Monitoring run
ignitevisorcmd.{sh|bat}
[20:09:00]
[20:09:00] Ignite node started OK (id=6601bb78)
[20:09:00] Topology snapshot [ver=217, locNode=6601bb78, servers=2,
clients=1, state=ACTIVE, CPUs=16, offheap=9.0GB, heap=9.6GB]
[20:09:00] ^-- Baseline [id=0, size=2, online=2, offline=0]
[20:09:03] Ignite node stopped OK [uptime=00:00:03.075]
Exception in thread "main" javax.cache.processor.EntryProcessorException:
class org.apache.ignite.binary.BinaryInvalidTypeException:
ignite.example.IgniteUnixImplementation.NumberandDateFormat
at
org.apache.ignite.internal.processors.cache.CacheInvokeResult.get(CacheInvokeResult.java:108)
at
org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.invoke(IgniteCacheProxyImpl.java:1440)
at
org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.invoke(IgniteCacheProxyImpl.java:1482)
at
org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.invoke(GatewayProtectedCacheProxy.java:1228)
at Load.Computejob.main(Computejob.java:22)
Caused by: class org.apache.ignite.binary.BinaryInvalidTypeException:
ignite.example.IgniteUnixImplementation.NumberandDateFormat
at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:707)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize0(BinaryReaderExImpl.java:1758)
at
org.apache.ignite.internal.binary.BinaryReaderExImpl.deserialize(BinaryReaderExImpl.java:1717)
at
org.apache.ignite.internal.binary.BinaryObjectImpl.deserializeValue(BinaryObjectImpl.java:798)
at
org.apache.ignite.internal.binary.BinaryObjectImpl.value(BinaryObjectImpl.java:143)
at
org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinary(CacheObjectUtils.java:177)
at
org.apache.ignite.internal.processors.cache.CacheObjectUtils.unwrapBinaryIfNeeded(CacheObjectUtils.java:67)
at
org.apache.ignite.internal.processors.cache.CacheObjectContext.unwrapBinaryIfNeeded(CacheObjectContext.java:125)
at
org.apache.ignite.internal.processors.cache.GridCacheContext.unwrapBinaryIfNeeded(GridCacheContext.java:1773)
at
org.apache.ignite.internal.processors.cache.CacheLazyEntry.getValue(CacheLazyEntry.java:149)
at
org.apache.ignite.internal.processors.cache.CacheLazyEntry.getValue(CacheLazyEntry.java:137)
at Load.Computejob.lambda$0(Computejob.java:24)
at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.runEntryProcessor(GridCacheMapEntry.java:6628)
at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.call(GridCacheMapEntry.java:5974)
at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry$AtomicCacheUpdateClosure.call(GridCacheMapEntry.java:5782)
at
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Invoke.invokeClosure(BPlusTree.java:3722)
at
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Invoke.access$5900(BPlusTree.java:3616)
at
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.invokeDown(BPlusTree.java:1904)
at
org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.invoke(BPlusTree.java:1782)
at
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke0(IgniteCacheOffheapManagerImpl.java:1642)
at
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl$CacheDataStoreImpl.invoke(IgniteCacheOffheapManagerImpl.java:1625)
at
org.apache.ignite.internal.processors.cache.persistence.GridCacheOffheapManager$GridCacheDataStore.invoke(GridCacheOffheapManager.java:1935)
at
org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.invoke(IgniteCacheOffheapManagerImpl.java:428)
at
org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerUpdate(GridCacheMapEntry.java:2295)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2494)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.update(GridDhtAtomicCache.java:1951)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1780)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal(GridDhtAtomicCache.java:1668)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.processNearAtomicUpdateRequest(GridDhtAtomicCache.java:3138)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.access$400(GridDhtAtomicCache.java:135)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$5.apply(GridDhtAtomicCache.java:271)
at
org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$5.apply(GridDhtAtomicCache.java:266)
at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.processMessage(GridCacheIoManager.java:1056)
at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.onMessage0(GridCacheIoManager.java:581)
at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:380)
at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.handleMessage(GridCacheIoManager.java:306)
at
org.apache.ignite.internal.processors.cache.GridCacheIoManager.access$100(GridCacheIoManager.java:101)
at
org.apache.ignite.internal.processors.cache.GridCacheIoManager$1.onMessage(GridCacheIoManager.java:295)
at
org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1569)
at
org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:1197)
at
org.apache.ignite.internal.managers.communication.GridIoManager.access$4200(GridIoManager.java:127)
at
org.apache.ignite.internal.managers.communication.GridIoManager$9.run(GridIoManager.java:1093)
at
org.apache.ignite.internal.util.StripedExecutor$Stripe.body(StripedExecutor.java:505)
at
org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException:
ignite.example.IgniteUnixImplementation.NumberandDateFormat
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at
org.apache.ignite.internal.util.IgniteUtils.forName(IgniteUtils.java:8775)
at
org.apache.ignite.internal.MarshallerContextImpl.getClass(MarshallerContextImpl.java:349)
at
org.apache.ignite.internal.binary.BinaryContext.descriptorForTypeId(BinaryContext.java:698)
... 44 more
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Deploying Ignite Code
Posted by nithin91 <ni...@franklintempleton.com>.
Thanks for the inputs.It is really helpful.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Deploying Ignite Code
Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!
It is usually enough to include just the POJO files and their direct
dependencies.
Regards,
--
Ilya Kasnacheev
вс, 24 мая 2020 г. в 22:11, nithin91 <
nithinbharadwaj.govindaraju@franklintempleton.com>:
> Can anyone please help me with your inputs
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
Re: Deploying Ignite Code
Posted by nithin91 <ni...@franklintempleton.com>.
Can anyone please help me with your inputs
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Deploying Ignite Code
Posted by nithin91 <ni...@franklintempleton.com>.
Hi
Thanks for the inputs.
I have few queries.
For example i have few caches which have custom key a JAVA POJO Class and
custom Value which is also a JAVA POJO Class.Currently i am unable to do
Cache.invoke and Cache.invokeall operations with peer class loading(i.e
facing class Not Found Exception),so decided to deploy the jar files in each
of the server nodes.
In this case do i need to create a JAR file for the POJO Classes alone or
for the entire eclipse project and should i include the maven dependencies
also in the JAR File(i.e is Uber Jar needed).
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Deploying Ignite Code
Posted by akorensh <al...@gmail.com>.
Hi,
To explicitly deploy classes copy them to the libs dir. (located in
$IGNITE_HOME\libs)
Ignite takes the jars from the libs dir and puts them into the classpath.
Your classes need to be in the classpath.
Use jinfo <pid> or Visual VM to look at the classpath of the running java
ignite project, and
verify that your jars are there.
https://apacheignite.readme.io/docs/zero-deployment#explicit-deployment
cache configuration classes (cacheStore implementations, eviction and
expiry policies, etc.) need to be
explicitly deployed on all server nodes
The peer class loading functionality does not deploy the key and object
classes of the entries stored in
caches.
If you are using BinaryObject API then the cache Key/Value classes are
not needed: https://apacheignite.readme.io/docs/binary-marshaller
-----------------------------------------------------------------------------------
PeerClassLoading works for the following cases:
Tasks and jobs submitted via the compute interface.
Transformers and filters used with scan queries and continuous queries.
Stream transformers, receivers and visitors used with data streamers.
Entry processors.
see:
https://apacheignite.readme.io/docs/zero-deployment#peer-class-loading
https://apacheignite.readme.io/docs/deployment-modes
Thanks, Alex
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/