-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathspark-shell.sh
executable file
·37 lines (29 loc) · 1.42 KB
/
spark-shell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
CURRENT_DIR=`pwd`
# Read the version from version.sbt
SPARK_LUCENERDD_VERSION=`cat version.sbt | awk '{print $5}' | xargs`
# You should have downloaded this spark version under your ${HOME}
SPARK_VERSION="3.2.1"
echo "==============================================="
echo "Loading LuceneRDD with version ${SPARK_LUCENERDD_VERSION}"
echo "==============================================="
echo "==============================================="
echo "SPARK version: ${SPARK_VERSION}"
echo "==============================================="
# Assumes that spark is installed under home directory
HOME_DIR=`echo ~`
#export SPARK_LOCAL_IP=localhost
SPARK_HOME=${HOME_DIR}/spark-${SPARK_VERSION}-bin-hadoop3.2
# spark-lucenerdd assembly JAR
MAIN_JAR=${CURRENT_DIR}/target/scala-2.12/spark-lucenerdd-assembly-${SPARK_LUCENERDD_VERSION}.jar
# Run spark shell locally
${SPARK_HOME}/bin/spark-shell --jars "${MAIN_JAR}" \
--conf "spark.executor.memory=1g" \
--conf "spark.driver.memory=1g" \
--conf "spark.rdd.compress=true" \
--conf "spark.serializer=org.apache.spark.serializer.KryoSerializer" \
--conf "spark.kryo.registrator=org.zouzias.spark.lucenerdd.LuceneRDDKryoRegistrator" \
--conf spark.executor.extraJavaOptions="-Dlucenerdd.index.store.mode=disk" \
--conf spark.driver.extraJavaOptions="-Dlucenerdd.index.store.mode=disk" \
--conf "spark.kryoserializer.buffer=24mb" \
--master local[*]