Hello Ilya Yes, it happens all the time. It seems ignite forces the "client" establishing the jdbc connection into a client mode, even if I set client=false. The sample code and config are attached. The question is how do I force JDBC connections from a server node. thanks.
On Fri, Oct 23, 2020 at 10:31 AM Ilya Kasnacheev <[email protected]> wrote: > Hello! > > Does this happen every time? If so, do you have a reproducer for the issue? > > Regards, > -- > Ilya Kasnacheev > > > пт, 23 окт. 2020 г. в 13:06, narges saleh <[email protected]>: > >> Denis -- Just checked. I do specify my services to be deployed on server >> nodes only. Why would ignite think that I am running my code on a client >> node? >> >> On Fri, Oct 23, 2020 at 3:50 AM narges saleh <[email protected]> >> wrote: >> >>> Hi Denis >>> What would make an ignite node a client node? The code is invoked via an >>> ignite service deployed on each node and I am not setting the client mode >>> anywhere. The code sets the jdbc connection to local and tries to execute a >>> sql code on the node in some interval. By the way, I didn't know one could >>> deploy a service on client nodes. Do I need to explicitly mark a node as a >>> server node when deploying a service? >>> thanks >>> >>> On Thu, Oct 22, 2020 at 9:42 PM Denis Magda <[email protected]> wrote: >>> >>>> The error message says you're attempting to run the query on a client >>>> node. If that's the case (if the service is deployed on the client node), >>>> then the local flag has no effect because client nodes don't keep your data >>>> locally but rather consume it from servers. >>>> >>>> - >>>> Denis >>>> >>>> >>>> On Thu, Oct 22, 2020 at 6:26 PM narges saleh <[email protected]> >>>> wrote: >>>> >>>>> Hi All, >>>>> I am trying to execute a sql query via a JDBC connection on the >>>>> service node (the query is run via a service), but I am getting *Execution >>>>> of local SqlFieldsQuery on client node disallowed.* >>>>> *The JDBC connection has the option local=true as I want to run the >>>>> query on the data on the local node only.* >>>>> *Any idea why I am getting this error?* >>>>> >>>>> *thanks.* >>>>> >>>>
JDBCQuery.java
Description: Binary data
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="peerClassLoadingEnabled" value="true"/>
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="PERSON2"/>
<property name="cacheMode" value="PARTITIONED"/>
<property name="atomicityMode" value="ATOMIC"/>
<property name="writeSynchronizationMode" value="FULL_SYNC"/>
<!-- Configure type metadata to enable queries. -->
<property name="queryEntities">
<list>
<bean class="org.apache.ignite.cache.QueryEntity">
<property name="keyType" value="CustomKey"/>
<property name="valueType" value="PERSON2"/>
<property name="tableName" value="PERSON2"/>
<!-- Set fields for value object. -->
<property name="fields">
<map>
<entry key="orgName" value="java.lang.String"/>
<entry key="firstName" value="java.lang.String"/>
<entry key="lastName" value="java.lang.String"/>
<entry key="resume" value="java.lang.String"/>
<entry key="salary" value="java.lang.Integer"/>
</map>
</property>
<property name="keyFields">
<set>
<value>firstName</value>
<value>orgName</value>
</set>
</property>
</bean>
</list>
</property>
</bean>
</list>
</property>
<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<!--
Ignite provides several options for automatic discovery that can be used
instead os static IP based discovery.
-->
<!-- Uncomment static IP finder to enable static-based discovery of initial nodes. -->
<!--<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">-->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<value>127.0.0.1:47550..47551</value>
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
</beans>
