Repository: hadoop Updated Branches: refs/heads/ozone-0.2 9ba7ce957 -> 22c318eee
HDDS-414. Fix sbin/stop-ozone.sh to stop Ozone daemons. Contributed by Elek, Marton. (cherry picked from commit 4441fe9201223d02b8aecccd36333bdccc9c0d0b) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/22c318ee Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/22c318ee Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/22c318ee Branch: refs/heads/ozone-0.2 Commit: 22c318eeee82512c48c658f357a84b75d35903cd Parents: 9ba7ce9 Author: Hanisha Koneru <[email protected]> Authored: Thu Sep 13 13:34:22 2018 -0700 Committer: Hanisha Koneru <[email protected]> Committed: Thu Sep 13 13:43:04 2018 -0700 ---------------------------------------------------------------------- .../compose/ozonescripts/.ssh/authorized_keys | 16 ++++++++ .../src/main/compose/ozonescripts/.ssh/config | 18 +++++++++ .../main/compose/ozonescripts/.ssh/environment | 16 ++++++++ .../src/main/compose/ozonescripts/.ssh/id_rsa | 42 ++++++++++++++++++++ .../main/compose/ozonescripts/.ssh/id_rsa.pub | 16 ++++++++ .../src/main/compose/ozonescripts/Dockerfile | 33 +++++++++++++++ .../src/main/compose/ozonescripts/README.md | 38 ++++++++++++++++++ .../compose/ozonescripts/docker-compose.yaml | 42 ++++++++++++++++++++ .../src/main/compose/ozonescripts/docker-config | 37 +++++++++++++++++ hadoop-dist/src/main/compose/ozonescripts/ps.sh | 17 ++++++++ .../src/main/compose/ozonescripts/start.sh | 24 +++++++++++ .../src/main/compose/ozonescripts/stop.sh | 17 ++++++++ hadoop-ozone/common/src/main/bin/start-ozone.sh | 0 hadoop-ozone/common/src/main/bin/stop-ozone.sh | 16 ++++---- 14 files changed, 325 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/.ssh/authorized_keys ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/.ssh/authorized_keys b/hadoop-dist/src/main/compose/ozonescripts/.ssh/authorized_keys new file mode 100644 index 0000000..ae39052 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/.ssh/authorized_keys @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgEmLpYm4BrWtq1KG9hhZXCZgGrETntu0eNTo21U3VKc9nH9/ot7M6lAawsFcT9uXu4b58PTlnfvwH/TATlCFjC8n0Z7SOx+FU6L3Sn8URh9HaX4L0tF8u87oCAD4dBrUGhhB36eiuH9dBBWly6RKffYJvrjatbc7GxBO/e5OSUMtqk/DSVKksmBhZxutrKivCNjDish9ViGIf8b5yS/MlEGmaVKApik1fJ5iOlloM/GgpB60YV/hbqfCecbWgeiM1gK92gdOcA/Wx1C7fj8BSI5iDSE6eZeF80gM3421lvyPDWyVhFaGbka4rXBX/fb9QSRBA9RTqhRKAEmAIf49H hadoop@cdae967fa87a http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/.ssh/config ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/.ssh/config b/hadoop-dist/src/main/compose/ozonescripts/.ssh/config new file mode 100644 index 0000000..6506916 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/.ssh/config @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +Host * + UserKnownHostsFile /dev/null + StrictHostKeyChecking no http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/.ssh/environment ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/.ssh/environment b/hadoop-dist/src/main/compose/ozonescripts/.ssh/environment new file mode 100644 index 0000000..5685453 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/.ssh/environment @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/ http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa b/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa new file mode 100644 index 0000000..6632ce5 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEA4BJi6WJuAa1ratShvYYWVwmYBqxE57btHjU6NtVN1SnPZx/f +6LezOpQGsLBXE/bl7uG+fD05Z378B/0wE5QhYwvJ9Ge0jsfhVOi90p/FEYfR2l+C +9LRfLvO6AgA+HQa1BoYQd+norh/XQQVpcukSn32Cb642rW3OxsQTv3uTklDLapPw +0lSpLJgYWcbrayorwjYw4rIfVYhiH/G+ckvzJRBpmlSgKYpNXyeYjpZaDPxoKQet +GFf4W6nwnnG1oHojNYCvdoHTnAP1sdQu34/AUiOYg0hOnmXhfNIDN+NtZb8jw1sl +YRWhm5GuK1wV/32/UEkQQPUU6oUSgBJgCH+PRwIDAQABAoIBAQDI1TH6ZNKchkck +9XgSWsBjOqIcOQN5fCeDT8nho8WjLVpL3/Hcr+ngsxRcAXHK3xyvw33r9SQic1qJ +/pC8u6RBFivo95qJ7vU0GXcp9TG4yLd6tui1U4WMm784U+dYNM7EDh1snSaECt3v +1V3yNJ0QfnoOh2NShn0zAkOA+M4H8Nx2SudMCsjcbK9+fYxzW3hX+sJpMKdjG1HW +DUz+I7cW7t0EGaVrgVSV+eR58LiXu+14YDNMrySiejB4nD2sKrx93XgiCBECCsBN +GLQGJCztaXoAY+5Kf/aJ9EEf2wBF3GecRk+XIAd87PeDmeahLQAVkAJ/rD1vsKFs +8kWi6CrhAoGBAP7leG/dMBhlfvROpBddIfWm2i8B+oZiAlSjdYGz+/ZhUaByXk18 +pupMGiiMQR1ziPnEg0gNgR2ZkH54qrXPn5WcQa4rlSEtUsZEp5v5WblhfX2QwKzY +G/uhA+mB7wXpQkSmXo0LclfPF2teROQrG1OyfWkWbxFH4i3+em7sL95jAoGBAOEK +v+wscqkMLW7Q8ONbWMCCBlmMHr6baB3VDCYZx25lr+GIF5zmJJFTmF2rq2VSAlts +qx1AGmaUSo78kC5FuJvSNTL6a1Us5ucdthQZM3N8pAz+OAE+QEU+BsdA27yAh3tO +yKDsMFNHKtXcgy5LeB5gzENLlNyw2jgkRv2Ef77NAoGAVH8DHqoHEH9Mx3XuRWR1 +JnaqKx0PzE5fEWmiQV3Fr5XxNivTgQJKXq7dmQVtbHLpPErdbhwz6fkHAjXD+UMb +VsAWscL2y6m3n8wQd87/5EkiDWbXyDRXimGE53pQHviFJDa2bzEVNXCMBeaZFb4I +cAViN1zdcrAOlUqfkXewIpsCgYB8wsXl/DpRB+RENGfn0+OfTjaQ/IKq72NIbq1+ +jfondQ6N/TICFQEe5HZrL9okoNOXteYjoD9CsWGoZdLVJGgVUvOVYImSvgMBDFK+ +T75bfzU/0sxfvBBLkviVDJsFpUf3D5VgybB86s6Po+HCD6r3RHjZshRESXOhflMx +B3z+3QKBgE2Lwo0DuwUGkm6k8psyn3x8EiXNsiNw12cojicFTyKUYLHxMBeVbCLW +3j3pxSggJgRuBLLzixUHbHp91r2ARTy28naK7R/la8yKVqK6ojcikN2mQsCHYtwB +nuFwXr42ytn6G+9Wn4xT64tGjRCqyZn0/v0XsPjVCyrZ6G7EtNHP +-----END RSA PRIVATE KEY----- http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa.pub ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa.pub b/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa.pub new file mode 100644 index 0000000..ae39052 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/.ssh/id_rsa.pub @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgEmLpYm4BrWtq1KG9hhZXCZgGrETntu0eNTo21U3VKc9nH9/ot7M6lAawsFcT9uXu4b58PTlnfvwH/TATlCFjC8n0Z7SOx+FU6L3Sn8URh9HaX4L0tF8u87oCAD4dBrUGhhB36eiuH9dBBWly6RKffYJvrjatbc7GxBO/e5OSUMtqk/DSVKksmBhZxutrKivCNjDish9ViGIf8b5yS/MlEGmaVKApik1fJ5iOlloM/GgpB60YV/hbqfCecbWgeiM1gK92gdOcA/Wx1C7fj8BSI5iDSE6eZeF80gM3421lvyPDWyVhFaGbka4rXBX/fb9QSRBA9RTqhRKAEmAIf49H hadoop@cdae967fa87a http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/Dockerfile ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/Dockerfile b/hadoop-dist/src/main/compose/ozonescripts/Dockerfile new file mode 100644 index 0000000..3bdcb0c --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/Dockerfile @@ -0,0 +1,33 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +FROM apache/hadoop-runner +RUN sudo apt-get update && sudo apt-get install -y openssh-server + +RUN sudo mkdir -p /run/sshd +RUN sudo sed -i "s/.*UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config +RUN sudo sed -i "s/.*PermitUserEnvironment.*/PermitUserEnvironment yes/g" /etc/ssh/sshd_config +RUN sudo sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd + +#/opt/hadoop is mounted, we can't use it as a home +RUN sudo usermod -d /opt hadoop +ADD .ssh /opt/.ssh +RUN sudo chown -R hadoop /opt/.ssh +RUN sudo chown hadoop /opt +RUN sudo chmod 600 /opt/.ssh/* +RUN sudo chmod 700 /opt/.ssh + +RUN sudo sh -c 'echo "export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/" >> /etc/profile' +CMD ["sudo","/usr/sbin/sshd","-D"] http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/README.md ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/README.md b/hadoop-dist/src/main/compose/ozonescripts/README.md new file mode 100644 index 0000000..2531fa4 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/README.md @@ -0,0 +1,38 @@ +<!--- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +# start-ozone environment + +This is an example environment to use/test `./sbin/start-ozone.sh` and `./sbin/stop-ozone.sh` scripts. + +There are ssh connections between the containers and the start/stop scripts could handle the start/stop process +similar to a real cluster. + +To use it, first start the cluster: + +``` +docker-copmose up -d +``` + +After a successfull startup (which starts only the ssh daemons) you can start ozone: + +``` +./start.sh +``` + +Check it the java processes are started: + +``` +./ps.sh +``` \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/docker-compose.yaml ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/docker-compose.yaml b/hadoop-dist/src/main/compose/ozonescripts/docker-compose.yaml new file mode 100644 index 0000000..62f1163 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/docker-compose.yaml @@ -0,0 +1,42 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: "3" +services: + datanode: + build: . + volumes: + - ../..:/opt/hadoop + ports: + - 9864 + env_file: + - ./docker-config + om: + build: . + volumes: + - ../..:/opt/hadoop + ports: + - 9874:9874 + env_file: + - ./docker-config + scm: + build: . + volumes: + - ../..:/opt/hadoop + ports: + - 9876:9876 + env_file: + - ./docker-config http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/docker-config ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/docker-config b/hadoop-dist/src/main/compose/ozonescripts/docker-config new file mode 100644 index 0000000..7a962ba --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/docker-config @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/ +CORE-SITE.XML_fs.defaultFS=hdfs://namenode:9000 +OZONE-SITE.XML_ozone.ksm.address=ksm +OZONE-SITE.XML_ozone.scm.names=scm +OZONE-SITE.XML_ozone.enabled=true +OZONE-SITE.XML_ozone.scm.datanode.id=/data/datanode.id +OZONE-SITE.XML_ozone.om.address=om +OZONE-SITE.XML_ozone.scm.block.client.address=scm +OZONE-SITE.XML_ozone.metadata.dirs=/data/metadata +OZONE-SITE.XML_ozone.scm.client.address=scm +OZONE-SITE.XML_hdds.datanode.plugins=org.apache.hadoop.ozone.web.OzoneHddsDatanodeService +HDFS-SITE.XML_dfs.namenode.rpc-address=namenode:9000 +HDFS-SITE.XML_dfs.namenode.name.dir=/data/namenode +HDFS-SITE.XML_rpc.metrics.quantile.enable=true +HDFS-SITE.XML_rpc.metrics.percentiles.intervals=60,300 +HDFS-SITE.XML_dfs.datanode.plugins=org.apache.hadoop.ozone.HddsDatanodeService +LOG4J.PROPERTIES_log4j.rootLogger=INFO, stdout +LOG4J.PROPERTIES_log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR, stdout +LOG4J.PROPERTIES_log4j.appender.stdout=org.apache.log4j.ConsoleAppender +LOG4J.PROPERTIES_log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +LOG4J.PROPERTIES_log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/ps.sh ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/ps.sh b/hadoop-dist/src/main/compose/ozonescripts/ps.sh new file mode 100755 index 0000000..d5e2c38 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/ps.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker-compose ps -q | xargs -n1 -I CONTAINER docker exec CONTAINER ps xa \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/start.sh ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/start.sh b/hadoop-dist/src/main/compose/ozonescripts/start.sh new file mode 100755 index 0000000..3358b07 --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/start.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker-compose ps | grep datanode | awk '{print $1}' | xargs -n1 docker inspect --format '{{ .Config.Hostname }}' > ../../etc/hadoop/workers +docker-compose exec scm /opt/hadoop/bin/ozone scm -init +docker-compose exec scm /opt/hadoop/sbin/start-ozone.sh +#We need a running SCM for om objectstore creation +#TODO create a utility to wait for the startup +sleep 10 +docker-compose exec om /opt/hadoop/bin/ozone om -createObjectStore +docker-compose exec scm /opt/hadoop/sbin/start-ozone.sh http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-dist/src/main/compose/ozonescripts/stop.sh ---------------------------------------------------------------------- diff --git a/hadoop-dist/src/main/compose/ozonescripts/stop.sh b/hadoop-dist/src/main/compose/ozonescripts/stop.sh new file mode 100755 index 0000000..a3ce08a --- /dev/null +++ b/hadoop-dist/src/main/compose/ozonescripts/stop.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker-compose exec scm /opt/hadoop/sbin/stop-ozone.sh http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-ozone/common/src/main/bin/start-ozone.sh ---------------------------------------------------------------------- diff --git a/hadoop-ozone/common/src/main/bin/start-ozone.sh b/hadoop-ozone/common/src/main/bin/start-ozone.sh old mode 100644 new mode 100755 http://git-wip-us.apache.org/repos/asf/hadoop/blob/22c318ee/hadoop-ozone/common/src/main/bin/stop-ozone.sh ---------------------------------------------------------------------- diff --git a/hadoop-ozone/common/src/main/bin/stop-ozone.sh b/hadoop-ozone/common/src/main/bin/stop-ozone.sh old mode 100644 new mode 100755 index 4321441..97e1df4 --- a/hadoop-ozone/common/src/main/bin/stop-ozone.sh +++ b/hadoop-ozone/common/src/main/bin/stop-ozone.sh @@ -64,13 +64,15 @@ if [[ "${OZONE_ENABLED}" != "true" ]]; then fi #--------------------------------------------------------- -# Start hdfs before starting ozone daemons -if [[ -f "${bin}/stop-dfs.sh" ]]; then - "${bin}/stop-dfs.sh" -else - echo "ERROR: Cannot execute ${bin}/stop-dfs.sh." 2>&1 - exit 1 -fi +# datanodes (using default workers file) + +echo "Stopping datanodes" + +hadoop_uservar_su ozone datanode "${HADOOP_HDFS_HOME}/bin/ozone" \ + --workers \ + --config "${HADOOP_CONF_DIR}" \ + --daemon stop \ + datanode #--------------------------------------------------------- # Ozone Manager nodes --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
