Ambari 2.2 - 在Ubuntu 14.04多克尔容器非零状态code退出 [英] Ambari 2.2 - exiting with non-zero status code on Ubuntu 14.04 Docker container

查看:589
本文介绍了Ambari 2.2 - 在Ubuntu 14.04多克尔容器非零状态code退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR - Dockerized Ambari在Ubuntu 14.04泊坞窗容器在启动时使用默认配置会抛出错误

TL;DR - Dockerized Ambari on Ubuntu 14.04 Docker container throws error upon startup with default configurations

我试图Dockerize的Ambari部署以支持运行它的旁边我Hadoop的容器。这里是我的Dockerfile:

I'm attempting to Dockerize an Ambari deployment to support running it along side my Hadoop containers. Here is my Dockerfile:

FROM ubuntu:14.04

ENV AMBARI_HOME /opt/ambari
ENV AMBARI_VERSION 2.2.0.0

RUN export DEBIAN_FRONTEND=noninteractive \
    && apt-get update \
    && apt-get -y install wget software-properties-common python-software-properties openssh-client openssh-server

# Install Java.
RUN \
  echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
  add-apt-repository -y ppa:webupd8team/java && \
  apt-get update && \
  apt-get install -y oracle-java8-installer && \
  rm -rf /var/lib/apt/lists/* && \
  rm -rf /var/cache/oracle-jdk8-installer

# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

RUN mkdir -p "$AMBARI_HOME"
WORKDIR $AMBARI_HOME

# passwordless ssh
RUN export DEBIAN_FRONTEND=noninteractive \
    && echo -e 'y\n'|ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa \
    && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys

RUN export DEBIAN_FRONTEND=noninteractive \
    && wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.0.0/ambari.list -O /etc/apt/sources.list.d/ambari.list \
    && apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD \
    && apt-get update \
    && apt-get -y install ambari-server

#Disable SELinux
RUN echo SELINUX=disabled >> /etc/selinux/config

EXPOSE 8080

RUN ambari-server setup -s --verbose --java-home $JAVA_HOME
CMD ambari-server start

当我启动容器我碰到下面的错误 -

When I start the container I get the following error -

Using python  /usr/bin/python2
Starting ambari-server
Ambari Server running with administrator privileges.
About to start PostgreSQL
Organizing resource files at /var/lib/ambari-server/resources...
WARNING: setpgid(73, 0) failed - [Errno 13] Permission denied
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start.........
ERROR: Exiting with exit code -1.
REASON: Ambari Server java process died with exitcode -1. Check /var/log/ambari-server/ambari-server.out for more information.

似乎没有要在ambari-server.log的或.OUT

There doesn't seem to be anything useful in the ambari-server.log or .out

我发现了一个问题,为警告:setpgid(73,0)失败 - [错误13]许可被拒绝在这里固定:的 setpgid问题

I found an issue for WARNING: setpgid(73, 0) failed - [Errno 13] Permission denied fixed here: setpgid issue

从阅读HortonWorks文档部署到Ubuntu 14.04,这应该工作:

From reading the HortonWorks docs for deploying to Ubuntu 14.04, this should work:

<一个href=\"http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.0.0/bk_Installing_HDP_AMB/content/_download_the_ambari_repo_ubuntu14.html\"相对=nofollow>在Ubuntu上安装Ambari 14.04

我试图与嵌入式Postges部署,以及一个外部具有相同的结果。

I've tried to deploy with the embedded Postges as well as an external one with the same results.

一个有趣的注意的是,即使有错误,Ambari似乎是了,我可以登录为默认的admin /管理员,但是打电话时`ambari服务器一站式'它说没有进程正在运行...

One interesting note is that even with the error, Ambari appears to be up and I can login as the default admin/admin, but when calling `ambari-server stop' it says no process is running...

root@3e6d778b43f8:/opt/ambari# ambari-server stop
Using python  /usr/bin/python2
Stopping ambari-server
Ambari Server is not running
root@3e6d778b43f8:/opt/ambari# jps
868 AmbariServer
955 Jps

我会在我的Ubuntu盒明天复制此设置,看看同样的事情发生。

I'll replicate this setup on my Ubuntu box tomorrow and see if the same thing happens.

谢谢!

编辑#1:泊坞窗信息

vagrant@vagrant-ubuntu-trusty-64:/vagrant/scripts$ docker info
Containers: 14
Images: 161
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 189
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-44-generic
Operating System: Ubuntu 14.04.1 LTS
CPUs: 1
Total Memory: 3.861 GiB
Name: vagrant-ubuntu-trusty-64
ID: 7AD6:Z5TH:76NW:G54B:IHVK:PWKP:E2LI:CRPI:MIGM:STJU:3D2B:K7EQ
WARNING: No swap limit support

vagrant@vagrant-ubuntu-trusty-64:/vagrant/scripts$ docker version
Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:12:04 UTC 2015
 OS/Arch:      linux/amd64

泊坞窗是一个流浪VirtualBox虚拟实例中运行(V1.8.1)

docker is running inside of a Vagrant Virtualbox instance (v1.8.1)

推荐答案

我曾与内部在Ubuntu 14.04泊坞窗ambari服务器同样的问题。你可以尝试以下

I had same problem with ambari-server inside docker on ubuntu 14.04. Could you try the following

里面的/ etc /默认/泊坞窗添加

Inside /etc/default/docker add

DOCKER_OPTS = - 存储驱动程序= devicemapper

和重启泊坞窗服务。需要注意的是在此之后所有的图像将消失(的http:// muehe。组织/职位/切换 - 泊坞窗 - 从 - AUFS到devicemapper / )。重建图像。

and restart the docker service. Note that after this all your images will disappear (http://muehe.org/posts/switching-docker-from-aufs-to-devicemapper/). Rebuild your images.

说实话我不是100%肯定,如果确实需要这一部分。

To be honest I'm not 100% sure if this part is really needed.

从AUFS切换后devicemapper您可能会收到以下错误:

After switching from aufs to devicemapper you might get the following error:

错误:实体ID 找不到容器

解决的办法是删除旧的AUFS db和任何现有的容器:

The solution was to remove the old AUFS db and any existing containers:

sudo rm -rf /var/lib/docker/containers/*
sudo rm -rf /var/lib/docker/linkgraph.db

重新启动您的码头工人,图像/容器现在应该在devicemapper发动机的正常工作。

Restarting your docker images/containers should now work on the devicemapper engine.

/etc/apparmor.d/docker 注释掉(#)行否认@ {PROC} / {*,** ^ [ 0-9 *],SYS /内核/ SHM * WKX} ,它在某种程度上混淆了AppArmor的utils的。不是运行

Inside /etc/apparmor.d/docker comment out (#) line deny @{PROC}/{*,**^[0-9*],sys/kernel/shm*} wkx,, it somehow confuses apparmor utils. Than run

sudo的AA-抱怨/etc/apparmor.d/docker

如果AA-抱怨罚球找不到命令,安装:

If aa-complain throws command not found, install:

sudo apt-get install apparmor-utils

开始后容器ambari服务器开始为我工作。

After starting the container ambari-server started working for me.

我不知道怎么泊坞窗依托这里的AppArmor,即什么样的风险上面的操作引入...

I dont know how docker relies here on apparmor, i.e. what risks the operation above introduces...

这篇关于Ambari 2.2 - 在Ubuntu 14.04多克尔容器非零状态code退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆