使用sparklyr连接到纱线管理的火花集群后,本地计算机上的破坏性Java进程

时间:2018-07-20 21:45:03

标签: apache-spark yarn sparklyr

我正在使用sparklyr连接到不在服务器上的纱线管理的火花集群。我在本地安装了spark,它作为来回簇的客户端。

问题:我看到一些Java进程挂在本地服务器上(尤其是当我杀死Spark应用程序时),并且我必须从命令行手动杀死它们,否则它们会破坏将来的Spark上下文创建。如果我有一段时间没有杀死它们,那么我最终将耗尽本地服务器上的内存。

问题:为什么这些Java进程徘徊?我究竟做错了什么?如何设置配置以避免它们?

我正在使用以下方法创建我的Spark上下文:

Sys.setenv(JAVA_HOME = '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.141-2.b16.el7_4.x86_64/jre')
Sys.setenv(SPARK_HOME = '/var/lib/Spark')
Sys.setenv(HADOOP_CONF_DIR = '/usr/local/hadoop-2.8.3/etc/hadoop')
conf <- spark_config()
# conf$spark.executor.memory <- "3000M"
conf$spark.dynamicAllocation.enabled <- "false"
conf$spark.executor.cores <- 4
conf$spark.executor.instances <- 8
conf$spark.hadoop.yarn.resourcemanager.hostname <- master
conf$spark.hadoop.yarn.resourcemanager.address <- master:8032
conf$spark.yarn.access.namenodes <- paste0("hdfs://", master, ":8020,hdfs://", master, ":8020")
conf$spark.yarn.stagingDir <- paste0("hdfs://", master, ":8020/user/dzafar")
sc <- spark_connect(master = "yarn-client", config = conf)

发生这种情况时,我会收到的常见错误消息之一是:

Error: java.lang.IllegalArgumentException: Error while instantiating 'org.apache.spark.sql.hive.HiveSessionStateBuilder':
  at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$instantiateSessionState(SparkSession.scala:1062)
...
Caused by: org.apache.spark.sql.AnalysisException: java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient;
...
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
...
Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
...
Caused by: java.lang.reflect.InvocationTargetException
...
Caused by: javax.jdo.JDOFatalDataStoreException: Unable to open a test connection to the given database. JDBC url = jdbc:derby:;databaseName=metastore_db;create=true, username = APP. Terminat

感谢您的帮助,我对YARN来说还很陌生,但是很高兴能够启动并运行它。

0 个答案:

没有答案