From 9dd5d5ba713240c559b102fa3172b10077f5da87 Mon Sep 17 00:00:00 2001 From: Xiaoyu Yao Date: Fri, 17 Aug 2018 07:58:24 -0700 Subject: [PATCH] HDDS-218. add existing docker-compose files to the ozone release artifact. Contributed by Elek Marton. --- dev-support/bin/ozone-dist-layout-stitching | 2 + hadoop-dist/pom.xml | 17 ------- hadoop-dist/src/main/compose/README.md | 51 +++++++++++++++++++ .../main/compose/ozone/docker-compose.yaml | 6 +-- .../compose/ozoneperf/docker-compose.yaml | 6 +-- hadoop-ozone/docs/content/GettingStarted.md | 2 +- 6 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 hadoop-dist/src/main/compose/README.md diff --git a/dev-support/bin/ozone-dist-layout-stitching b/dev-support/bin/ozone-dist-layout-stitching index c30a37d2e5..2ba7791f23 100755 --- a/dev-support/bin/ozone-dist-layout-stitching +++ b/dev-support/bin/ozone-dist-layout-stitching @@ -151,6 +151,8 @@ cp "${ROOT}/hadoop-ozone/ozonefs/target/hadoop-ozone-filesystem-${HDDS_VERSION}. cp -r "${ROOT}/hadoop-ozone/docs/target/classes/webapps/docs" ./share/hadoop/ozone/webapps/ozoneManager/ cp -r "${ROOT}/hadoop-ozone/docs/target/classes/webapps/docs" ./share/hadoop/hdds/webapps/scm/ +#Copy docker compose files +run cp -p -r "${ROOT}/hadoop-dist/src/main/compose" . mkdir -p ./share/hadoop/mapreduce mkdir -p ./share/hadoop/yarn diff --git a/hadoop-dist/pom.xml b/hadoop-dist/pom.xml index 5de6759ce9..da05015e43 100644 --- a/hadoop-dist/pom.xml +++ b/hadoop-dist/pom.xml @@ -276,23 +276,6 @@ maven-resources-plugin - - copy-docker-compose - - copy-resources - - prepare-package - - ${project.build.directory}/compose - - - - src/main/compose - true - - - - copy-dockerfile diff --git a/hadoop-dist/src/main/compose/README.md b/hadoop-dist/src/main/compose/README.md new file mode 100644 index 0000000000..8189d2c169 --- /dev/null +++ b/hadoop-dist/src/main/compose/README.md @@ -0,0 +1,51 @@ + + +# Docker cluster definitions + +This directory contains multiple docker cluster definitions to start local pseudo cluster with different configuration. + +It helps to start local (multi-node like) pseudo cluster with docker and docker-compose and obviously it's not for production. + +You may find more information in the specific subdirectories but in generic you can use the following commands: + +## Usage + +To start a cluster go to a subdirectory and start the cluster: + +``` +docker-compose up -d +``` + +You can check the logs of all the components with: + +``` +docker-compose logs +``` + +In case of a problem you can destroy the cluster an delete all the local state with: + +``` +docker-compose down +``` + +(Note: a simple docker-compose stop may not delete all the local data). + +You can scale up and down the components: + +``` +docker-compose scale datanode=5 +``` + +Usually the key webui ports are published on the docker host. diff --git a/hadoop-dist/src/main/compose/ozone/docker-compose.yaml b/hadoop-dist/src/main/compose/ozone/docker-compose.yaml index bb5e8dd535..0a6a9d8028 100644 --- a/hadoop-dist/src/main/compose/ozone/docker-compose.yaml +++ b/hadoop-dist/src/main/compose/ozone/docker-compose.yaml @@ -19,7 +19,7 @@ services: datanode: image: apache/hadoop-runner volumes: - - ../../ozone:/opt/hadoop + - ../..:/opt/hadoop ports: - 9864 command: ["/opt/hadoop/bin/ozone","datanode"] @@ -28,7 +28,7 @@ services: ozoneManager: image: apache/hadoop-runner volumes: - - ../../ozone:/opt/hadoop + - ../..:/opt/hadoop ports: - 9874:9874 environment: @@ -39,7 +39,7 @@ services: scm: image: apache/hadoop-runner volumes: - - ../../ozone:/opt/hadoop + - ../..:/opt/hadoop ports: - 9876:9876 env_file: diff --git a/hadoop-dist/src/main/compose/ozoneperf/docker-compose.yaml b/hadoop-dist/src/main/compose/ozoneperf/docker-compose.yaml index 6d1d9cadb3..3b5cc7b3b4 100644 --- a/hadoop-dist/src/main/compose/ozoneperf/docker-compose.yaml +++ b/hadoop-dist/src/main/compose/ozoneperf/docker-compose.yaml @@ -19,7 +19,7 @@ services: datanode: image: apache/hadoop-runner volumes: - - ../../ozone:/opt/hadoop + - ../..:/opt/hadoop - ./jmxpromo.jar:/opt/jmxpromo.jar ports: - 9864 @@ -29,7 +29,7 @@ services: ozoneManager: image: apache/hadoop-runner volumes: - - ../../ozone:/opt/hadoop + - ../..:/opt/hadoop - ./jmxpromo.jar:/opt/jmxpromo.jar ports: - 9874:9874 @@ -41,7 +41,7 @@ services: scm: image: apache/hadoop-runner volumes: - - ../../ozone:/opt/hadoop + - ../..:/opt/hadoop - ./jmxpromo.jar:/opt/jmxpromo.jar ports: - 9876:9876 diff --git a/hadoop-ozone/docs/content/GettingStarted.md b/hadoop-ozone/docs/content/GettingStarted.md index 117a3071c5..61d210a7fe 100644 --- a/hadoop-ozone/docs/content/GettingStarted.md +++ b/hadoop-ozone/docs/content/GettingStarted.md @@ -81,7 +81,7 @@ Go to the directory where the docker compose files exist and tell `docker-compose` to start Ozone. This will start SCM, OM and a single datanode in the background. ``` -cd hadoop-dist/target/compose/ozone +cd hadoop-dist/target/ozone/compose/ozone docker-compose up -d ```