From d8537de99d822d12f403b513020b0a57a8832074 Mon Sep 17 00:00:00 2001 From: keineahnung2345 Date: Tue, 27 Nov 2018 11:59:59 +0800 Subject: [PATCH 1/3] use host ip rather than 127.0.0.1 SPARK_PUBLIC_DNS --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index bcce266..f46f8b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ services: environment: MASTER: spark://spark-master:7077 SPARK_CONF_DIR: /conf - SPARK_PUBLIC_DNS: 127.0.0.1 + SPARK_PUBLIC_DNS: $HOSTIP expose: - 7001 - 7002 @@ -43,7 +43,7 @@ services: hostname: spark-worker-1 environment: SPARK_CONF_DIR: /conf - SPARK_PUBLIC_DNS: 127.0.0.1 + SPARK_PUBLIC_DNS: $HOSTIP SPARK_WORKER_CORES: 2 SPARK_WORKER_MEMORY: 2g SPARK_WORKER_PORT: 8881 From 09b5af30faefdea09b0228f0c1770e33d47ae16e Mon Sep 17 00:00:00 2001 From: keineahnung2345 Date: Tue, 27 Nov 2018 12:01:27 +0800 Subject: [PATCH 2/3] create .env This file contains the environment variable HOSTIP which is used by docker-compose.yml. --- .env | 1 + 1 file changed, 1 insertion(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..128a5a5 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +HOSTIP=127.0.0.1 From 117ac1fb1cc088455bcfd98d359b732d935d35eb Mon Sep 17 00:00:00 2001 From: keineahnung2345 Date: Fri, 7 Dec 2018 09:11:40 +0800 Subject: [PATCH 3/3] password --- docker-compose.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f46f8b2..446bd1f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.1" services: jupyter-debian: - image: edgarperezsampedro/blog_docker + image: keineahnung2345/edgarperezsampedro-blog_docker ports: - "8888:8888" links: @@ -13,6 +13,9 @@ services: depends_on: - spark-master - spark-worker-1 + env_file: .env + environment: + PASSWORD: ${PASSWORD} spark-master: image: edgarperezsampedro/spark2-ubuntu @@ -21,7 +24,7 @@ services: environment: MASTER: spark://spark-master:7077 SPARK_CONF_DIR: /conf - SPARK_PUBLIC_DNS: $HOSTIP + SPARK_PUBLIC_DNS: ${HOSTIP} expose: - 7001 - 7002 @@ -41,9 +44,10 @@ services: image: edgarperezsampedro/spark2-ubuntu command: bin/spark-class org.apache.spark.deploy.worker.Worker spark://spark-master:7077 hostname: spark-worker-1 + env_file: .env environment: SPARK_CONF_DIR: /conf - SPARK_PUBLIC_DNS: $HOSTIP + SPARK_PUBLIC_DNS: ${HOSTIP} SPARK_WORKER_CORES: 2 SPARK_WORKER_MEMORY: 2g SPARK_WORKER_PORT: 8881