- PySpark Cookbook
- Denny Lee Tomasz Drabas
- 157字
- 2021-06-18 19:06:33
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
推薦閱讀
- Functional Python Programming
- Web應用系統開發實踐(C#)
- Python編程與幾何圖形
- 零基礎入門學習Python
- Scientific Computing with Scala
- Spring核心技術和案例實戰
- 利用Python進行數據分析
- Natural Language Processing with Java and LingPipe Cookbook
- Hands-On Nuxt.js Web Development
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- 愛上C語言:C KISS
- 深入淺出Python數據分析
- 30天學通C#項目案例開發
- Software Architecture with Python
- Visual C#(學習筆記)