Search code examples
schedulerschedulingjobsignite

Apache Ignite Job Schedular Configuration


i m trying to schedule a job on ignite but i guess i can not set up the configuration file correctly. It is not possible to find any working full example or tutorial. Also there is no file named "ignite-scheduler" @ apache-ignite-fabric-2.2.0-bin\libs\optional

Here is the error message:

[2018-01-24 13:34:33,127][ERROR][pub-#55][GridJobWorker] Failed to execute job [jobId=48dabb72161-e972e997-06fa-492d-97f4-bf1b0d261a66, ses=GridJobSessionImpl [ses=GridTaskSessionImpl [taskName=o.a.i.examples.Driver$1, dep=GridDeployment [ts=1516790072917, depMode=SHARED, clsLdr=sun.misc.Launcher$AppClassLoader@2a139a55, clsLdrId=37dabb72161-e972e997-06fa-492d-97f4-bf1b0d261a66, userVer=0, loc=true, sampleClsName=o.a.i.i.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap, pendingUndeploy=false, undeployed=false, usage=2], taskClsName=o.a.i.examples.Driver$1, sesId=28dabb72161-e972e997-06fa-492d-97f4-bf1b0d261a66, startTime=1516790073047, endTime=9223372036854775807, taskNodeId=e972e997-06fa-492d-97f4-bf1b0d261a66, clsLdr=sun.misc.Launcher$AppClassLoader@2a139a55, closed=false, cpSpi=null, failSpi=null, loadSpi=null, usage=1, fullSup=false, internal=false, subjId=e972e997-06fa-492d-97f4-bf1b0d261a66, mapFut=IgniteFuture [orig=GridFutureAdapter [ignoreInterrupts=false, state=INIT, res=null, hash=1228587967]], execName=null], jobId=48dabb72161-e972e997-06fa-492d-97f4-bf1b0d261a66]]
class org.apache.ignite.IgniteException: Current Ignite configuration does not support schedule functionality (consider adding ignite-schedule module to classpath).
    at org.apache.ignite.internal.processors.closure.GridClosureProcessor$C2.execute(GridClosureProcessor.java:1858)
    at org.apache.ignite.internal.processors.job.GridJobWorker$2.call(GridJobWorker.java:566)
    at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6631)
    at org.apache.ignite.internal.processors.job.GridJobWorker.execute0(GridJobWorker.java:560)
    at org.apache.ignite.internal.processors.job.GridJobWorker.body(GridJobWorker.java:489)
    at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Here is the child conf 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">
    <!-- Imports default Ignite configuration -->
    <import resource="example-default.xml"/>

    <bean parent="ignite.cfg"/>
</beans>

Here is the parent conf xml

<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 abstract="true" id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <!-- Set to true to enable distributed class loading for examples, default is false. -->
        <property name="peerClassLoadingEnabled" value="true"/>

        <!-- Enable task execution events for examples. -->
        <property name="includeEventTypes">
            <list>
                <!--Task execution events-->
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>

                <!--Cache events-->
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/>
                <util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/>
            </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. For information on all options refer
                        to our documentation: http://apacheignite.readme.io/docs/cluster-config
                    -->
                    <!-- 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>10.106.2.30:47500..47509</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Anyone experienced on job scheduling with ignite ?


Solution

  • ignite-schedule is optional LGPL dependency and it's not a part of Apache Ignite binary distribution.

    You can build it by yourself from code.

    Alternatively, you can download it from another source. Here is information about it: https://ignite.apache.org/download.cgi#3rdparty