I am trying to create sample which uses client - server model to remotely deploy server component which uses libhdfs.so to perform hdfsConnect call which needs CLASSPATH and LIBHDFS_OPTS to be set to perform the sucessful connection and get hadoop file handle. The call did not return anything it goes into a hung state and also kills the server component which is calling this function from inside.
I tried creating simple executable program in c using C API compiled with all the dependency needed by libhdfs.so it worked as prior to running to program i used to set the CLASSPATH and LIBHDFS_OPTS manually by exporting it.
But the same do not work in client server model which i am trying to remotely invoke the call from client module .
I tried setting the CLASSPATH via bashrc also via sending it though libssh like
export CLASSPATH; export LIBHDFS_OPTS; /servercomponent path <parameters>
still the same issue
the calls hungs when server component is started and remote call receives from client to perform connect. i have also added code like
hdfsFS fs = hdfsConnect("hdfs://<server hostname>", 9000);
if (fs == NULL)
printf("Connection successful");
else
printf("Connection failed");
but when the call reaches to hdfsConnect there is no way return and kill server component as well.
Please help as how to import this classpath sucessfully i also tried printing it and it was complete still the program is not running
is it causing due to remote call to start the server via ssh
I tried following ways to set it
export CLASSPATH=$(/root/hadoop-3.0.0/bin/hadoop classpath --glob)
export CLASSPATH=$CLASSPATH:"$(find /root/hadoop-3.0.0/share/hadoop/common/lib -name '*.jar' | xargs echo | tr ' ' ':')"
export CLASSPATH=${HADOOP_HOME}/etc/hadoop:`find ${HADOOP_HOME}/share/hadoop/ | awk '{path=path":"$0}END{print path}'``
also tried using setenv function to set it
Need to perform operations hdfsConnect | OpenFile |ReadFile
I am currently using libhdfs.so from setup which is prebuild to perform this code and not build the code manually for this test. As libhdfs.so need JNIENV to be set . I don't know how to understand what failure is there in libhdfs.so which is prebuild