From 3a476285b6f9fd8680e9e7feb696b47ccca196b7 Mon Sep 17 00:00:00 2001 From: kev Date: Mon, 30 Sep 2019 07:58:46 +0800 Subject: [PATCH] fix ambari --- ambari/Dockerfile | 7 +++++-- ambari/README.md | 16 +++++++--------- ambari/docker-compose.yml | 3 ++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ambari/Dockerfile b/ambari/Dockerfile index c3f93e2..5131621 100644 --- a/ambari/Dockerfile +++ b/ambari/Dockerfile @@ -11,7 +11,7 @@ ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 RUN set -xe \ && apt-get update \ - && apt-get install -y curl gnupg libpostgresql-jdbc-java openjdk-8-jdk \ + && apt-get install -y curl gnupg libpostgresql-jdbc-java openjdk-8-jdk openssh-client \ && curl -sSL ${AMBARI_SOURCE} > /etc/apt/sources.list.d/ambari.list \ && apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD \ && apt-get update \ @@ -23,4 +23,7 @@ VOLUME /etc/ambari-server/conf EXPOSE 8080 -CMD ["sleep", "inf"] +CMD set -ex \ + && ambari-server start \ + && sleep 5 \ + && tail --pid=$(cat /var/run/ambari-server/ambari-server.pid) -f /var/log/ambari-server/ambari-server.log diff --git a/ambari/README.md b/ambari/README.md index 60e7e2f..26add99 100644 --- a/ambari/README.md +++ b/ambari/README.md @@ -3,17 +3,15 @@ ambari The [Apache Ambari][1] project is aimed at making Hadoop management simpler by developing software for provisioning, managing, and monitoring Apache Hadoop -clusters. Ambari provides an intuitive, easy-to-use Hadoop management web UI +clusters. [Ambari][2] provides an intuitive, easy-to-use Hadoop management web UI backed by its RESTful APIs. -Make sure that ambari-server is reachable by ambari-agents. +Make sure that ambari-server is reachable by ambari-agents via DNS. ## Up and Running ```bash -$ docker-compose up -d - -$ docker-compose exec ambari bash +$ docker-compose run --rm server bash >>> ambari-server setup Customize user account for ambari-server daemon [y/n] (n)? Do you want to change Oracle JDK [y/n] (n)? @@ -30,12 +28,12 @@ Proceed with configuring remote database connection properties [y/n] (y)? CREATE TABLE ... CREATE INDEX ... -$ docker-compose exec ambari ambari-server start -Waiting for server start........................ -Server started listening on 8080 -Ambari Server 'start' completed successfully. +$ docker-compose up -d +Starting ambari_postgres_1 ... done +Starting ambari_server_1 ... done $ curl http://localhost:8080/ ``` [1]: https://ambari.apache.org/ +[2]: https://docs.cloudera.com/HDPDocuments/Ambari/Ambari-2.7.4.0/index.html diff --git a/ambari/docker-compose.yml b/ambari/docker-compose.yml index 837041e..535c064 100644 --- a/ambari/docker-compose.yml +++ b/ambari/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.7" services: - ambari: + server: image: vimagick/ambari hostname: ambari-server ports: @@ -11,6 +11,7 @@ services: - "8441:8441" volumes: - ./data/ambari:/etc/ambari-server/conf + - ./data/log:/var/log/ambari-server extra_hosts: - ambari-agent1:172.16.1.101 - ambari-agent2:172.16.1.102