You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Shravya Nethula <sh...@aline-consulting.com> on 2018/06/05 12:35:29 UTC

How to execute an sql on a specific remote server?

Hi,

I am trying to execute the following select query using the native java
client on a cluster of 2 nodes.

String query = "select * from Person";
List<List&lt;?>> results = superCache.query(new
SqlFieldsQuery(query)).getAll();

Now, is any there way to execute the same query on only one specific remote
node?

Can anyone please post some suggestions in this regard?

Regards,
Shravya Nethula.






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to execute an sql on a specific remote server?

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

You can set `local=true` to execute completely local requests, and you can
connect your JDBC to NX with this option.

Regards,
-- 
Ilya Kasnacheev


вс, 8 сент. 2019 г. в 20:44, livelace <o....@livelace.ru>:

> Hi, Andrew. I found this topic in Google.
>
> I have a case where:
>
> 1. I have two nodes (all caches are replicated) N1 and N2, NX is a client
> node .
> 2. N2 fills with small portions of data (relatively frequent).
> 3. N2 has relatively small RAM and CPU.
> 4. N1 has huge volume of RAM and many CPU cores.
> 5. NX has huge volume of RAM and many CPU cores and powerful GPU.
> 6. Network link between N1 and N2 - 1Gbps.
> 7. Network link between N2 and NX - 10Gbps.
>
> hence I need an option to query through a more powerful node (CPU, RAM,
> Network speed) in Replicated mode, not a random option.
>
> Am I able achieve this in 2.7.5 ?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: How to execute an sql on a specific remote server?

Posted by livelace <o....@livelace.ru>.
Hi, Andrew. I found this topic in Google.

I have a case where:

1. I have two nodes (all caches are replicated) N1 and N2, NX is a client
node .
2. N2 fills with small portions of data (relatively frequent).
3. N2 has relatively small RAM and CPU.
4. N1 has huge volume of RAM and many CPU cores.
5. NX has huge volume of RAM and many CPU cores and powerful GPU.
6. Network link between N1 and N2 - 1Gbps.
7. Network link between N2 and NX - 10Gbps.

hence I need an option to query through a more powerful node (CPU, RAM,
Network speed) in Replicated mode, not a random option.

Am I able achieve this in 2.7.5 ?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to execute an sql on a specific remote server?

Posted by Andrey Mashenkov <an...@gmail.com>.
Hi,

What are you trying to achieve?


What is cache mode? For REPLICATED cache, your query will be sent to and
executed on one random node.

1. You can sent a compute job [1] to certain node (via
ignite.compute(ignite.cluster().forNode(...)).execute(task))
or affinity job [2] (ignite.compute().affinityRun())
which will execute local SQL query [3].

See compute docs [1] and SQL local flag docs [2].

2. If cache is PARTITIONED, then you may want to send a query to node with
certain partition.
Then you can try to set partitions explicitly via
SqlFielQuery.setPartitions().


[1]
https://apacheignite.readme.io/docs/distributed-closures#call-and-run-methods
[2]
https://apacheignite.readme.io/docs/collocate-compute-and-data#affinity-call-and-run-methods
[3] https://apacheignite-sql.readme.io/docs/local-queries



On Tue, Jun 5, 2018 at 3:35 PM, Shravya Nethula <
shravya.nethula@aline-consulting.com> wrote:

> Hi,
>
> I am trying to execute the following select query using the native java
> client on a cluster of 2 nodes.
>
> String query = "select * from Person";
> List<List&lt;?>> results = superCache.query(new
> SqlFieldsQuery(query)).getAll();
>
> Now, is any there way to execute the same query on only one specific remote
> node?
>
> Can anyone please post some suggestions in this regard?
>
> Regards,
> Shravya Nethula.
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Andrey V. Mashenkov