1.配置Java,maven等环境变量
]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
]# mvn -version
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/software/apache-maven-3.6.3
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /usr/java/jdk1.8.0_211/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-957.1.3.el7.x86_64", arch: "amd64", family: "unix"
2.下载cm_ext
Cloudera提供的cm_ext工具,对生成的csd和parcel进行校验
]# mkdir -p ~/github/cloudera
]# cd ~/github/cloudera
]# git clone https://github.com/cloudera/cm_ext.git
]# cd cm_ext
]# mvn package -Dmaven.test.skip=true
注意:创建文件夹‘~/github/cloudera’的原因是后面的执行脚本中(如build_parcel.sh & build_csd.sh)默认的文件夹路径,如果不创建该文件夹,需要修改执行脚本。
3.制作Livy Spark Server 的Parcel包并校验
./build_parcel.sh <Version> <Distro>
Distro 参数:
https://github.com/cloudera/cm_ext/wiki/Parcel-distro-suffixes
]# lsb_release -a #查看版本
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
]# git clone https://github.com/Automattic/cm-livy-scripts.git
]# cd cm-livy-scripts
]# ./build_parcel.sh 1.0 el7
4.制作Livy Spark Server 的CSD文件
cm-livy-scripts]# ./build_csd.sh 1.0
5.查看Parcel包和csd文件
cm-livy-scripts]# ll
总用量 90976
-rwxr-xr-x. 1 root root 345 5月 28 22:25 build_csd.sh
-rwxr-xr-x. 1 root root 1259 5月 28 22:33 build_parcel.sh
drwxr-xr-x. 5 root root 50 5月 28 21:09 csd-src
-rw-r--r--. 1 root root 15199 5月 28 21:09 LICENSE.md
drwxr-xr-x. 17 root root 4096 5月 28 22:33 livy
-rw-r--r--. 1 root root 93113170 5月 28 22:35 LIVY-1.0-el7.parcel
-rw-r--r--. 1 root root 3584 5月 28 22:26 LIVY-1.0.jar
-rw-r--r--. 1 root root 309 5月 28 22:35 manifest.json
drwxr-xr-x. 3 root root 18 5月 28 21:09 parcel-src
-rw-r--r--. 1 root root 2370 5月 28 21:09 README.md
-rwxr-xr-x. 1 root root 92 5月 28 21:09 serve_parcel.sh
LIVY-1.0-el7.parcel和manifest.json文件