Failed to find affinity server node

classic Classic list List threaded Threaded
2 messages Options
mehdi sey mehdi sey
Reply | Threaded
Open this post in threaded view
|

Failed to find affinity server node

hi. i have 3 servernode and on clientnode. i want to only put data via client
node and put them on servernode cache. i started 3 server node with bellow
command :
/usr/local/apache-ignite-fabric-2.6.0-bin/bin/ignite.sh  
i have choosen example-cache.xml for input of above command with attached
file as name example-cache.xml.
my program code just as below:

public class CacheCreateClient {
    /** Cache name. */
    private static final String EMP_CACHE_NAME = "Employee_Cache";

    public static void main(String[] args) {
        System.out.println(">>> Please make sure server node is started
using class  " +
                "com.igniteexamples.createcache.StartServerNode before
starting this..");
        //Setting this Instance as Client node and then starting it..
        Ignition.setClientMode(true);
        //try(Ignite ignite = Ignition.start("example-ignite-config.xml")) {
        try(Ignite ignite =
Ignition.start("/usr/local/apache-ignite-fabric-2.6.0-bin/examples/config/example-cache.xml"))
{
            System.out.println();
            System.out.println(">>> CacheCreateClient example started.");
            System.out.println(">>> Is Client node : " +
Ignition.isClientMode());
            System.out.println(">>> Number of nodes in cluster : " +
ignite.cluster().nodes().size());


            //Below line will create Employee Cache with default
configuration
            IgniteCache<Long, Employee> employeeCache =
ignite.createCache(EMP_CACHE_NAME);
            System.out.println(">>> Cache created with name : " +
ignite.cache(EMP_CACHE_NAME).getName());


            System.out.println(">>> Inserting record in the cache..");
            Employee employee = new Employee();
            employee.setName("Simbaa");
            employee.setProjectId(123);
            employee.setAddress("Planet Earth");
            employee.setSalary(100000);

            employeeCache.put(1001L, employee);

            System.out.println(">>> Inserting record in the cache..");
            Employee employee2 = new Employee();
            employee.setName("mehdi");
            employee.setProjectId(125);
            employee.setAddress("yasouj");
            employee.setSalary(100001);

            employeeCache.put(1002L, employee2);


            System.out.println(">>> Number of records in the cache : " +
employeeCache.size());

            //Number of records on this client node should be zero, as
Caches are always deployed on Server Node.
            System.out.println(">>> Number of records on the local client
node : " + employeeCache.localSize());

            //Stop both Server and client node in this example.
            // close ignite instance
            Scanner readUserInput=new Scanner(System.in);
            String myName=readUserInput.nextLine();
            ignite.cluster().stopNodes();
            System.out.println("Finished!");


        }

    }
}

 after executing above code in my intellij ide i have encounter with below
error:

/usr/lib/jvm/java-8-oracle/bin/java
-javaagent:/snap/intellij-idea-community/143/lib/idea_rt.jar=38523:/snap/intellij-idea-community/143/bin
-Dfile.encoding=UTF-8 -classpath
/usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/deploy.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-oracle/jre/lib/javaws.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfxswt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar:/usr/lib/jvm/java-8-oracle/jre/lib/plugin.jar:/usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/home/mehdi/apache-ignite-2.6.0-src/ignite-createcache-examples/out/production/ignite-createcache-examples:/home/mehdi/.m2/repository/org/apache/ignite/ignite-core/2.6.0/ignite-core-2.6.0.jar:/home/mehdi/.m2/repository/javax/cache/cache-api/1.0.0/cache-api-1.0.0.jar:/home/mehdi/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/home/mehdi/.m2/repository/org/gridgain/ignite-shmem/1.0.0/ignite-shmem-1.0.0.jar:/home/mehdi/.m2/repository/org/apache/ignite/ignite-spring/2.6.0/ignite-spring-2.6.0.jar:/home/mehdi/.m2/repository/org/apache/ignite/ignite-indexing/2.6.0/ignite-indexing-2.6.0.jar:/home/mehdi/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/home/mehdi/.m2/repository/org/apache/lucene/lucene-core/5.5.2/lucene-core-5.5.2.jar:/home/mehdi/.m2/repository/org/apache/lucene/lucene-analyzers-common/5.5.2/lucene-analyzers-common-5.5.2.jar:/home/mehdi/.m2/repository/org/apache/lucene/lucene-queryparser/5.5.2/lucene-queryparser-5.5.2.jar:/home/mehdi/.m2/repository/org/apache/lucene/lucene-queries/5.5.2/lucene-queries-5.5.2.jar:/home/mehdi/.m2/repository/org/apache/lucene/lucene-sandbox/5.5.2/lucene-sandbox-5.5.2.jar:/home/mehdi/.m2/repository/com/h2database/h2/1.4.195/h2-1.4.195.jar:/home/mehdi/.m2/repository/org/springframework/spring-core/4.3.16.RELEASE/spring-core-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/org/springframework/spring-aop/4.3.16.RELEASE/spring-aop-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/org/springframework/spring-beans/4.3.16.RELEASE/spring-beans-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/org/springframework/spring-context/4.3.16.RELEASE/spring-context-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/org/springframework/spring-expression/4.3.16.RELEASE/spring-expression-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/org/springframework/spring-tx/4.3.16.RELEASE/spring-tx-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/org/springframework/spring-jdbc/4.3.16.RELEASE/spring-jdbc-4.3.16.RELEASE.jar:/home/mehdi/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
com.igniteexamples.createcache.CacheCreateClient
>>> Please make sure server node is started using class
>>> com.igniteexamples.createcache.StartServerNode before starting this..
[14:32:49]    __________  ________________
[14:32:49]   /  _/ ___/ |/ /  _/_  __/ __/
[14:32:49]  _/ // (7 7    // /  / / / _/  
[14:32:49] /___/\___/_/|_/___/ /_/ /___/  
[14:32:49]
[14:32:49] ver. 2.6.0#19700101-sha1:DEV
[14:32:49] 2018 Copyright(C) Apache Software Foundation
[14:32:49]
[14:32:49] Ignite documentation: http://ignite.apache.org
[14:32:49]
[14:32:49] Quiet mode.
[14:32:49]   ^-- Logging to file
'/home/mehdi/apache-ignite-2.6.0-src/work/log/ignite-cbaafcfa.0.log'
[14:32:49]   ^-- Logging by 'JavaLogger [quiet=true, config=null]'
[14:32:49]   ^-- To see **FULL** console log here add -DIGNITE_QUIET=false
or "-v" to ignite.{sh|bat}
[14:32:49]
[14:32:49] OS: Linux 4.15.0-46-generic amd64
[14:32:49] VM information: Java(TM) SE Runtime Environment 1.8.0_201-b09
Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.201-b09
[14:32:49] Initial heap size is 126MB (should be no less than 512MB, use
-Xms512m -Xmx512m).
[14:32:49] Configured plugins:
[14:32:49]   ^-- None
[14:32:49]
[14:32:49] Configured failure handler: [hnd=StopNodeOrHaltFailureHandler
[tryStop=false, timeout=0]]
[14:32:50] Message queue limit is set to 0 which may lead to potential OOMEs
when running cache operations in FULL_ASYNC or PRIMARY_SYNC modes due to
message queues growth on sender and receiver sides.
[14:32:50] Security status [authentication=off, tls/ssl=off]
[14:32:50] REST protocols do not start on client node. To start the
protocols on client node set '-DIGNITE_REST_START_ON_CLIENT=true' system
property.
[14:32:52] Performance suggestions for grid  (fix if possible)
[14:32:52] To disable, set -DIGNITE_PERFORMANCE_SUGGESTIONS_DISABLED=true
[14:32:52]   ^-- Enable G1 Garbage Collector (add '-XX:+UseG1GC' to JVM
options)
[14:32:52]   ^-- Specify JVM heap max size (add '-Xmx<size>[g|G|m|M|k|K]' to
JVM options)
[14:32:52]   ^-- Set max direct memory size if getting 'OOME: Direct buffer
memory' (add '-XX:MaxDirectMemorySize=<size>[g|G|m|M|k|K]' to JVM options)
[14:32:52]   ^-- Disable processing of calls to System.gc() (add
'-XX:+DisableExplicitGC' to JVM options)
[14:32:52]   ^-- Decrease number of backups (set 'backups' to 0)
[14:32:52] Refer to this page for more performance suggestions:
https://apacheignite.readme.io/docs/jvm-and-system-tuning
[14:32:52]
[14:32:52] To start Console Management & Monitoring run
ignitevisorcmd.{sh|bat}
[14:32:52]
[14:32:52] Ignite node started OK (id=cbaafcfa)
[14:32:52] Topology snapshot [ver=63, servers=0, clients=1, CPUs=8,
offheap=0.1GB, heap=1.7GB]
[14:32:52]   ^-- Node [id=CBAAFCFA-6B06-4ABA-83AC-176497BB428E,
clusterState=ACTIVE]

>>> CacheCreateClient example started.
>>> Is Client node : true
>>> Number of nodes in cluster : 1
[14:32:52,957][SEVERE][tcp-client-disco-msg-worker-#4][ClusterCachesInfo]
*Failed to find affinity server node with data storage configuration for
starting cache [cacheName=Employee_Cache, aliveSrvNodes=[]]*
[14:32:52] No server nodes found for cache client: Employee_Cache
>>> Cache created with name : Employee_Cache
>>> Inserting record in the cache..

 please give me an description why the problem occure?

example-cache.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t2160/example-cache.xml>  









--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akurbanov akurbanov
Reply | Threaded
Open this post in threaded view
|

Re: Failed to find affinity server node

Hi,

[14:32:52] Topology snapshot [ver=63, servers=0, clients=1, CPUs=8,
offheap=0.1GB, heap=1.7GB]

Your topology doesn't have any server nodes. Can you please check all the
configuration files used in your sample, are there any differences in
discoverySpi section?



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