- PySpark Cookbook
- Denny Lee Tomasz Drabas
- 182字
- 2021-06-18 19:06:31
How to do it...
The installOnRemote.sh script for this recipe can be found in the Chapter01 folder in the GitHub repository: http://bit.ly/2ArlBck. Some portions of the script are very similar to the ones we have outlined in the previous recipes, so we will skip those; you can refer to previous recipes for more information (especially the Installing Spark requirements and the Installing Spark from binaries recipes).
The top-level structure of the script is as follows:
#!/bin/bash
# Shell script for installing Spark from binaries
# on remote servers
#
# PySpark Cookbook
# Author: Tomasz Drabas, Denny Lee
# Version: 0.1
# Date: 12/9/2017
_spark_binary="http://mirrors.ocf.berkeley.edu/apache/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz"
_spark_archive=$( echo "$_spark_binary" | awk -F '/' '{print $NF}' )
_spark_dir=$( echo "${_spark_archive%.*}" )
_spark_destination="/opt/spark"
_java_destination="/usr/lib/jvm/java-8-oracle"
_python_binary="https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh"
_python_archive=$( echo "$_python_binary" | awk -F '/' '{print $NF}' )
_python_destination="/opt/python"
_machine=$(cat /etc/hostname)
_today=$( date +%Y-%m-%d )
_current_dir=$(pwd) # store current working directory
...
printHeader
readIPs
checkJava
installScala
installPython
updateHosts
configureSSH
downloadThePackage
unpack
moveTheBinaries
setSparkEnvironmentVariables
updateSparkConfig
cleanUp
We have highlighted the portions of the script that are more relevant to this recipe in bold font.
推薦閱讀
- Functional Python Programming
- Android Jetpack開發(fā):原理解析與應(yīng)用實戰(zhàn)
- VSTO開發(fā)入門教程
- SQL基礎(chǔ)教程(視頻教學(xué)版)
- Apache Mahout Clustering Designs
- Python+Tableau數(shù)據(jù)可視化之美
- 計算機應(yīng)用基礎(chǔ)項目化教程
- Exploring SE for Android
- UX Design for Mobile
- 寫給青少年的人工智能(Python版·微課視頻版)
- TypeScript全棧開發(fā)
- Android應(yīng)用程序設(shè)計
- HTML5 Canvas核心技術(shù):圖形、動畫與游戲開發(fā)
- 編寫高質(zhì)量代碼之Java(套裝共2冊)
- 大話C語言