ambari 2.2-在ubuntu14.04 docker容器上以非零状态代码退出

fcg9iug3  于 2021-05-29  发布在  Hadoop
关注(0)|答案(2)|浏览(369)

热释光;dr-Ubuntu14.04 docker容器上DockedAmbari在默认配置下启动时抛出错误
我正在尝试停靠ambari部署,以支持在hadoop容器旁边运行它。这是我的文件:

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

启动容器时,出现以下错误-

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中似乎没有任何有用的内容
我发现了一个问题 WARNING: setpgid(73, 0) failed - [Errno 13] Permission denied 此处修复:setpgid问题
阅读hortonworks文档以部署到Ubuntu14.04,应该可以:
在ubuntu 14.04上安装ambari
我试着用嵌入的postges和外部postges进行部署,结果是一样的。
一个有趣的注意事项是,即使出现了错误,ambari似乎已启动,我可以作为默认的admin/admin登录,但当调用'ambari server stop'时,它表示没有进程正在运行。。。

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盒子上复制这个设置,看看是否会发生同样的事情。
谢谢!
编辑#1: docker info ```
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

docker正在一个流浪的virtualbox示例中运行(v1.8.1)
wecizke3

wecizke31#

似乎在将ambari部署到docker容器时出现问题。。我破解了它,并用以下脚本将它安装到一个流浪的14.04 ubuntu虚拟机上:
安装java.sh


# !/bin/bash

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

安装\u ambari.sh


# !/bin/bash

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

然后:
sudo ambari-server setup -s -v -j $JAVA_HOME sudo ambari-server start -v @thajeztah-dockerfile设置需要修复什么?

fjnneemd

fjnneemd2#

我在ubuntu14.04上的docker内部的ambari服务器也有同样的问题。你能试试下面的吗

解决aufs问题

内部/etc/default/docker add DOCKER_OPTS="--storage-driver=devicemapper" 并重新启动docker服务。请注意,在此之后,所有的图像将消失(http://muehe.org/posts/switching-docker-from-aufs-to-devicemapper/). 重建图像。
老实说,我不是100%确定这部分是否真的需要。
从aufs切换到devicemapper后,可能会出现以下错误:
错误:找不到实体id的容器
解决方案是移除旧的aufs db和任何现有容器:

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

重新启动docker图像/容器现在应该可以在devicemapper引擎上工作。

将apparmor置于docker的投诉模式

内部 /etc/apparmor.d/docker 注解(#)行 deny @{PROC}/{*,**^[0-9*],sys/kernel/shm*} wkx, 不知怎的,它混淆了 Jmeter 。而不是跑 sudo aa-complain /etc/apparmor.d/docker 如果未找到命令,请安装:

sudo apt-get install apparmor-utils

启动容器后,ambari服务器开始为我工作。
我不知道docker是如何依赖apparmor的,也就是说,上面的操作会带来什么风险。。。

相关问题