Skip to content

Instantly share code, notes, and snippets.

@megastef
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save megastef/11229896 to your computer and use it in GitHub Desktop.
Save megastef/11229896 to your computer and use it in GitHub Desktop.
Install crate on docker container
docker pull debian
#docker build -t crate-data-node - < crate-data.docker
# if you put dockerfile named "Dockerfile" in a src directory
# I had to do it to get crate.yml config file copied by ADD statement
docker build -t crate-data-node .
# localport:docker-exposed-port
# local dir for data - in exa,ple /tmp as /var/crate-data
docker run -p 5000:4200/tcp -v /tmp:/var/crate-data crate-data-node &
docker ps
# check port
docker port crate-data-node 4200
path.data = /var/crate-data
cluster.name = megastef
# CRATE-DATA Node
# Dockerfile
# VERSION 1.0
# use the debian base image provided by dotCloud
FROM debian
MAINTAINER Stefan Thies, s.thies@bigdata-analyst.de
# make sure the package repository is up to date
RUN apt-get update -y
RUN apt-get install apt-utils -y
# install curl,wget,java
RUN apt-get install curl -y
RUN apt-get install wget -y
RUN apt-get install openjdk-7-jre-headless -y
RUN wget https://cdn.crate.io/downloads/releases/crate-0.35.6.tar.gz
RUN tar zxf crate-*.tar.gz -C /opt
# copy local config to build container, e.g. setup clustername
ADD crate.yml /opt/crate-0.35.6/config/crate.yml
RUN chown -R daemon /opt/crate-0.35.6/
RUN true
# Launch CRATE when launching the container
ENTRYPOINT ["/opt/crate-0.35.6/bin/crate"]
WORKDIR /opt/crate-0.35.6
# run CRATE as the daemon user
USER daemon
VOLUMES
# expose CRATE port
EXPOSE 4200
EXPOSE 4300
docker pull busybox
nano data.docker
# insert this:
# BUILD-USING: docker build -t data .
# RUN-USING: docker run -name DATA data
FROM busybox
VOLUME ["/var/crate-data"]
CMD ["/bin/true"]
docker build -t data - < data.docker
@megastef
Copy link
Author

Use IP address from the ~/dvm/dvm.conf e.g. accessing CRATE on port 5000 (as in example above) http://192.168.42.43:5000

@megastef
Copy link
Author

Now I need good advise - how to configure crate to an external drive for data? Basicalled 'see' to set data path, and how to tell docker using a partition with iSCSI or host mount on ZFS or local disks?

@megastef
Copy link
Author

Using local dir works like this:

docker run -p 5000:4200/tcp -v /tmp:/var/crate-data crate-data-node 

Using a data container image it should be like this:

docker run -i -volumes-from DATA3 -p 7000:4200 crate-data-node

Thanks to myself :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment