Spark升級--在CDH-5.15.1中添加spark2
一、環境準備
jdk-1.8+scala-2.11.X+python-2.7
二、創建目錄
mkdir -p /opt/cloudera/csd
修改權限
chown cloudera-scm:cloudera-scm /opt/cloudera/csd
獲取csd(放到/opt/cloudera/csd目錄)
wget http://archive.cloudera.com/spark2/csd/SPARK2_ON_YARN-2.1.0.cloudera2.jar
修改組權限和用戶權限
chgrp cloudera-scm SPARK2_ON_YARN-2.1.0.cloudera2.jar
chown cloudera-scm SPARK2_ON_YARN-2.1.0.cloudera2.jar
三、添加parcels
管理-設置下註意:
(1)2.1.0.cloudera2 和2.1.0.cloudera1的區別
(詳見表格:https://www.cloudera.com/documentation/spark2/latest/topics/spark2_requirements.html)
(2)jar版本要和此處的2.1.0.cloudera2或者2.1.0.cloudera1版本一致
url----->http://archive.cloudera.com/spark2/parcels/2.1.0.cloudera2/
等待下載結束
四、激活spark2
五、重啟群集和cloudera-scm-server
(1)先重啟cdh集群
(2)再重啟cloudera-scm-server
#/opt/cloudera-manager/cm-5.15.1/etc/init.d/cloudera-scm-server restart
#tail -f/opt/cloudera-manager/cm-5.15.1/log/cloudera-scm-server/cloudera-scm-server.log
#tail -f/opt/cloudera-manager/cm-5.15.1/log/cloudera-scm-agent/cloudera-scm-agent.log
六、添加spark2的服務
(1)點擊添加服務
(2)選擇spark2
(3)選擇依賴最多的
(4)選擇history spark2
(5)選擇gateway
(6)等待執行成功
(7)成功後的界面
七、測試spark2
(1)在命令行輸入
spark-shell --conf spark.executor.memory=2g --confspark.executor.cores=2
(2)參考舉例
https://spark.apache.org/docs/2.1.0/quick-start.html
Spark升級--在CDH-5.15.1中添加spark2