Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75ab015

Browse files
committed
Changes in spark port and docker file
1 parent 76334e9 commit 75ab015

File tree

4 files changed

+19
-29
lines changed

4 files changed

+19
-29
lines changed

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ services:
33
spark-master:
44
image: spydernaz/spark-master:latest
55
ports:
6-
- "9090:8080"
6+
- "8080:8888"
77
- "7077:7077"
88
volumes:
99
- ./apps:/opt/spark-apps
1010
- ./data:/opt/spark-data
1111
environment:
1212
- "SPARK_LOCAL_IP=spark-master"
13+
- "SPARK_PUBLIC_DNS=localhost"
1314
spark-worker:
1415
image: spydernaz/spark-worker:latest
1516
depends_on:
1617
- spark-master
18+
ports:
19+
- "8081:8889"
1720
environment:
1821
- SPARK_MASTER=spark://spark-master:7077
1922
- SPARK_WORKER_CORES=1
2023
- SPARK_WORKER_MEMORY=1G
2124
- SPARK_DRIVER_MEMORY=128m
2225
- SPARK_EXECUTOR_MEMORY=256m
26+
- "SPARK_PUBLIC_DNS=localhost"
2327
volumes:
2428
- ./apps:/opt/spark-apps
2529
- ./data:/opt/spark-data

docker/base/Dockerfile

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
FROM openjdk:8u212-b04-jdk-stretch
2-
LABEL author="Nathaniel Vala" email="nathanielvala@hotmail.com"
3-
LABEL version="0.2"
2+
LABEL author="Pradeep Sekar" email="pradipraniboy@gmail.com"
3+
LABEL version="0.1"
44

55
ENV DAEMON_RUN=true
6-
ENV SPARK_VERSION=2.4.3
7-
ENV HADOOP_VERSION=2.7
8-
ENV SCALA_VERSION=2.12.4
6+
ENV SPARK_VERSION=3.0.1
7+
ENV HADOOP_VERSION=3.2
8+
ENV SCALA_VERSION=2.12.10
99
ENV SCALA_HOME=/usr/share/scala
1010
ENV SPARK_HOME=/spark
1111

12-
12+
## Get all certificates.
1313
RUN apt-get update && apt-get install -y curl vim wget software-properties-common ssh net-tools ca-certificates jq
1414

15-
# apt update && apt -y upgrade \
16-
# apt install -y wget ca-certificates && \
17-
# apt install -y curl bash jq && \
15+
16+
## Install all initial lirary
1817
RUN cd "/tmp" && \
1918
wget --no-verbose "https://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz" && \
2019
tar xzf "scala-${SCALA_VERSION}.tgz" && \
@@ -24,34 +23,18 @@ RUN cd "/tmp" && \
2423
ln -s "${SCALA_HOME}/bin/"* "/usr/bin/" && \
2524
rm -rf "/tmp/"*
2625

27-
28-
# RUN apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
29-
# apk add --no-cache bash curl jq && \
30-
# cd "/tmp" && \
31-
# wget --no-verbose "https://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz" && \
32-
# tar xzf "scala-${SCALA_VERSION}.tgz" && \
33-
# mkdir "${SCALA_HOME}" && \
34-
# rm "/tmp/scala-${SCALA_VERSION}/bin/"*.bat && \
35-
# mv "/tmp/scala-${SCALA_VERSION}/bin" "/tmp/scala-${SCALA_VERSION}/lib" "${SCALA_HOME}" && \
36-
# ln -s "${SCALA_HOME}/bin/"* "/usr/bin/" && \
37-
# apk del .build-dependencies && \
38-
# rm -rf "/tmp/"*
39-
40-
4126
# Add Dependencies for PySpark
4227
RUN apt-get install -y python3 python3-pip python3-numpy python3-matplotlib python3-scipy python3-pandas python3-simpy
4328
RUN update-alternatives --install "/usr/bin/python" "python" "$(which python3)" 1
4429

4530

46-
#Scala instalation
31+
#Scala instalation ---> Check the spark and sbt versions
4732
RUN export PATH="/usr/local/sbt/bin:$PATH" && apt update && apt install ca-certificates wget tar && mkdir -p "/usr/local/sbt" && wget -qO - --no-check-certificate "https://github.com/sbt/sbt/releases/download/v1.2.8/sbt-1.2.8.tgz" | tar xz -C /usr/local/sbt --strip-components=1 && sbt sbtVersion
4833

4934
RUN wget --no-verbose http://apache.mirror.iphh.net/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz && tar -xvzf spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz \
5035
&& mv spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION} spark \
5136
&& rm spark-${SPARK_VERSION}-bin-hadoop${HADOOP_VERSION}.tgz
5237

53-
54-
5538
# Fix the value of PYTHONHASHSEED
5639
# Note: this is needed when you use Python 3.3 or greater
5740
ENV PYTHONHASHSEED 1

docker/spark-master/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM spydernaz/spark-base:latest
22

33
COPY start-master.sh /
44

5+
ENV SPARK_MASTER_HOST 127.0.0.1
56
ENV SPARK_MASTER_PORT 7077
67
ENV SPARK_MASTER_WEBUI_PORT 8080
78
ENV SPARK_MASTER_LOG /spark/logs
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#!/bin/bash
22

3-
export SPARK_MASTER_HOST=`hostname`
4-
53
. "/spark/sbin/spark-config.sh"
64

75
. "/spark/bin/load-spark-env.sh"
86

7+
export SPARK_MASTER_HOST=127.0.0.1
8+
99
mkdir -p $SPARK_MASTER_LOG
1010

1111
export SPARK_HOME=/spark
1212

1313
ln -sf /dev/stdout $SPARK_MASTER_LOG/spark-master.out
1414

15+
echo $SPARK_MASTER_HOST
16+
1517
cd /spark/bin && /spark/sbin/../bin/spark-class org.apache.spark.deploy.master.Master --ip $SPARK_MASTER_HOST --port $SPARK_MASTER_PORT --webui-port $SPARK_MASTER_WEBUI_PORT >> $SPARK_MASTER_LOG/spark-master.out

0 commit comments

Comments
 (0)