546773 (2) [Avatar] Offline
Hi all,I am new Elasticsearch. I'm trying to build a Docker container running elasticsearch v2 using this dockerfile (I'm using RHEL 6 and docker 1.7.1):

ENV DEBIAN_FRONTEND noninteractive
ENV PATH=$PATH:/usr/share/elasticsearch/bin

RUN wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add - && \
    echo 'deb http://packages.elasticsearch.org/elasticsearch/2.x/debian stable main' \
      | tee /etc/apt/sources.list.d/elasticsearch.list && \
    apt-get update && \
    apt-get install --no-install-recommends -y elasticsearch && \
    /usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /usr/share/elasticsearch

RUN set -ex \
  && for path in \
  ./data \
    ./logs \
    ./config \
    ./config/scripts \
  ; do \
    mkdir -p "$path"; \
    chown -R elasticsearch:elasticsearch "$path"; \

COPY ./config /usr/share/elasticsearch/config

USER elasticsearch

VOLUME ["/usr/share/elasticsearch"]

EXPOSE 9200 9300

CMD ["elasticsearch"]

I also pulled the prebuilt image using:

docker pull partlab/ubuntu-elasticsearch

But unfortunately every time I use the following docker run command the container exits:

docker run -d -p 9200:9200 -p 9300:9300 --net=bridge --name elastic_container -v /home/my_project/elastic_data

or this one:
docker run -d -p 9200:9200 -p 9300:9300 --net=bridge --name elastic_container partlab/ubuntu-elasticsearch

Here is the result of docker logs:

[2017-08-28 10:54:16,087][WARN ][bootstrap                ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP no
t compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
Exception in thread "main" java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data/elasticsearc
Likely root cause: java.nio.file.FileSystemException: /usr/share/elasticsearch/data/elasticsearch: No space left on device
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
        at java.nio.file.Files.createDirectory(Files.java:674)
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
        at java.nio.file.Files.createDirectories(Files.java:767)
        at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:337)
        at org.elasticsearch.bootstrap.Security.addPath(Security.java:314)
        at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:259)
        at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:212)
        at org.elasticsearch.bootstrap.Security.configure(Security.java:118)
        at org.elasticsearch.bootstrap.Bootstrap.setupSecurity(Bootstrap.java:196)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
When I build the same image on my mac using docker 17.6 it works flawlessly.

Storage space using df -h on my system session:

Filesystem            Size  Used Avail Use% Mounted on
                       99G   96G     0 100% /
tmpfs                  32G  1.2M   32G   1% /dev/shm
/dev/sda1             477M   67M  385M  15% /boot
                      886G  105G  737G  13% /home
cm_processes           32G   38M   32G   1% /var/run/cloudera-scm-agent/process
Storage space using df -h in a ubuntu container:

Filesystem                                                      Size  Used Avail Use% Mounted on
/dev/mapper/docker-253:0-967159-ac79433eebd0c389290f....        9.8G  7.7G  1.6G  84% /
tmpfs                                                           32G     0   32G   0% /dev
shm                                                             64M     0   64M   0% /dev/shm
/dev/mapper/vg_lptdlp01-lv_root                                 99G   96G     0 100% /etc/ho

Peter Fisher (8) [Avatar] Offline
Hi, Elastic search is little outside of the scope of the course but it looks to me like a problem with a file path
Unable to access 'path.data' (/usr/share/elasticsearch/data/elasticsearc

I recommend trying to mount /usr/share/elasticsearch/data/elasticsearch as a Docker volume

It might be easy to do this from a Docker compose file