ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From warorc <war...@ngs.ru>
Subject Simple connect to gridgain via java for taken data
Date Tue, 06 Sep 2016 09:06:52 GMT
Hello, everyone.

I need simple task. Somewhere our developers which use gridgain.

I try to test that data correct inserted to this gridgain stacks. So I just
want to connect to this node, which I don't know anything and get data from
that.

I tried to do it by jdbc:driver, but seen that such method is deprecated in
version 1.7.0, so I started doing it as written in docs via spring and xml
file. But now I can't connected to gridgains nodes with strange error.  I
lost 2 days and can't resove this problem.

My xml:
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="visor"
class="org.apache.ignite.plugin.security.SecurityCredentials">
        <constructor-arg value="visor"/>
        <constructor-arg value="q12345678"/>
    </bean>
    
    <bean id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
        
        <property name="clientMode" value="true"/>

        <property name="peerClassLoadingEnabled" value="true"/>

        
        <property name="discoverySpi">
            <bean
class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                <property name="ipFinder">
                    <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                        <property name="addresses">
                            <list>
                                                              
<value>10.116.146.201</value>
                                                              
<value>10.116.146.202</value>
                            </list>                                                
    
                               </property>
                    </bean>
                               </property>  
                    </bean>
        </property>
        <property name="pluginConfigurations">
            <list>
                <bean
class="org.gridgain.grid.configuration.GridGainConfiguration">
                    <property value="true" name="rollingUpdatesEnabled"/>
                    <property name="securityCredentialsProvider">
                        <bean
class="org.apache.ignite.plugin.security.SecurityCredentialsBasicProvider">
                            <constructor-arg ref="visor"/>
                        </bean>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
</beans>

Exception:

SEVERE: Failed to start manager: GridManagerAdapter [enabled=true,
name=o.a.i.i.managers.discovery.GridDiscoveryManager]
class org.apache.ignite.IgniteCheckedException: Remote node has cache
affinity assignment mode different from local [locId8=3c48b04b,
locDelayAssign=true, rmtId8=4d888c0f, rmtLateAssign=false,
rmtAddrs=[os-sbt-oaabs-006.ca.sbrf.ru/10.116.144.202, /127.0.0.1]]
                at
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.checkAttributes(GridDiscoveryManager.java:1124)
                at
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:701)
                at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1571)
                at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:901)
                at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1739)
                at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)
                at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
                at
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:569)
                at
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:516)
                at org.apache.ignite.Ignition.start(Ignition.java:322)
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.getIgnite(JdbcConnection.java:190)
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.<init>(JdbcConnection.java:151)
                at
org.apache.ignite.IgniteJdbcDriver.connect(IgniteJdbcDriver.java:361)
                at
java.sql.DriverManager.getConnection(DriverManager.java:664)
                at
java.sql.DriverManager.getConnection(DriverManager.java:270)
                at ru.sbt.qa.pu.Main.main(Main.java:39)

сен 06, 2016 3:07:55 PM org.apache.ignite.logger.java.JavaLogger error
SEVERE: Got exception while starting (will rollback startup routine).
class org.apache.ignite.IgniteCheckedException: Failed to start manager:
GridManagerAdapter [enabled=true,
name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
                at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1576)
                at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:901)
                at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1739)
                at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)
                at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
                at
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:569)
                at
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:516)
                at org.apache.ignite.Ignition.start(Ignition.java:322)
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.getIgnite(JdbcConnection.java:190)
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.<init>(JdbcConnection.java:151)
                at
org.apache.ignite.IgniteJdbcDriver.connect(IgniteJdbcDriver.java:361)
                at
java.sql.DriverManager.getConnection(DriverManager.java:664)
                at
java.sql.DriverManager.getConnection(DriverManager.java:270)
                at ru.sbt.qa.pu.Main.main(Main.java:39)
Caused by: class org.apache.ignite.IgniteCheckedException: Remote node has
cache affinity assignment mode different from local [locId8=3c48b04b,
locDelayAssign=true, rmtId8=4d888c0f, rmtLateAssign=false,
rmtAddrs=[os-sbt-oaabs-006.ca.sbrf.ru/10.116.144.202, /127.0.0.1]]
                at
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.checkAttributes(GridDiscoveryManager.java:1124)
                at
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:701)
                at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1571)
                ... 13 more

[15:07:56] Ignite node stopped OK
[name=ignite-jdbc-driver-35559313-f8a2-4a36-b914-194022fcf9b1,
uptime=00:00:06:227]
Exception in thread "main" java.sql.SQLException: Failed to start Ignite
node.
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.<init>(JdbcConnection.java:162)
                at
org.apache.ignite.IgniteJdbcDriver.connect(IgniteJdbcDriver.java:361)
                at
java.sql.DriverManager.getConnection(DriverManager.java:664)
                at
java.sql.DriverManager.getConnection(DriverManager.java:270)
                at ru.sbt.qa.pu.Main.main(Main.java:39)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start
manager: GridManagerAdapter [enabled=true,
name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
                at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1576)
                at
org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:901)
                at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1739)
                at
org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1589)
                at
org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1042)
                at
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:569)
                at
org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:516)
                at org.apache.ignite.Ignition.start(Ignition.java:322)
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.getIgnite(JdbcConnection.java:190)
                at
org.apache.ignite.internal.jdbc2.JdbcConnection.<init>(JdbcConnection.java:151)
                ... 4 more
Caused by: class org.apache.ignite.IgniteCheckedException: Remote node has
cache affinity assignment mode different from local [locId8=3c48b04b,
locDelayAssign=true, rmtId8=4d888c0f, rmtLateAssign=false,
rmtAddrs=[os-sbt-oaabs-006.ca.sbrf.ru/10.116.144.202, /127.0.0.1]]
                at
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.checkAttributes(GridDiscoveryManager.java:1124)
                at
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:701)
                at
org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1571)
                ... 13 more

How I can in simple way via java just connect to caches and get information
from them?




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Simple-connect-to-gridgain-via-java-for-taken-data-tp7539.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message