apache-spark - Spark 结构化流式点燃连接失败
问题描述
我正在尝试将 ignite 集成到我的 spark 结构化流应用程序中。
以下是我为 ignite
-ignite-core、
-ignite-spark、
-ignite-spring、
-cache-api 包含的依赖项
用于点燃的 Spark 配置
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();
完全不知道如何解决以下错误,因为配置是二进制文件中提供的默认配置。包括所有依赖项。
- 点燃 2.7.6
- 火花 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'.]
默认配置.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>
解决方案
请看看这个线程。看起来那里的人有同样的问题:
我想你应该在你的 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 等。
推荐阅读
- javascript - google Apps 脚本使用 mailApp 发送 htmlbody(正在修改的内容)
- node.js - 我无法删除用户身份验证
- python - 在函数本身中更改函数输入
- javascript - 使用 Basecamp / Trix 编辑器时“未定义新的 Trix”
- c++ - C++, = 运算符不同的选项
- pytorch - Detectron2 在我的 model_final.pth 中添加更多类或微调现有类
- javascript - 从三个句子中间取出单词的最快方法是什么?/ 操作字符串
- python - 尝试使用ride.py 从命令提示符启动 RIDE 时出错
- c++ - 如何使用 Eigen 提高我的性能?(包括示例代码)
- pytorch - 为优化器加载状态字典时的 Pytorch / 设备问题(cpu,gpu)