简体   繁体   English

如何调用Ignite服务的所有已部署实例

[英]How to call all deployed instance of a Ignite Service

I have a certain service that is deployed in a cluster group in an Apache Ignite cluster. 我有一个部署在Apache Ignite群集中的群集组中的特定服务。 Cluster group size is 3. Total Number of service instances = 3. Instance per node = 1. 群集组大小为3。服务实例总数=3。每个节点的实例= 1。

No whenever I want to execute the service, I can get an handle to once of the service instances on a node only. 否,无论何时我想执行服务,我都只能获得节点上一次服务实例的句柄。

But I want to execute the service on all the nodes. 但是我想在所有节点上执行服务。 ie. 即。 on all three nodes. 在所有三个节点上。

What is the correct way to do this? 正确的方法是什么?

According to the documentation , you can use node singletons to achieve that level of distribution for a service: 根据文档 ,您可以使用节点单例来实现服务的该分布级别:

Node Singleton 节点单例

You can deploy a per-node singleton service. 您可以部署每个节点的单例服务。 Ignite will guarantee that there is always one instance of the service running on each node. Ignite将保证在每个节点上始终有一个服务实例在运行。 Whenever new nodes are started within the cluster group, Ignite will automatically deploy one instance of the service on every new node. 每当在群集组中启动新节点时,Ignite都会在每个新节点上自动部署服务的一个实例。

The comment refers to the following code snippets: 该注释引用以下代码段:

IgniteServices svcs = ignite.services();
//The .services() method has an overload, to which you can pass a cluster group
svcs.deployNodeSingleton("myNodeSingleton", new MyService());

And its alternative: 及其替代方案:

svcs.deployMultiple("myNodeSingleton", new MyService(), 0, 1);

I supposed that by "service instance", you meant "a running instance of the same service implementation". 我以为“服务实例”是指“同一服务实现的运行实例”。

It sounds like you're looking for remote service invocation. 听起来您正在寻找远程服务调用。 If that's the case, you can use service proxy: https://apacheignite.readme.io/docs/service-example#service-proxy 在这种情况下,您可以使用服务代理: https : //apacheignite.readme.io/docs/service-example#service-proxy

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 org.apache.ignite.IgniteException:无法找到已部署的服务 - org.apache.ignite.IgniteException: Failed to find deployed service 如何为AWS EC2实例中部署的Spring Boot Rest API Web服务创建IAM角色 - how to create IAM role for a spring boot rest api web service deployed in aws ec2 instance 如何通过部署在没有数据库的多个服务器上的服务为每个呼叫生成一个 16 位唯一号码? - How to generate a 16 digit unique number for each call by a service deployed on multiple servers without database? 如何在Android中创建实例以调用服务类的活动方法? - How to create an instance to call a method of an activity to a service class in Android? 如何将新主机添加到现有的Apache Ignite实例? - How to add a new host to existing Apache Ignite instance? Apache Ignite:如何列出所有表和所有缓存 - Apache Ignite : How to list all tables and all Caches 是否可以以某种方式从部署在BEA AquaLogic Service Bus上的业务服务调用部署在JBoss上的EJB? - Is it possible to call in some way an EJB deployed on JBoss from a Business Service deployed on BEA AquaLogic Service Bus? 如何在整个调用图中找到实例变量对象的所有用法? - How to find all the usages to instance variable object throughout call graph? Apache Ignite:如何从命名缓存中获取所有项目 - Apache Ignite: How to get all items from named cached 如何公开在本地部署的Web服务 - How to expose a web service which is deployed locally
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM