客户端yarn模式执行
bin/spark-shell --master yarn --deploy-mode client
问题 HADOOP_CONF_DIR or YARN_CONF_DIR must be set
Exception in thread "main" java.lang.Exception: When running with master 'yarn' either HADOOP_CONF_DIR or YARN_CONF_DIR must be set in the environment.
配置 spark-env.sh
HADOOP_CONF_DIR=/opt/modules/hadoop-2.5.0/etc/hadoop
问题 Failed to send RPC
20/06/23 13:45:03 WARN Client: Neither spark.yarn.jars nor spark.yarn.archive is set, falling back to uploading libraries under SPARK_HOME.
20/06/23 13:45:17 ERROR TransportClient: Failed to send RPC 6188108099837837547 to /192.168.0.153:37248: java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
at io.netty.channel.AbstractChannel$AbstractUnsafe.write(…)(Unknown Source)
原因:据说虚拟内存爆了,另外yarn默认是8G一个机器,我是6G所以一起调小点
配置 yarn-site.xm
l配置
<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>
<property>
<name>yarn.nodemanager.pmem-check-enabled</name>
<value>false</value>
</property>