官方文檔:spark.apache.org/docs/latest
網(wǎng)站設(shè)計(jì)制作過程拒絕使用模板建站;使用PHP+MYSQL原生開發(fā)可交付網(wǎng)站源代碼;符合網(wǎng)站優(yōu)化排名的后臺(tái)管理系統(tǒng);做網(wǎng)站、網(wǎng)站建設(shè)收費(fèi)合理;免費(fèi)進(jìn)行網(wǎng)站備案等企業(yè)網(wǎng)站建設(shè)一條龍服務(wù).我們是一家持續(xù)穩(wěn)定運(yùn)營了十多年的創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司。
?
??? MapReduce局限性:
??? 1>) 繁雜
??????????? map/reduce (mapjoin沒有reduce)
??????????? low_level
??????????? constained
??????????? 需求 測(cè)試 每次改代碼再測(cè)試
??? 2>) 技術(shù)效率低
??????? 進(jìn)程幾百:MapTask ReduceTask??? JVM復(fù)用
??????? IO: chain? 網(wǎng)絡(luò)+磁盤
??????? 排序:都要排序 :面試題:key類型是實(shí)現(xiàn)什么接口?
??????? Memory:
??????? ...
??????? 不適合迭代處理
??????? 不適合實(shí)時(shí)流式處理
???????
??? 很多框架各自為戰(zhàn)
???
spark.apache.org
??? Speed
??????? memory
??????? thread
??????? sort (可設(shè)置)
???????
??????? DAG rdd.map.filter....collect
???????
??? Ease of use
??????? high-level operators: join、 group 、 count。。。
???????
???
??? generality
???
??? Runs Everywhere
???
???
小結(jié):
??? fast + general engine
??????? write code: java/Scala/Python/R? interactive shell
??????? run:memory/ADG/thread model/.....
???????版本介紹和選擇依據(jù)參考:
??? 如何學(xué)習(xí)Spark
??????? mail list
??????? user@spark.apache.org
??????? apache-spark-user-list/
??????? meetup/峰會(huì)
??????? 源碼樣例
??????? github.com/apache/spark
??????? source code
???????
???????
???????
???????
環(huán)境:
centos6
????
???? hadoop000(hadoop) hadoop001 hadoop002
???? app 存放安裝軟件的目錄
???? software 存放軟件包的tar
???? data 存放測(cè)試數(shù)據(jù)
???? lib存放我們自己的jar
???? source 存放源碼的位置
????
????
????
官網(wǎng)下載源碼解壓
????
????
???? 編譯Spark源碼的前置要求
???? java 8+, Python 2.7+/3.4+?? Spark 2.3.0? Scala 2.11.xx
???? 安裝jdk
????
? apache-maven安裝
???? 解壓配置.bash_proile
???? export MAVEN_HOME/home/hadoop/app/apache-maven-3.3.9
???? export PATH=$MAVE_HOME/bin:$PATH
????
???? 建議:修改maven本地倉庫的地址 $MAVE_HOME/conf/setting.xml
????
????
? 安裝scala-2.11.9.tgz
???? 解壓配置.bash_proile
???? export MAVEN_HOME/home/hadoop/app/scala-2.11.9
???? export PATH=$MAVE_HOME/bin:$PATH
????
???? source ~.bash_proile
???? 驗(yàn)證:mvn -v
????
???? git安裝下 yum install git
????
????
編譯安裝
??? export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m"
??? ./build/mvn -DskipTests clean package
????
????
???? 修改源碼編碼默認(rèn)hadoop版本
???? pom.xml
????
????
???? profile
???? Apache Hadoop 2.7.x and later
??? ./build/mvn -pyarn -Phadoop-2.7 -Dhadoop.version=2.7.3 -DskipTests clean package
???? Hive 1.2.1 support
???? ./build/mvn -Pyarn -Phive -Phive -thriftserver -DskipTests clean package
??
????????
???????
????? 開發(fā)環(huán)境編譯?
????? ./build/mvn -pyarn -Phive -Phive -Phadoop-2.6 -Dhadoop.version=2.6.3 -DskipTests clean
???? 生產(chǎn)環(huán)境
????? ./dev/make-distribution.sh \
????? --name hadoop-2.6.0-cdh6.7.0 --(就填寫hadoop版本號(hào)) \
????? --tgz \
????? --Dhadoop.version=2.6.3 \
????? --Phadoop-2.6? \
????? --Phive -Phive-thriftserver \
????? --Pyarn
???????
???? 根據(jù)報(bào)錯(cuò)配置倉庫源??
???????
???????
???? 修改腳本 加快編譯速度
??? vim make-distribution.zh? 注釋點(diǎn)下面幾個(gè)編譯檢查參數(shù)
??? VERSION=2.2.0
??? SCALA_VERSION=2.11
??? SPARK_HADOOP_VERSION=2.6.0-cdh6.7.0
??? SPARK_HIVE=1
????????
???????
???????
編譯文檔
http://spark.apache.org/docs/2.3.0/building-spark.html
more? --- building spark
???????
???????
Spark安裝包目錄結(jié)構(gòu)說明
??? bin 存放客戶端相關(guān)腳本
??? conf 配置文件模板
??? data 存放測(cè)試數(shù)據(jù)
??? examples Spark 自帶的測(cè)試用例? 重點(diǎn)查看自帶的代碼樣例
??? jars???? jar包
??? sbin? 存放服務(wù)端相關(guān)腳本
??? yarn?? 存放yarn相關(guān)jar包
???????
源碼
github.com/apache/spark???????