官术网_书友最值得收藏!

How to do it...

To install Livy and sparkmagic, we have created a script that will do this automatically with minimal interaction from you. You can find it in the Chapter01/installLivy.sh folder. You should be familiar with most of the functions that we're going to use here by now, so we will focus only on those that are different (highlighted in bold in the following code). Here is the high-level view of the script's structure:

#!/bin/bash

# Shell script for installing Spark from binaries
#
# PySpark Cookbook
# Author: Tomasz Drabas, Denny Lee
# Version: 0.1
# Date: 12/2/2017

_livy_binary="http://mirrors.ocf.berkeley.edu/apache/incubator/livy/0.4.0-incubating/livy-0.4.0-incubating-bin.zip"
_livy_archive=$( echo "$_livy_binary" | awk -F '/' '{print $NF}' )
_livy_dir=$( echo "${_livy_archive%.*}" )
_livy_destination="/opt/livy"
_hadoop_destination="/opt/hadoop"
...
checkOS
printHeader
createTempDir
downloadThePackage $( echo "${_livy_binary}" )
unpack $( echo "${_livy_archive}" )
moveTheBinaries $( echo "${_livy_dir}" ) $( echo "${_livy_destination}" )

# create log directory inside the folder
mkdir -p "$_livy_destination/logs"

checkHadoop
installJupyterKernels
setSparkEnvironmentVariables
cleanUp
主站蜘蛛池模板: 信阳市| 资阳市| 瑞昌市| 恩施市| 沙坪坝区| 清水县| 灵台县| 齐河县| 资阳市| 楚雄市| 林口县| 泸西县| 老河口市| 阳西县| 正定县| 左权县| 抚州市| 邢台市| 丽水市| 林口县| 洪洞县| 石阡县| 菏泽市| 诸暨市| 安庆市| 汕尾市| 昌平区| 南木林县| 麟游县| 临湘市| 东乌| 祥云县| 清流县| 深泽县| 三门县| 丰镇市| 许昌市| 济南市| 温泉县| 九龙县| 广河县|