elasticsearch - Docker centos7 systemctl deos无法正常工作:无法连接D-bus

标签 elasticsearch docker dbus systemctl

我正在尝试在docker上运行elasticsearch。

我的功能如下

  • 主机系统:OSX 10.12.5
  • docker :17.05.0-ce
  • docker 操作镜像:centos:latest

  • 我正在关注this article,但它与systemctl daemon-reload保持一致。

    我发现有关此D-bus错误的CentOS official respond,但是当我运行docker run命令时,它显示以下消息。 [!!!!!!] Failed to mount API filesystems, freezing.
    我该如何解决这个问题?

    仅供引用,这是Dockerfile我构建的图像
    FROM centos
    MAINTAINER juneyoung <juneyoung@hanmail.net>
    
    ARG u=elastic
    ARG uid=1000
    ARG g=elastic
    ARG gid=1000
    ARG p=elastic
    
    # add USER
    RUN groupadd -g ${gid} ${g}
    RUN useradd -d /home/${u} -u ${uid} -g ${g} -s /bin/bash ${u}
    
    
    # systemctl settings from official Centos github
    # https://github.com/docker-library/docs/tree/master/centos#systemd-integration
    ENV container docker
    RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
    systemd-tmpfiles-setup.service ] || rm -f $i; done); \
    rm -f /lib/systemd/system/multi-user.target.wants/*;\
    rm -f /etc/systemd/system/*.wants/*;\
    rm -f /lib/systemd/system/local-fs.target.wants/*; \
    rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
    rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
    rm -f /lib/systemd/system/basic.target.wants/*;\
    rm -f /lib/systemd/system/anaconda.target.wants/*;
    VOLUME [ "/sys/fs/cgroup" ]
    
    
    
    # yum settings
    RUN yum -y update
    RUN yum -y install java-1.8.0-openjdk.x86_64
    ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/jre/
    
    # install wget
    RUN yum install -y wget
    
    # install net-tools : netstat, ifconfig
    RUN yum install -y net-tools
    
    # Elasticsearch install
    ENV ELASTIC_VERSION=5.4.0
    RUN rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
    RUN wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTIC_VERSION}.rpm
    RUN rpm -ivh elasticsearch-${ELASTIC_VERSION}.rpm
    
    
    CMD ["/usr/sbin/init"]
    

    我已经跑了命令
    docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name=elastic2 elastic2

    最佳答案

    首先,感谢@Robert。
    我不这么认为。

    我所要做的只是编辑CMD命令。

    更改为 CMD["elasticsearch"]
    但是,必须做些杂事才能从浏览器访问。
    请参阅this elasticsearch forum post

    关于elasticsearch - Docker centos7 systemctl deos无法正常工作:无法连接D-bus,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44319195/

    相关文章:

    mysql - elasticsearch jdbc导入数据包含json

    docker - 使用 docker Push 到私有(private)注册表(Heroku 注册表)时出现 401 错误

    elasticsearch - Elasticsearch 模糊查询意外结果

    elasticsearch - elasticsearch每周平均需要一些值

    Docker 容器中的 MySQL 绑定(bind)地址

    proxy - 如何让我的所有 docker 容器都使用我的代理?

    python - 使用 pygobject 编写 D-Bus 服务?

    linux - C 中的 D-Bus 教程与 wpa_supplicant 通信

    c - 如何正确编译和链接 gdbus 程序

    maven - Apache Flink 1.3 中的 Elasticsearch 5 连接器