Spark2
下载spark2纯净版
wget https://archive.apache.org/dist/spark/spark-2.4.7/spark-2.4.7-bin-without-hadoop.tgz
安装配置纯净版
默认配置不赘述。
Hive3
hive-env.sh
export HADOOP_HOME=/opt/module/hadoop3
export SPARK_HOME=/opt/module/spark2-with
hive-site.xml
<configuration>
<value>${fs.defaultFS}/spark2-jars/*</value>
</property>
<property>
<name>hive.execution.engine</name>
<value>spark</value>
</property>
<property>
<name>hive.spark.client.connect.timeout</name>
<value>30000ms</value>
</property>
</configuration>
spark-defaults.conf
spark.master yarn
spark.eventLog.enabled true
spark.eventLog.dir hdfs://sc1:9820/spark2-history
spark.executor.memory 1g
spark.driver.memory 1g
spark2依赖库处理
cd /opt/module/spark2-with/jars
mv orc-core-1.5.5-nohive.jar orc-core-1.5.5-nohive.jar.bak
//上传jar包到hdfs
hdfs dfs -rm -r -f /spark2-jars
hdfs dfs -mkdir /spark2-jars
hdfs dfs -put /opt/module/spark2-with/jars/* /spark2-jars
hdfs dfs -ls /spark2-jars
//拷贝jar包到hive
cp scala-compiler-2.11.12.jar scala-library-2.11.12.jar scala-reflect-2.11.12.jar spark-core_2.11-2.4.7.jar spark-network-common_2.11-2.4.7.jar spark-unsafe_2.11-2.4.7.jar spark-yarn_2.11-2.4.7.jar /opt/module/hive3/lib/
// 将orc上传至hdfs
hdfs dfs -put /opt/module/hive3/lib/orc-core-1.5.6.jar /spark2-jars
|