How to execute an sql on a specific remote server?

classic Classic list List threaded Threaded
4 messages Options
Shravya Nethula Shravya Nethula
Reply | Threaded
Open this post in threaded view
|

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/
Andrew Mashenkov Andrew Mashenkov
Reply | Threaded
Open this post in threaded view
|

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

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().





On Tue, Jun 5, 2018 at 3:35 PM, Shravya Nethula <[hidden email]> 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
Regards,
Andrew.
livelace livelace
Reply | Threaded
Open this post in threaded view
|

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

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/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

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

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 <[hidden email]>:
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/