Hadoop生态圈-通过CDH5.15.1部署spark1.6与spark2.3.0的版本兼容运行
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
[root@node101 ~]# yum -y install wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
10gen | 2.5 kB ::
base | 3.6 kB ::
centosplus | 3.4 kB ::
epel | 3.2 kB ::
extras | 3.4 kB ::
mysql-connectors-community | 2.5 kB ::
mysql-tools-community | 2.5 kB ::
mysql56-community | 2.5 kB ::
updates | 3.4 kB ::
(/): epel/x86_64/updateinfo | kB ::
(/): epel/x86_64/primary | 3.6 MB ::
(/): updates//x86_64/primary_db | 6.0 MB ::
epel /
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 :1.14-.el7_4. will be installed
--> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================================================================================
Package Arch Version Repository Size
===================================================================================================================================================================================================================
Installing:
wget x86_64 1.14-.el7_4. base k Transaction Summary
===================================================================================================================================================================================================================
Install Package Total download size: k
Installed size: 2.0 M
Downloading packages:
wget-1.14-.el7_4..x86_64.rpm | kB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : wget-1.14-.el7_4..x86_64 /
Verifying : wget-1.14-.el7_4..x86_64 / Installed:
wget.x86_64 :1.14-.el7_4. Complete!
[root@node101 ~]#
[root@node101 ~]# yum -y install wget
[root@node101 ~]# mkdir /opt/cloudera/csd && cd /opt/cloudera/csd
[root@node101 csd]#
[root@node101 csd]# wget http://archive.cloudera.com/spark2/csd/SPARK2_ON_YARN-2.3.0.cloudera4.jar
---- ::-- http://archive.cloudera.com/spark2/csd/SPARK2_ON_YARN-2.3.0.cloudera4.jar
Connecting to 10.9.137.250:... connected.
Proxy request sent, awaiting response... OK
Length: (19K) [application/java-archive]
Saving to: ‘SPARK2_ON_YARN-2.3..cloudera4.jar’ %[=========================================================================================================================================================================>] , --.-K/s in .002s -- :: (10.4 MB/s) - ‘SPARK2_ON_YARN-2.3..cloudera4.jar’ saved [/] [root@node101 csd]#
[root@node101 csd]# ll
total
-rw-r--r--. root root Oct : SPARK2_ON_YARN-2.3..cloudera4.jar
[root@node101 csd]#
[root@node101 csd]# ll
total
-rw-r--r--. root root Oct : SPARK2_ON_YARN-2.3..cloudera4.jar
[root@node101 csd]#
[root@node101 csd]#
[root@node101 csd]# id cloudera-scm
uid=(cloudera-scm) gid=(cloudera-scm) groups=(cloudera-scm)
[root@node101 csd]#
[root@node101 csd]#
[root@node101 csd]# chown cloudera-scm:cloudera-scm SPARK2_ON_YARN-2.3..cloudera4.jar
[root@node101 csd]#
[root@node101 csd]# ll
total
-rw-r--r--. cloudera-scm cloudera-scm Oct : SPARK2_ON_YARN-2.3..cloudera4.jar
[root@node101 csd]#
[root@node101 ~]# cd /opt/cloudera/parcel-repo/
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# mv manifest.json manifest.json.`date +%F`
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
[root@node101 parcel-repo]#
[root@node101 ~]# hostname
node101.yinzhengjie.org.cn
[root@node101 ~]#
[root@node101 ~]# cd /opt/cloudera/parcel-repo/
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# wget http://archive.cloudera.com/spark2/parcels/2.3.0.cloudera4/SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel
---- ::-- http://archive.cloudera.com/spark2/parcels/2.3.0.cloudera4/SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel
Connecting to 10.9.137.250:... connected.
Proxy request sent, awaiting response... OK
Length: (183M) [binary/octet-stream]
Saving to: ‘SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel’ %[=========================================================================================================================================================================>] ,, 255KB/s in 22m 2s -- :: ( KB/s) - ‘SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel’ saved [/] [root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
[root@node101 parcel-repo]#
下载spark2.3.0版本的parcel安装包([root@node101 parcel-repo]# wget http://archive.cloudera.com/spark2/parcels/2.3.0.cloudera4/SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel)
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# wget http://archive.cloudera.com/spark2/parcels/2.3.0.cloudera4/SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel.sha1
---- ::-- http://archive.cloudera.com/spark2/parcels/2.3.0.cloudera4/SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel.sha1
Connecting to 10.9.137.250:... connected.
Proxy request sent, awaiting response... OK
Length: [binary/octet-stream]
Saving to: ‘SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha1’ %[=========================================================================================================================================================================>] --.-K/s in 0s -- :: (3.01 MB/s) - ‘SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha1’ saved [/] [root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha1
[root@node101 parcel-repo]#
下载spark2.3.0的parcel校验包([root@node101 parcel-repo]# wget http://archive.cloudera.com/spark2/parcels/2.3.0.cloudera4/SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel.sha1)
[root@node101 parcel-repo]# hostname
node101.yinzhengjie.org.cn
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# pwd
/opt/cloudera/parcel-repo
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha1
[root@node101 parcel-repo]#
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# mv SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha1 SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha
[root@node101 parcel-repo]#
对下载的校验包进行重命名操作([root@node101 parcel-repo]# mv SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel.sha1 SPARK2-2.3.0.cloudera4-1.cdh5.13.3.p0.611179-el7.parcel.sha)
[root@node101 parcel-repo]# hostname
node101.yinzhengjie.org.cn
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# pwd
/opt/cloudera/parcel-repo
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha
[root@node101 parcel-repo]#
[root@node101 parcel-repo]# wget http://archive.cloudera.com/spark2/parcels/2.1.0.cloudera1/manifest.json
---- ::-- http://archive.cloudera.com/spark2/parcels/2.1.0.cloudera1/manifest.json
Connecting to 10.9.137.250:... connected.
Proxy request sent, awaiting response... OK
Length: (.6K) [application/json]
Saving to: ‘manifest.json’ %[=========================================================================================================================================================================>] , --.-K/s in 0s -- :: ( MB/s) - ‘manifest.json’ saved [/] [root@node101 parcel-repo]#
[root@node101 parcel-repo]# ll
total
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel
-rwxr-xr-x. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.sha
-rw-r-----. root root Oct : CDH-5.15.-.cdh5.15.1.p0.-el7.parcel.torrent
-rw-r--r--. root root Feb manifest.json
-rwxr-xr-x. root root Oct : manifest.json.--
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel
-rw-r--r--. root root Oct : SPARK2-2.3..cloudera4-.cdh5.13.3.p0.-el7.parcel.sha
[root@node101 parcel-repo]#
下载manifest.json的安装包([root@node101 parcel-repo]# wget http://archive.cloudera.com/spark2/parcels/2.1.0.cloudera1/manifest.json)
4>.重启Cloudera manager的服务端(我是离线方式部署的CDH)
[root@node101 ~]# hostname
node101.yinzhengjie.org.cn
[root@node101 ~]#
[root@node101 ~]# cd /opt/cloudera-manager/cm-5.15./etc/init.d/
[root@node101 init.d]#
[root@node101 init.d]# ll
total
-rwxr-xr-x. Jul : cloudera-scm-agent
-rwxr-xr-x. Jul : cloudera-scm-server
-rwxr-xr-x. Jul : cloudera-scm-server-db
[root@node101 init.d]#
[root@node101 init.d]# ./cloudera-scm-server restart
Stopping cloudera-scm-server: [ OK ]
Starting cloudera-scm-server: [ OK ]
[root@node101 init.d]#
13>.在部署有gateway主机上运行spark2.3.0版本环境
解决方案:
很简单,我们在部署spark和spark2时,如果选择的时on yarn模式的话,人家已经指名道姓的让你安装YARN服务,因此我们只需要把yarn服务安装好再来安装spark2.3.0版本即可。
2>. 执行内存小雨分配最大内存。
启动spark2时报错如下:
Required executor memory (1024+384 MB) is above the max threshold (1024 MB) of this cluster! Please check the values of 'yarn.scheduler.maximum-allocation-mb' and/or 'yarn.nodemanager.resource.memory-mb'.
解决方案:
按照上图的报错信息提示,执行的内存超过来你分配的最大内存,因此按照提示去yarn服务的配置文件修改最大容器内存(yarn.scheduler.maximum-allocation-mb)和容器内存(yarn.nodemanager.resource.memory-mb)的值即可。我的建议是不要把操作系统的所有内存都分配出去,需要给操作系统预留点内存,推荐遵循二八法则(20%的内存分配给操作系统,80%的内存分配给服务)。