% spark2.r в песочнице hdp / zeppelin не работает - PullRequest
0 голосов
/ 08 ноября 2018

Мы запускаем zeppelin в hdp-песочнице, управляемой с помощью ambari, pyspark, sql и scala работает, но% spark2.r - нет.Есть идеи, пожалуйста?- Клянусь, я смотрел везде.

Я попытался проверить SPARK_HOME = / usr / hdp / current / spark2-client / но idk, если это правильная папка - как я могу проверить?Я установил Rstudio в песочнице, и он работает нормально, и когда я пытаюсь запустить код R в оболочке в коробке, он также работает.Я уверен, что R установлен.

%spark2.r
foo <- TRUE
print(foo)
bare <- c(1, 2.5, 4)
print(bare)
double <- 15.0
print(double)

org.apache.zeppelin.interpreter.InterpreterException: sparkr is not responding 
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-redhat-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
> #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # 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])
> rm(args)
> 
> print(paste("Port ", toString(port)))
[1] "Port  42159"
> print(paste("LibPath ", libPath))
[1] "LibPath  /usr/hdp/current/spark2-client//R/lib"
> 
> .libPaths(c(file.path(libPath), .libPaths()))
> library(SparkR)
Attaching package: ‘SparkR’
The following objects are masked from ‘package:stats’:
    cov, filter, lag, na.omit, predict, sd, var, window
The following objects are masked from ‘package:base’:
    as.data.frame, colnames, colnames<-, drop, endsWith, intersect,
    rank, rbind, sample, startsWith, subset, summary, transform, union
> 
> 
> SparkR:::connectBackend("localhost", port, 6000)
A connection with                               
description "->localhost:42159"
class       "sockconn"         
mode        "wb"               
text        "binary"           
opened      "opened"           
can read    "yes"              
can write   "yes"              
> 
> # scStartTime is needed by R/pkg/R/sparkR.R
> assign(".scStartTime", as.integer(Sys.time()), envir = SparkR:::.sparkREnv)
> 
> # getZeppelinR
> .zeppelinR = SparkR:::callJStatic("org.apache.zeppelin.spark.ZeppelinR", "getZeppelinR", hashCode)
    at org.apache.zeppelin.spark.ZeppelinR.waitForRScriptInitialized(ZeppelinR.java:285)
    at org.apache.zeppelin.spark.ZeppelinR.request(ZeppelinR.java:227)
    at org.apache.zeppelin.spark.ZeppelinR.eval(ZeppelinR.java:176)
    at org.apache.zeppelin.spark.ZeppelinR.open(ZeppelinR.java:165)
    at org.apache.zeppelin.spark.SparkRInterpreter.open(SparkRInterpreter.java:90)
    at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:69)
    at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:493)
    at org.apache.zeppelin.scheduler.Job.run(Job.java:175)
    at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748) 

1 Ответ

0 голосов
/ 12 ноября 2018

спасибо karma4917 за указание на правильное направление - https://zeppelin.apache.org/docs/0.6.0/interpreter/r.html#overview

по этой ссылке stepbystep решил ошибку

...