Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

SparkR on Zeppelin is giving an error

Highlighted

SparkR on Zeppelin is giving an error

I have installed R on each of the 3 nodes of HDP 2.6 cluster. I can run R script on sparkR command prompt on the server. In Zeppelin, I get following error with

Zeppelin interpreter config parameter "zeppelin.R.knitr" to true:

Error in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/lib64/R/library/stringi/libs/stringi.so': /usr/lib64/R/library/stringi/libs/stringi.so: invalid ELF header

Here is the sample SparkR code I execute on Zeppelin

%spark2.r

foo <- TRUE 
print(foo) 
bare <- c(1, 2.5, 4) 
print(bare) 
double <- 15.0 
print(double)

I have RHEL OS and running a 3 node HDP 2.6 cluster. R installation "yum install R" did n't install optional packages such as knitr etc. So I tried to install optional packages at server R command line following script:

> install.packages('knitr', repos = 'http://cran.us.r-project.org')
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://cran.us.r-project.org/src/contrib:
  cannot open URL 'http://cran.us.r-project.org/src/contrib/PACKAGES'
Warning message:
package ‘knitr’ is not available (for R version 3.4.2)
> Sys.getenv("http_proxy")
[1] "http://proxy.xxx.com:80"


got error even with proxy setting. So I went and downloaded binary from http://archive.linux.duke.edu/cran/ (

OS X El Capitan binaries:r-release: stringi_1.1.6.tgz

), and manually copied to "/usr/lib64/R/library". After that Zeppelin spark2.r code error prompted me to repeat the process for other packages in stringr, and stringi. After adding stringi I get error, that I 'm not sure how to solve it.

I can set Zeppelin interpreter config parameter "zeppelin.R.knitr" to false, and Zeppelin works, but it has limited display with this setting false. How do I fix this problem?

Don't have an account?
Coming from Hortonworks? Activate your account here