java - ignite filesystem : cluster group is empty -


i'm new apache ignite , i'm trying use filesystem feature.

when using xml config file works fine, when turning conf java obtain error :

 exception in thread "main" class org.apache.ignite.igfs.igfsexception: failed execute operation because there no igfs metadata nodes.     @ org.apache.ignite.internal.processors.igfs.igfsmetamanager.runclienttask(igfsmetamanager.java:254)     @ org.apache.ignite.internal.processors.igfs.igfsimpl.mkdirs(igfsimpl.java:757)     @ org.apache.ignite.internal.processors.igfs.igfsimpl.mkdirs(igfsimpl.java:749)     @ com.test.ignitecacheclass.main(ignitecacheclass.java:171) caused by: class org.apache.ignite.cluster.clustergroupemptyexception: cluster group empty.     @ org.apache.ignite.internal.util.igniteutils$5.apply(igniteutils.java:765)     @ org.apache.ignite.internal.util.igniteutils$5.apply(igniteutils.java:763)     @ org.apache.ignite.internal.util.igniteutils.convertexception(igniteutils.java:903)     @ org.apache.ignite.internal.ignitecomputeimpl.call(ignitecomputeimpl.java:355)     @ org.apache.ignite.internal.processors.igfs.igfsmetamanager.runclienttask(igfsmetamanager.java:251)     ... 3 more caused by: class org.apache.ignite.internal.cluster.clustergroupemptycheckedexception: cluster group empty.     @ org.apache.ignite.internal.util.igniteutils.emptytopologyexception(igniteutils.java:4621)     @ org.apache.ignite.internal.processors.closure.gridclosureprocessor.callasync(gridclosureprocessor.java:584)     @ org.apache.ignite.internal.processors.closure.gridclosureprocessor.callasync(gridclosureprocessor.java:428)     @ org.apache.ignite.internal.ignitecomputeimpl.call(ignitecomputeimpl.java:352)     ... 4 more 

i've found solution while writing, have question. not working because launched client mode (obviously...). xml, without client mode explicitly set, create ignite server node.

so, decided become client of server node don't want set parameters again. isn't there way connect providing meta , data cache name filesystem name example? find dirty if store (and if works...) conf binary objects ?

i'll glad if advice me on topic :)

best regards

good evening , thank quick reply.

as said, found mistake in configuration (i think). put same boh configurations if needed. starting node client seems ran server first.

do know why need provide again config when connecting client? there way don't put entire conf when connecting client?

xml config

<?xml version="1.0" encoding="utf-8"?>  <!--   licensed apache software foundation (asf) under 1 or more   contributor license agreements.  see notice file distributed   work additional information regarding copyright ownership.   asf licenses file under apache license, version 2.0   (the "license"); may not use file except in compliance   license.  may obtain copy of license @         http://www.apache.org/licenses/license-2.0    unless required applicable law or agreed in writing, software   distributed under license distributed on "as is" basis,   without warranties or conditions of kind, either express or implied.   see license specific language governing permissions ,   limitations under license. -->  <!--     ignite spring configuration file startup ignite cache.      when starting standalone node, need execute following command:     {ignite_home}/bin/ignite.{bat|sh} examples/config/filesystem/example-igfs.xml      when starting ignite java ide, pass path file ignition:     ignition.start("examples/config/filesystem/example-igfs.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">      <!--         optional description.     -->     <description>         spring file ignite configuration client available endpoints.     </description>      <!--         initialize property configurer can reference environment variables.     -->     <bean id="propertyconfigurer" class="org.springframework.beans.factory.config.propertyplaceholderconfigurer">         <property name="systempropertiesmodename" value="system_properties_mode_fallback"/>         <property name="searchsystemenvironment" value="true"/>     </bean>      <!--         configuration below demonstrates how setup ignitefs node file data.     -->     <bean id="ignite.cfg" class="org.apache.ignite.configuration.igniteconfiguration">           <property name="filesystemconfiguration">             <list>                 <bean class="org.apache.ignite.configuration.filesystemconfiguration">                     <property name="name" value="igfs"/>                     <property name="metacachename" value="igfs-meta"/>                     <property name="datacachename" value="igfs-data"/>                      <!-- must correlate cache affinity mapper. -->                     <property name="blocksize" value="#{128 * 1024}"/>                     <property name="pernodebatchsize" value="512"/>                     <property name="pernodeparallelbatchcount" value="16"/>                      <!-- set number of prefetch blocks. -->                     <property name="prefetchblocks" value="32"/>                      <!--                         example of configured ipc loopback endpoint.                     -->                     <!--                     <property name="ipcendpointconfiguration">                         <bean class="org.apache.ignite.igfs.igfsipcendpointconfiguration">                             <property name="type" value="tcp" />                         </bean>                     </property>                     -->                      <!--                         example of configured shared memory endpoint.                     -->                     <!--                     <property name="ipcendpointconfiguration">                         <bean class="org.apache.ignite.igfs.igfsipcendpointconfiguration">                             <property name="type" value="shmem" />                         </bean>                     </property>                     -->                 </bean>             </list>         </property>          <property name="cacheconfiguration">             <list>                 <bean class="org.apache.ignite.configuration.cacheconfiguration">                     <property name="name" value="igfs-data"/>                     <property name="cachemode" value="partitioned"/>                     <property name="atomicitymode" value="transactional"/>                     <property name="writesynchronizationmode" value="full_sync"/>                     <property name="backups" value="0"/>                     <property name="affinitymapper">                         <bean class="org.apache.ignite.igfs.igfsgroupdatablockskeymapper">                             <!-- haw many blocks in row stored on same node. -->                             <constructor-arg value="512"/>                         </bean>                     </property>                 </bean>                  <bean class="org.apache.ignite.configuration.cacheconfiguration">                     <property name="name" value="igfs-meta"/>                     <property name="cachemode" value="replicated"/>                     <property name="atomicitymode" value="transactional"/>                     <property name="writesynchronizationmode" value="full_sync"/>                 </bean>             </list>         </property>          <!-- explicitly configure tcp discovery spi provide list of initial nodes. -->         <property name="discoveryspi">             <bean class="org.apache.ignite.spi.discovery.tcp.tcpdiscoveryspi">                 <property name="ipfinder">                     <!--                         ignition provides several options automatic discovery can used                         instead os static ip based discovery. information on options refer                         our documentation: http://apacheignite.readme.io/docs/cluster-config                     -->                     <!-- uncomment static ip finder 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 actual host ip address. -->                                 <value>127.0.0.1:47500..47509</value>                             </list>                         </property>                     </bean>                 </property>             </bean>         </property>     </bean> </beans> 

java config

igniteconfiguration config = new igniteconfiguration();  filesystemconfiguration fsconfig = new filesystemconfiguration(); fsconfig.setname("igfs"); fsconfig.setmetacachename("igfs-meta"); fsconfig.setdatacachename("igfs-data"); fsconfig.setblocksize(128 * 1024); fsconfig.setpernodebatchsize(512); fsconfig.setpernodeparallelbatchcount(16); fsconfig.setprefetchblocks(32);  cacheconfiguration fsdatacache = new cacheconfiguration(); fsdatacache.setname("igfs-data"); fsdatacache.setatomicitymode(cacheatomicitymode.transactional); fsdatacache.setwritesynchronizationmode(cachewritesynchronizationmode.full_sync); fsdatacache.setbackups(0); fsdatacache.setaffinitymapper(new igfsgroupdatablockskeymapper(512));  cacheconfiguration fsmetadatacache = new cacheconfiguration(); fsmetadatacache.setcachemode(cachemode.replicated); fsmetadatacache.setname("igfs-meta"); fsmetadatacache.setatomicitymode(cacheatomicitymode.transactional); fsmetadatacache.setwritesynchronizationmode(cachewritesynchronizationmode.full_sync);  config = new igniteconfiguration(); config.setclientmode(true);  config.setworkdirectory("c:/temp/ignite/instance"); config.setfilesystemconfiguration(fsconfig);     config.setcacheconfiguration(fsdatacache, fsmetadatacache);  tcpdiscoveryspi discoveryspi=new tcpdiscoveryspi(); discoveryspi.setlocalport(47506); discoveryspi.setlocalportrange(20); tcpdiscoveryvmipfinder ipfinder=new tcpdiscoveryvmipfinder(); ipfinder.setaddresses(arrays.aslist("127.0.0.1:47500..47509")); discoveryspi.setipfinder(ipfinder);  config.setdiscoveryspi(discoveryspi);  ignite ignite = ignition.start(config); 

thank again


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -