[英]How to set up hadoop distributed cache using spring data
我是Spring数据的新手,并试图通过分布式缓存来分布所有Spring数据依赖项。 但是它不起作用,也找不到有用的资源。
我在application-context.xml中的配置:-
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/hadoop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:hdp="http://www.springframework.org/schema/hadoop"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd">
<hdp:configuration>
fs.defaultFS=${hdp.fs}
</hdp:configuration>
<hdp:job id="wordcountJob"
input-path="${wc.input.path}"
output-path="${wc.output.path}"
mapper="${wc.mapper}"
reducer="${wc.reducer}"/>
<hdp:cache create-symlink="true">
<hdp:classpath value="/user/hadoop/DistributedCache/spring-data-hadoop-2.3.0.RELEASE.jar" />
</hdp:cache>
<hdp:job-runner id="runner" job-ref="wordcountJob" run-at-startup="true"/>
<context:property-placeholder location="hadoop-configs.properties"/>
</beans:beans>
我正在尝试将spring-data-hadoop jar分发到每个节点。 但是到目前为止,它不起作用。 有办法吗? 任何帮助将不胜感激
您可以在作业配置中添加它。
<hdp:job id="MaxTempJob"
input-path="${input.path}"
output-path="${output.path}"
jar-by-class="com.chanchal.MaxTemperature"
mapper="com.chanchal.MaxTemperatureMapper"
map-key="org.apache.hadoop.io.LongWritable"
map-value="org.apache.hadoop.io.Text"
libs="/lib/spring-data-hadoop-2.3.0.RELEASE.jar"
/>
lib
是项目的位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.