51CTO沒有目錄功能么?好難受
創(chuàng)新互聯(lián)是一家集成都網(wǎng)站設(shè)計、成都網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站頁面設(shè)計、網(wǎng)站優(yōu)化SEO優(yōu)化為一體的專業(yè)網(wǎng)站建設(shè)公司,已為成都等多地近百家企業(yè)提供網(wǎng)站建設(shè)服務(wù)。追求良好的瀏覽體驗,以探求精品塑造與理念升華,設(shè)計最適合用戶的網(wǎng)站頁面。 合作只是第一步,服務(wù)才是根本,我們始終堅持講誠信,負(fù)責(zé)任的原則,為您進(jìn)行細(xì)心、貼心、認(rèn)真的服務(wù),與眾多客戶在蓬勃發(fā)展的市場環(huán)境中,互促共生。========
有任何問題歡迎加企鵝討論^-^
1176738641
========
#用戶目錄下創(chuàng)建五個文件夾
app #存放應(yīng)用
software #存放應(yīng)用壓縮包
data #存放測試數(shù)據(jù)
lib #存放jar包
source #存放源碼
rpm -qa|grep java
# 如果安裝的版本低于1.7,卸載該jdk
rpm -e 軟件包1 軟件包2
tar -zxf jdk-8u131-linux-x64.tar.gz -C ~/app/
~/app/jdk1.8.0_131/bin/java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
版本信息正常打印,說明安裝成功
切記 >>為追加!>為覆蓋!一定不要打成>
echo "####JAVA_HOME####"
echo "export JAVA_HOME=/home/max/app/jdk1.8.0_131" >> ~/.bash_profile
echo "export PATH=$JAVA_HOME/bin:$PATH" >> ~/.bash_profile
# 刷新環(huán)境變量
source ~/.bash_profile
此時,在任意目錄下,使用java -version都可生效
tar -zxvf apache-maven-3.6.1-bin.tar.gz -C ~/app
~/app/apache-maven-3.6.1/bin/mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T15:00:29-04:00)
Maven home: /home/max/app/apache-maven-3.6.1
Java version: 1.8.0_131, vendor: Oracle Corporation, runtime: /home/max/app/jdk1.8.0_131/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.el6.x86_64", arch: "amd64", family: "unix"
顯示出版本信息,說明安裝成功
切記 >>為追加!>為覆蓋!一定不要打成>
echo "####MAVEN_HOME####" >> ~/.bash_profile
echo "export MAVEN_HOME=/home/max/app/apache-maven-3.6.1/" >> ~/.bash_profile
echo "export PATH=$MAVEN_HOME/bin:$PATH" >> ~/.bash_profile
# 刷新環(huán)境變量
source ~/.bash_profile
此時,在任意目錄下,使用mvn -v 都可生效
# 創(chuàng)建本地倉庫文件夾
mkdir ~/maven_repo
# 修改settings.xml文件
vim $MAVEN_HOME/conf/settings.xml
注意標(biāo)簽!別與已經(jīng)存在的標(biāo)簽沖突
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>/home/max/maven_repo</localRepository>
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*,!cloudera</mirrorOf>
<name>Nexus aliyun</name>
<url>
http://maven.aliyun.com/nexus/content/groups/public
</url>
</mirror>
tar -zxf scala-2.11.8.tgz -C ~/app/
~/app/scala-2.11.8/bin/scala
scala> [max@hadoop000 scala-2.11.8]$ scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.
scala>
安裝成功
echo "####SCALA_HOME####" >> ~/.bash_profile
echo "export SCALA_HOME=/home/max/app/scala-2.11.8" >> ~/.bash_profile
echo "export PATH=$SCALA_HOME/bin:$PATH" >> ~/.bash_profile
# 刷新環(huán)境變量
source ~/.bash_profile
此時,在任意目錄下,使用scala 都可生效
默認(rèn)為CentOS用戶
sudo yum install git
#自動安裝,期間需要按幾次y
#顯示如下
Installed:
git.x86_64 0:1.7.1-9.el6_9
Dependency Installed:
perl-Error.noarch 1:0.17015-4.el6 perl-Git.noarch 0:1.7.1-9.el6_9
Dependency Updated:
openssl.x86_64 0:1.0.1e-57.el6
Complete!
#安裝成功
前期工作終于完事兒了!?。。?!
====================累成狗的分割線=========================
其實漫長的編譯之路才剛剛開始
祭出大殺器!===>參考官網(wǎng)
cd ~/source
wget https://archive.apache.org/dist/spark/spark-2.4.2/spark-2.4.2.tgz
#有時候賊慢
[max@hadoop000 source]$ ll
total 15788
-rw-rw-r--. 1 max max 16165557 Apr 28 12:27 spark-2.4.2.tgz
[max@hadoop000 source]$ tar -zxf spark-2.4.2.tgz
我們不使用mvn這個命令,直接用make-distribution.sh腳本,但是需要修改一下
#spark-2.4.2文件夾下
vim ./dev/make-distribution.sh
#將這些行注釋掉 此處為最佳實踐,為的是通過指定版本號減少編譯時間
#VERSION=$("$MVN" help:evaluate -Dexpression=project.version $@ 2>/dev/null\
# | grep -v "INFO"\
# | grep -v "WARNING"\
# | tail -n 1)
#SCALA_VERSION=$("$MVN" help:evaluate -Dexpression=scala.binary.version $@ 2>/dev/null\
# | grep -v "INFO"\
# | grep -v "WARNING"\
# | tail -n 1)
#SPARK_HADOOP_VERSION=$("$MVN" help:evaluate -Dexpression=hadoop.version $@ 2>/dev/null\
# | grep -v "INFO"\
# | grep -v "WARNING"\
# | tail -n 1)
#SPARK_HIVE=$("$MVN" help:evaluate -Dexpression=project.activeProfiles -pl sql/hive $@ 2>/dev/null\
# | grep -v "INFO"\
# | grep -v "WARNING"\
# | fgrep --count "<id>hive</id>";\
# # Reset exit status to 0, otherwise the script stops here if the last grep finds nothing\
# # because we use "set -o pipefail"
# echo -n)
##添加一下參數(shù),注意,版本號要對應(yīng)自己想要的生產(chǎn)環(huán)境
VERSION=2.4.2
SCALA_VERSION=2.11
SPARK_HADOOP_VERSION=hadoop-2.6.0-cdh6.14.0
SPARK_HIVE=1
在maven默認(rèn)的庫里默認(rèn)只有apache版本的Hadoop依賴,但由于我們hadoop版本是hadoop-2.6.0-cdh6.14.0,我們需要在pom文件里添加CDH倉庫
#spark-2.4.2文件夾下
vim pom.xml
<repositories>
<!--<repositories>
This should be at top, it makes maven try the central repo first and then others
and hence faster dep resolution
<repository>
<id>central</id>
<name>Maven Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
-->
<repository>
<id>central</id>
<url>http://maven.aliyun.com/nexus/content/groups/public//</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
./dev/make-distribution.sh \
--name hadoop-2.6.0-cdh6.14.0 \
--tgz \
-Phadoop-2.6 \
-Dhadoop.version=2.6.0-cdh6.14.0 \
-Phive -Phive-thriftserver \
-Pyarn \
-Pkubernetes
第一次大約需要編譯 1h,我是阿里云鏡像
再次編譯大約就需要10min
注:報錯的話一定要學(xué)會看報錯日志!
##編譯完成
#編譯成功最后一部分日志
+ mkdir /home/max/source/spark-2.4.2/dist/conf
+ cp /home/max/source/spark-2.4.2/conf/docker.properties.template /home/max/source/spark-2.4.2/conf/fairscheduler.xml.template /home/max/source/spark-2.4.2/conf/log4j.properties.template /home/max/source/spark-2.4.2/conf/metrics.properties.template /home/max/source/spark-2.4.2/conf/slaves.template /home/max/source/spark-2.4.2/conf/spark-defaults.conf.template /home/max/source/spark-2.4.2/conf/spark-env.sh.template /home/max/source/spark-2.4.2/dist/conf
+ cp /home/max/source/spark-2.4.2/README.md /home/max/source/spark-2.4.2/dist
+ cp -r /home/max/source/spark-2.4.2/bin /home/max/source/spark-2.4.2/dist
+ cp -r /home/max/source/spark-2.4.2/python /home/max/source/spark-2.4.2/dist
+ '[' false == true ']'
+ cp -r /home/max/source/spark-2.4.2/sbin /home/max/source/spark-2.4.2/dist
+ '[' -d /home/max/source/spark-2.4.2/R/lib/SparkR ']'
+ '[' true == true ']'
+ TARDIR_NAME=spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
+ TARDIR=/home/max/source/spark-2.4.2/spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
+ rm -rf /home/max/source/spark-2.4.2/spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
+ cp -r /home/max/source/spark-2.4.2/dist /home/max/source/spark-2.4.2/spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
+ tar czf spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0.tgz -C /home/max/source/spark-2.4.2 spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
+ rm -rf /home/max/source/spark-2.4.2/spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
由此可以看出編譯后的包在spark源碼包下
[max@hadoop000 spark-2.4.2]$ tar -zxf spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0.tgz -C ~/app/
[max@hadoop000 spark-2.4.2]$ cd ~/app/
[max@hadoop000 app]$ ll
total 16
drwxrwxr-x. 6 max max 4096 Apr 28 17:02 apache-maven-3.6.1
drwxr-xr-x. 8 max max 4096 Mar 15 2017 jdk1.8.0_131
drwxrwxr-x. 6 max max 4096 Mar 4 2016 scala-2.11.8
drwxrwxr-x. 11 max max 4096 Apr 28 21:20 spark-2.4.2-bin-hadoop-2.6.0-cdh6.14.0
完事兒!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)頁名稱:spark-2.4.2.tgz下載及編譯-創(chuàng)新互聯(lián)
分享網(wǎng)址:http://jinyejixie.com/article44/dpoeee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、網(wǎng)站收錄、品牌網(wǎng)站建設(shè)、Google、網(wǎng)站設(shè)計公司、手機網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容