Using Ignite 2.11 and the following code works.
Server:
public class ComputeServer {
public static void main(String[] args) {
IgniteConfiguration igniteConfiguration = new IgniteConfiguration()
.setPeerClassLoadingEnabled(true);
Ignite ignite = Ignition.start(igniteConfiguration);
}
}
Client:
public class ComputeClient {
public static void main(String[] args) {
IgniteConfiguration igniteConfiguration = new IgniteConfiguration()
.setClientMode(true)
.setPeerClassLoadingEnabled(true);
try (Ignite ignite = Ignition.start(igniteConfiguration)) {
ignite.compute().run(() -> System.out.println("Hello, world"));
}
}
}
(It executes on server nodes by default; you don’t need to create a cluster
group for that.)
So I think you’ll need to share more about your configuration and/or code to
get to the bottom of this.
> On 27 Oct 2021, at 16:47, Surinder Mehra <[email protected]> wrote:
>
> Just wondering if it is possible at all. All examples/demos I have seen are
> either using a thin client or one server node submitting a task to the grid,
> or with affinity to a particular node. I have tried all compute apis, like
> run, call, runAffinity. callaffinity, broadcast. none of them works when
> submitted from client node. They do run if I change clusterGroup to local
> nodes. like ClusterGroup grp = ignite.cluster().forLocalNodes();
>
> On Wed, Oct 27, 2021 at 6:20 PM Surinder Mehra <[email protected]
> <mailto:[email protected]>> wrote:
> yes, it is enabled. Even if that wasn't enabled, I should get class not found
> error. Here i dont get any error but its simply doesn't execute. I see below
> flag needs to be enabled for thin client. Is there any setting for thick
> clients as well ?
>
> https://ignite.apache.org/docs/latest/thin-clients/java-thin-client
> <https://ignite.apache.org/docs/latest/thin-clients/java-thin-client>
>
> <bean class="org.apache.ignite.configuration.IgniteConfiguration"
> id="ignite.cfg">
> <property name="clientConnectorConfiguration">
> <bean
> class="org.apache.ignite.configuration.ClientConnectorConfiguration">
> <property name="thinClientConfiguration">
> <bean
> class="org.apache.ignite.configuration.ThinClientConfiguration">
> <property name="maxActiveComputeTasksPerConnection"
> value="100" />
> </bean>
> </property>
> </bean>
> </property>
> </bean>
>
> On Wed, Oct 27, 2021 at 6:04 PM Stephen Darlington
> <[email protected] <mailto:[email protected]>>
> wrote:
> Did you enable peer class loading?
>
> > On 27 Oct 2021, at 13:18, Surinder Mehra <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> > Hi,
> > I have a sever node and a thick client node running. I am trying to submit
> > ignite compute job from client node to server node but it doesn't work.
> >
> > ClusterGroup grp = ignite.cluster().forServers()
> > IgniteCompute ignieCompute = ignite.compute(grp);
> > igniteCompute.run(() -> System.out.println("Task Executed"));
> >
> > Sysout never printed on console and client keeps running. If I change it to
> > server mode, tasks completed immediately.
> >
> > Can someone help me understand if I am missing some configuration?
> >
>
>