From 846848ac4c18175053987416e14533c2a7f76500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Tue, 6 Aug 2019 10:04:02 +0200 Subject: [PATCH] HDDS-1914. Ozonescript example docker-compose cluster can't be started Signed-off-by: Anu Engineer --- .../dist/src/main/compose/ozonescripts/.ssh/environment | 2 +- hadoop-ozone/dist/src/main/compose/ozonescripts/Dockerfile | 5 +++-- .../dist/src/main/compose/ozonescripts/docker-config | 3 +-- hadoop-ozone/dist/src/main/compose/ozonescripts/start.sh | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hadoop-ozone/dist/src/main/compose/ozonescripts/.ssh/environment b/hadoop-ozone/dist/src/main/compose/ozonescripts/.ssh/environment index 5685453be12..cbde0f2078d 100644 --- a/hadoop-ozone/dist/src/main/compose/ozonescripts/.ssh/environment +++ b/hadoop-ozone/dist/src/main/compose/ozonescripts/.ssh/environment @@ -13,4 +13,4 @@ # 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/ +JAVA_HOME=/usr/lib/jvm/jre diff --git a/hadoop-ozone/dist/src/main/compose/ozonescripts/Dockerfile b/hadoop-ozone/dist/src/main/compose/ozonescripts/Dockerfile index 2741eb00241..b07800053b2 100644 --- a/hadoop-ozone/dist/src/main/compose/ozonescripts/Dockerfile +++ b/hadoop-ozone/dist/src/main/compose/ozonescripts/Dockerfile @@ -14,8 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. FROM apache/ozone-runner -RUN sudo apt-get update && sudo apt-get install -y openssh-server +RUN sudo yum install -y openssh-clients openssh-server +RUN sudo ssh-keygen -A 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 @@ -29,5 +30,5 @@ 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' +RUN sudo sh -c 'echo "export JAVA_HOME=/usr/lib/jvm/jre/" >> /etc/profile' CMD ["sudo","/usr/sbin/sshd","-D"] diff --git a/hadoop-ozone/dist/src/main/compose/ozonescripts/docker-config b/hadoop-ozone/dist/src/main/compose/ozonescripts/docker-config index 3c99cd7afb6..4e67a044b01 100644 --- a/hadoop-ozone/dist/src/main/compose/ozonescripts/docker-config +++ b/hadoop-ozone/dist/src/main/compose/ozonescripts/docker-config @@ -14,7 +14,6 @@ # 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 @@ -37,4 +36,4 @@ 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 +LOG4J.PROPERTIES_log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n diff --git a/hadoop-ozone/dist/src/main/compose/ozonescripts/start.sh b/hadoop-ozone/dist/src/main/compose/ozonescripts/start.sh index 9540eb95f72..49fc506ca29 100755 --- a/hadoop-ozone/dist/src/main/compose/ozonescripts/start.sh +++ b/hadoop-ozone/dist/src/main/compose/ozonescripts/start.sh @@ -14,7 +14,9 @@ # 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. +set -x docker-compose ps | grep datanode | awk '{print $1}' | xargs -n1 docker inspect --format '{{ .Config.Hostname }}' > ../../etc/hadoop/workers +docker-compose ps | grep ozonescripts | awk '{print $1}' | xargs -I CONTAINER -n1 docker exec CONTAINER cp /opt/hadoop/etc/hadoop/workers /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