Support Questions
Find answers, ask questions, and share your expertise

Not able to run R script in zeppeling

Not able to run R script in zeppeling


Dear HDP community,

I am trying to setup R interpreter. R is installed and running on host (means I can run R script in ssh session through command line) and Spark is installed through HDP/ambari platform.

This is my notebook:


1 + 1

which fails like below:

org.apache.zeppelin.interpreter.InterpreterException: sparkr is not responding 
R version 3.6.0 (2019-04-26) -- "Planting of a Tree"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> #
> # Licensed to the Apache Software Foundation (ASF) under one
> # or more contributor license agreements.  See the NOTICE file
> # distributed with this work for additional information
> # regarding copyright ownership.  The ASF licenses this file
> # to you under the Apache License, Version 2.0 (the
> # "License"); you may not use this file except in compliance
> # with the License.  You may obtain a copy of the License at
> #
> #
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> #
> args <- commandArgs(trailingOnly = TRUE)
> hashCode <- as.integer(args[1])
> port <- as.integer(args[2])
> libPath <- args[3]
> version <- as.integer(args[4])
> timeout <- as.integer(args[5])
> authSecret <- NULL
> if (length(args) >= 6) {
+   authSecret <- args[6]
+ }
> rm(args)
> print(paste("Port ", toString(port)))
[1] "Port  42291"
> print(paste("LibPath ", libPath))
[1] "LibPath  /usr/hdp/"
> .libPaths(c(file.path(libPath), .libPaths()))
> library(SparkR)

Attaching package: ‘SparkR’

The following objects are masked from ‘package:stats’:

    cov, fi> lter, lag, na.omit, predict, sd, var, window

The following objects are masked from ‘package:base’:

i    as.f (is.null(authSecret)) {dat
a+. frame, colnames, colname  SparkR:::connectBackend("localhost",s <p-o,r drop, endsWith, interste,ct, ti
 +r } else {
+   SparkR:::connectBackend("localhost", port, timeout, authSecret)a
+ }
nk, rbind, sample, startsWith, subset, summary, transform, union

    at org.apache.zeppelin.spark.ZeppelinR.waitForRScriptInitialized(
    at org.apache.zeppelin.spark.ZeppelinR.request(
    at org.apache.zeppelin.spark.ZeppelinR.eval(
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(
    at org.apache.zeppelin.scheduler.FIFOScheduler$
    at java.util.concurrent.Executors$
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(
    at java.util.concurrent.ScheduledThreadPoolExecutor$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

Any thoughts?

thank you very much


Re: Not able to run R script in zeppeling


@Manuel Sopena Ballesteros

Can you share your Zeppelin R configuration steps? To run Zeppelin with the R Interpreter, the SPARK_HOME environment variable must be set.

The best way to do this is by editing conf/ If it is not set, the R Interpreter will not be able to interface with Spark.


Re: Not able to run R script in zeppeling


I installed R from sources and copied to /usr/bin

then I went to ambari and setup the zeppeling configuration below:

      export JAVA_HOME={{java64_home}}       export MASTER=yarn-client       export ZEPPELIN_LOG_DIR={{zeppelin_log_dir}}       export ZEPPELIN_PID_DIR={{zeppelin_pid_dir}}       export ZEPPELIN_INTP_CLASSPATH_OVERRIDES="{{external_dependency_conf}}"       export KINIT_FAIL_THRESHOLD=5       export KERBEROS_REFRESH_INTERVAL=1d       export HADOOP_CONF_DIR=/etc/hadoop/conf 
export SPARK_HOME=/usr/hdp/

Hope this helps, please let me know otherwise

Re: Not able to run R script in zeppeling


Are you still having the issue? If so, can you share your spark interpreter config?