Open pooleja opened 10 years ago
How are you building and running the example? The batch file that is generated is built via Maven Appassembler plug-in. They don't seem to work right if you have a deep directory structure - got some error about command being too long.
Also see some other error - Could not resolve placeholder 'app.home' - so not sure how well these generated batch files actually work. Not sure if anyone has run these examples successfully on Widows.
Is your Hadoop cluster on Windows as well?
I just updated the samples to use $basedir instead of $app.home since the generated batch file for Windows doesn't set the app.home system property. Ran the wordcount sample successfully on Windows.
I had edited the batch file so the class path was defined as:
set CLASSPATH="%BASEDIR%"\etc;"%REPO%"\*
This allowed all the files to be on the class path without making the command too long.
I found related open bugs: https://issues.apache.org/jira/browse/YARN-1298 https://issues.apache.org/jira/browse/MAPREDUCE-4052
My hadoop cluster is a Linux based one. I am trying to go from a Windows client to a Linux cluster.
Nice find on that bug. My test ran fine since I was running against a Windows based Hadoop cluster, haven't tried going from Windows client to Linux cluster.
Hi I have installed hadoop 2.7.4 on windows 7. I tried to run the spring hadoop map reduce wordcount program but could not run on windows as sh ./target/appassembler/bin/wordcount cannot be run on windows.
When I tried to run the wordcount class as a standalone class I get the following exception:
log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'wordcountJob' defined in null: Could not resolve placeholder 'app.repo' in string value "file:${app.repo}/hadoop-examples-*.jar"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'app.repo' in string value "file:${app.repo}/hadoop-examples-*.jar" at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:180) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:155) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:162) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158) at org.springframework.samples.hadoop.mapreduce.Wordcount.main(Wordcount.java:28) Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'app.repo' in string value "file:${app.repo}/hadoop-examples-*.jar" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:204) at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:178) at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$2.resolveStringValue(PropertySourcesPlaceholderConfigurer.java:175) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:282) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:209) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitList(BeanDefinitionVisitor.java:228) at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:192) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:141) at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:82) at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:208) ... 10 more
How can i run this program?
Please advise
Figured this out by providing the complete path
Does Spring Hadoop support running from a Windows client? I assume it does, since I see windows specific batch files to execute in the map reduce example.
When I build and run on a Windows client, connecting to my cluster, it fails. First it says it can't load native libs and then it submits the job but fails after that.