-
Notifications
You must be signed in to change notification settings - Fork 463
spring-yarn examples not finding / using hadoop classpath #21
Comments
Try specifying the following properties in your
You can also include yarn-site.xml and mapred-site.xml on your classpath. Check the clusters yarn-site.xml/mapred-site.xml for the correct paths. AFAIK there is no reliable way for the application to detect these classpaths, so you have to provide them. |
Thanks that fixed the immediate problem. But that uncovered another configuration problem, so I still don't have it working.
The way to do it is start the application with |
I doubt on that. What is the value of "yarn.application.classpath" in your env,does it look like something like below? $HADOOP_CONF_DIR, $HADOOP_COMMON_HOME/*,$HADOOP_COMMON_HOME/lib/*, $HADOOP_HDFS_HOME/*,$HADOOP_HDFS_HOME/lib/*, $HADOOP_MAPRED_HOME/*,$HADOOP_MAPRED_HOME/lib/*, $HADOOP_YARN_HOME/*,$HADOOP_YARN_HOME/lib/* |
Classpath in yarn apps is one complex monster if being honest. Passing it from client would work if environment is exactly same as in the cluster which would be the case if you run the client from one of the cluster nodes. There is no universal way to find out what is the classpath so that you could run client from any location and with any env settings. In our io guides https://spring.io/guides?filter=yarn, we pretty much package all jars in boot executable fat jar which forces classpath to be whatever we have in that executable jar. Of course this will make your 'app' a bigger but it isolates the whole classpath if you want to use something would not work with jars already in hadoops classpath. Guava, protobuf, thrift libs are usually the ones which are really old in hadoop distros and may not work with your versions. If you want to re-use jars from hadoop distro then in reality you always need to hardcode something because distros are different. |
I think I found the reason,you can see the explanation in issue 22[https://github.com//issues/22] |
I'm trying to run the yarn examples. I tried both
simple-command
andbatch-files
on a Hortonworks HDP-2.1 multi-node (non-secured) cluster.The job submits fine, but it fails with:
The only modifications to the
application-context.xml
andappmaster-context.xml
was to edit the paths to where I copied the jars that get built withgradlew
. For example, here is (part of) the simple-master application-context.xml:and the appmaster-context.xml:
I invoked it with:
The apache-commons-logging jar it wants is in
/usr/lib/hadoop/lib
:and that location is in the standard hadoop classpath on the HDP platform:
So why isn't the spring-yarn setup finding the commons-logging jar? I've run other YARN apps (not with spring-yarn) and everything works fine.
The text was updated successfully, but these errors were encountered: