您好,登錄后才能下訂單哦!
這篇文章主要講解了“Mac怎么部署spark2.4.4”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“Mac怎么部署spark2.4.4”吧!
操作系統:macOS Mojave 10.14.6
JDK:1.8.0_211 (安裝位置:/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home)
請參考《Mac部署hadoop3(偽分布式)》一文,在Mac上事先部署好hadoop3
安裝scala:
brew install scala
配置scala的環境變量,打開文件<font color="blue">~/.bash_profile</font>,增加以下配置內容:
export SCALA_HOME=/usr/local/Cellar/scala/2.13.0 export PATH=$PATH:$SCALA_HOME/bin
執行命令<font color="blue">source ~/.bash_profile</font>,再驗證scala:
base) zhaoqindeMBP:~ zhaoqin$ scala -version Scala code runner version 2.13.0 -- Copyright 2002-2019, LAMP/EPFL and Lightbend, Inc.
下載spark,地址是:http://spark.apache.org/downloads.html ,如下圖紅框:
將下載的文件在<font color="blue">/usr/local/</font>目錄下解壓,并將文件夾名字從<font color="blue">spark-2.4.4-bin-hadoop2.7</font>改為<font color="blue">spark</font>
配置spark的環境變量,打開文件<font color="blue">~/.bash_profile</font>,增加以下配置內容:
export SPARK_HOME=/usr/local/spark export PATH=$PATH:$SPARK_HOME/bin
執行命令<font color="blue">source ~/.bash_profile</font>使配置生效;
打開文件<font color="blue">spark/conf/spark-env.sh</font>,在尾部增加以下三行:
export SCALA_HOME=/usr/local/Cellar/scala/2.13.0 export SPARK_MASTER_IP=localhost export SPARK_WORKER_MEMORY=2G
確保hdfs和yarn已經啟動,然后執行命令<font color="blue">spark-shell</font>,即可啟動spark服務:
To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. (base) zhaoqindeMBP:~ zhaoqin$ spark-shell 19/10/27 13:33:51 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties Setting default log level to "WARN". To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel). Spark context Web UI available at http://zhaoqindembp:4040 Spark context available as 'sc' (master = local[*], app id = local-1572154437623). Spark session available as 'spark'. Welcome to ____ __ / __/__ ___ _____/ /__ _\ \/ _ \/ _ `/ __/ '_/ /___/ .__/\_,_/_/ /_/\_\ version 2.4.4 /_/ Using Scala version 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_211) Type in expressions to have them evaluated. Type :help for more information. scala>
感謝各位的閱讀,以上就是“Mac怎么部署spark2.4.4”的內容了,經過本文的學習后,相信大家對Mac怎么部署spark2.4.4這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。