目前用的是最新孵化版本:1.3.0-incubating。
官方文档https://apacheignite.readme.io/docs/zero-deployment 这里给出了一个一个分布式类加载机制(distributed ClassLoader)。
文档这么说的:
The closures and tasks that you use for your computations may be of any custom class, including anonymous classes. In Ignite, the remote nodes will automatically become aware of those classes, and you won‘t need to explicitly
deploy or move any .jar files to any remote nodes.
Such behavior is possible due to peer class loading (P2P class loading), a specialdistributed ClassLoader in Ignite for inter-node byte-code exchange. With peer-class-loading enabled, you don‘t have to manually
deploy your Java or Scala code on each node in the grid and re-deploy it each time it changes。
在你的计算中,所用到的闭包(java8概念)和任务,可能是我们程序自己写的类,包括匿名类。在Ignite集群中,远程节点们可以相互感知你这些类,这样,我们可以避免显示的把我们的类打包成一个jar文件,放到集群Ignite的每个lib文件下。
这个行为由于peer class loading,一种特殊的分布式类加载,可以在集群几点之间交换字节码,采用peer class loading,你的java代码或scala代码就不用手动发布或由于这些类根据业务需要改动而重新发布到集群机器上。
文档是这么说的,可现在的1.3.0-incubating,Apache Ignite并不是所有的功能能很好的支持。如sql查询,peer
class loading 就会失败。
我提出的isssue:https://issues.apache.org/jira/browse/IGNITE-1255 ,为什么sql查询配置了peer
class loading还是会失败,必须手动发布jar包才可以吗。
答案是:目前有些不支持的,必须手动发布jar包。
回答者这么说的:I think whenIGNITE-950
will be fixed, there will be no need to put user classes on the server side, sopeerClassLoadingEnabled setting will not have special behavior for caches anymore.
而且,目前官方只说了这么句:
It is recommended that peer-class-loading is disabled in production. Generally you want to have a controlled production environment without
any magic. To deploy your classes explicitly, you can copy them into Ignite
folder or manually add them to the classpath on every node.
libs
生成环境禁用这个peer-class-loading,好像目前版本,这个好功能没能很好的实现。
所以,我们还是手动发布jar包。
版权声明:本文为博主原创文章,未经博主允许不得转载[http://blog.csdn.net/doctor_who2004]。