diff --git a/storm/content.md b/storm/content.md index 9d3b8218e..6e6086a1f 100644 --- a/storm/content.md +++ b/storm/content.md @@ -8,22 +8,48 @@ Apache Storm is a distributed computation framework written predominantly in the # How to use this image -## Setting up a Storm Cluster +This image entry point is a [Storm command line client](http://storm.apache.org/releases/1.0.0/Command-line-client.html). See couple of usage examples below. -1. Start Zookeeper +## Running topologies in local mode - $ docker run -d --name zookeeper jplock/zookeeper:3.4.8 +Assuming you have `storm-starter-topologies-1.0.0.jar` in the current directory. -2. Start Nimbus + $ docker run -it -v $(pwd)/storm-starter-topologies-1.0.0.jar:/topology.jar 31z4/storm:1.0.0 jar /topology.jar org.apache.storm.starter.ExclamationTopology - $ docker run -d --name nimbus --net container:zookeeper 31z4/storm:1.0.0 nimbus +## Setting up a minimal Storm cluster -3. Start Supervisor +1. [Apache Zookeeper](https://zookeeper.apache.org/) is a must for running a Storm cluster. Start it first. Since the Zookeeper "fails fast" it's better to always restart it. - $ docker run -d --name supervisor --net container:nimbus 31z4/storm:1.0.0 supervisor + $ docker run -d --restart always --name zookeeper jplock/zookeeper:3.4.8 -## Running Topologies +2. The Nimbus daemon has to be connected with the Zookeeper. It's also a "fail fast" system. -Assuming you set up a Storm cluster as written above and have `storm-starter-topologies-1.0.0.jar` in your current directory. + $ docker run -d --restart always --name nimbus --net container:zookeeper 31z4/storm:1.0.0 nimbus - $ docker run -it --net container:nimbus -v $(pwd)/storm-starter-topologies-1.0.0.jar:/topology.jar storm:1.0.0 jar /topology.jar org.apache.storm.starter.WordCountTopology topology +3. Finally start a single Supervisor node. It will talk to the Nimbus and Zookeeper. + + $ docker run -d --restart always --name supervisor --net container:nimbus --net container:zookeeper 31z4/storm:1.0.0 supervisor + +4. Now we can submit a topology to our cluster. + + $ docker run -it --net container:nimbus -v $(pwd)/storm-starter-topologies-1.0.0.jar:/topology.jar 31z4/storm:1.0.0 jar /topology.jar org.apache.storm.starter.WordCountTopology topology + +## Configuration + +This image uses [default configuration](https://github.com/apache/storm/blob/v1.0.0/conf/defaults.yaml) of the Apache Storm. There are two main ways to change it. + +1. Using command line arguments. + + $ docker run -d --restart always --name nimbus 31z4/storm:1.0.0 nimbus -c storm.log.dir="/logs" -c storm.zookeeper.servers="[\"zookeeper\"]" + +2. Assuming you have `storm.yaml` in the current directory you can mount it as a volume. + + $ docker run -it -v $(pwd)/storm.yaml:/apache-storm-1.0.0/conf/storm.yaml 31z4/storm:1.0.0 nimbus + +## Data persistence + +No data are persisted by default. For convenience there are `/data` and `/logs` directories in the image owned by `storm` user. Use them accordingly to persist data and logs using volumes. + + $ docker run -it -v /logs -v /data 31z4/storm:1.0.0 nimbus -c storm.log.dir="/logs" -c storm.local.dir="/data" + +*Please be noticed that using paths other than those predefined is likely to cause permission denied errors. It's because for [security reasons](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#user) the Storm is running under the non-root `storm` user.*