Сбой соединения Ignite с потоковой структурой Spark - PullRequest
1 голос
/ 04 октября 2019

Я пытаюсь интегрировать ignite в мое искровое потоковое приложение с поддержкой искр.
Ниже приведены зависимости, которые я включил для ignite
- ignite-core,
- ignite-spark,
- ignite-spring,
- cache-api

Конфигурация Spark для ignite

private static final String CONFIG = "C:\\apache-ignite-2.7.6-bin\\config\\default-config.xml";
spark.read().format(IgniteDataFrameSettings.FORMAT_IGNITE())
.option(IgniteDataFrameSettings.OPTION_CONFIG_FILE(), CONFIG)
.option(IgniteDataFrameSettings.OPTION_TABLE(), "person")
.load();

Абсолютно не знаю, как устранить ошибку, указанную ниже, поскольку конфигурация является конфигурацией по умолчанию, предоставленной в двоичном файле. Все зависимости включены.
- Ignite 2.7.6
- Spark 2.4.0

 ERROR StpMain: Error
class org.apache.ignite.IgniteException: Failed to instantiate Spring XML application context [springUrl=file:/C:/apache-ignite-2.7.6-bin/config/default-config.xml, err=Line 26 in XML document from URL [file:/C:/apache-ignite-2.7.6-bin/config/default-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 72; cvc-elt.1: Cannot find the declaration of element 'beans'.]

default-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<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="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
        <property name="cacheConfiguration">
            <!-- SharedRDD cache example configuration (Atomic mode). -->
            <bean class="org.apache.ignite.configuration.CacheConfiguration">
                <!-- Set a cache name. -->
                <property name="name" value="sharedRDD"/>
                <!-- Set a cache mode. -->
                <property name="cacheMode" value="PARTITIONED"/>
                <!-- Index Integer pairs used in the example. -->
                <property name="indexedTypes">
                    <list>
                        <value>java.lang.Integer</value>
                        <value>java.lang.Integer</value>
                    </list>
                </property>
                <!-- Set atomicity mode. -->
                <property name="atomicityMode" value="ATOMIC"/>
                <!-- Configure a number of backups. -->
                <property name="backups" value="1"/>
            </bean>
        </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>localhost:10800</value>
                            </list>
                        </property>
                    </bean>
                </property>
            </bean>
        </property>
    </bean>
</beans>

Ответы [ 2 ]

1 голос
/ 28 октября 2019

Следует также отметить, что Spark 2.4 пока не поддерживается.

Здесь приведен тикет по Apache Ignite JIRA, вы можете отследить статус здесь https://issues.apache.org/jira/browse/IGNITE-12054

1 голос
/ 08 октября 2019

Пожалуйста, посмотрите на эту тему. Похоже, что у человека была такая же проблема:

Не удается найти объявление элемента 'beans'

Я думаю, что вы должны добавить рядом с вашим 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-**[MAYOR.MINOR]**.xsd"

Где [MAYOR.MINOR] - версия вашей Spring, например 3.1, 4.0 и т. Д.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...