diff --git a/.gitignore b/.gitignore index ebee2f5f..e567e9bc 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ Burrow !config log .idea -Burrow.iml \ No newline at end of file +Burrow.iml +tmp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..ef60ed79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:alpine + +MAINTAINER LinkedIn Burrow "https://github.com/linkedin/Burrow" + +RUN apk add --update bash curl git && rm -rf /var/cache/apk/* + +RUN wget https://raw.githubusercontent.com/pote/gpm/v1.4.0/bin/gpm && chmod +x gpm && mv gpm /usr/local/bin + +ADD . $GOPATH/src/github.com/linkedin/burrow +RUN cd $GOPATH/src/github.com/linkedin/burrow && gpm install && go install + +ADD docker-config /etc/burrow + +WORKDIR /var/tmp/burrow + +CMD ["/go/bin/burrow", "--config", "/etc/burrow/burrow.cfg"] diff --git a/README.md b/README.md index 44417f97..99bfe31f 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,26 @@ $ go install $ $GOPATH/bin/burrow --config path/to/burrow.cfg ``` +### Using Docker +A Docker file is available which builds this project on top of an Alpine Linux image. +To use it, build your docker container, mount your Burrow configuration into `/etc/burrow` and run docker. + +A [Docker Compose](https://docs.docker.com/compose/) is also available for quick and easy development. + +Install Docker Compose and then: + +1. Build the docker container: + ``` + docker-compose build + ``` + +2. Run the docker compose stack which includes kafka and zookeeper: + ``` + docker-compose down; docker-compose up + ``` + +3. Some test topics have already been created by default and Burrow can be accessed on port 8000 of your docker-machine. e.g. `http://192.168.99.100:8000/v2/kafka` + ### Configuration For information on how to write your configuration file, check out the [detailed wiki](https://github.com/linkedin/Burrow/wiki) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..c86877ce --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +version: "2" +services: + burrow: + build: . + volumes: + - ${PWD}/docker-config:/etc/burrow/ + - ${PWD}/tmp:/var/tmp/burrow + ports: + - 8000:8000 + depends_on: + - zookeeper + - kafka + restart: always + + zookeeper: + image: wurstmeister/zookeeper + ports: + - 2181:2181 + + kafka: + image: wurstmeister/kafka + ports: + - 9092:9092 + environment: + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181/local + KAFKA_ADVERTISED_HOST_NAME: kafka + KAFKA_ADVERTISED_PORT: 9092 + KAFKA_CREATE_TOPICS: "test-topic:2:1,test-topic2:1:1,test-topic3:1:1" diff --git a/docker-config/burrow.cfg b/docker-config/burrow.cfg new file mode 100644 index 00000000..92430f80 --- /dev/null +++ b/docker-config/burrow.cfg @@ -0,0 +1,29 @@ +[general] +logconfig=/etc/burrow/logging.cfg +group-blacklist=^(console-consumer-|python-kafka-consumer-).*$ + +[zookeeper] +hostname=zookeeper +port=2181 +timeout=6 +lock-path=/burrow/notifier + +[kafka "local"] +broker=kafka +broker-port=9092 +offsets-topic=__consumer_offsets +zookeeper=zookeeper +zookeeper-path=/local +zookeeper-offsets=true +offsets-topic=__consumer_offsets + +[tickers] +broker-offsets=60 + +[lagcheck] +intervals=10 +expire-group=604800 + +[httpserver] +server=on +port=8000 diff --git a/docker-config/logging.cfg b/docker-config/logging.cfg new file mode 100644 index 00000000..14b86386 --- /dev/null +++ b/docker-config/logging.cfg @@ -0,0 +1,8 @@ + + + + + + + +