github上storm-docker随笔记录

https://github.com/ziyunhx/storm-mono-docker

storm-mono-docker

Dockerfiles for building a storm cluster. Inspired by https://github.com/ptgoetz/storm-vagrant

The images are available directly from https://index.docker.io

##Pre-Requisites

install docker-compose http://docs.docker.com/compose/install/ ##Usage

Start a cluster:

docker-compose up -d

The docker-compose up command aggregates the output of each container. When the command exits, all containers are stopped. Running docker-compose up -d starts the containers in the background and leaves them running.

Destroy a cluster:

docker-compose stop Add more supervisors:

docker-compose scale supervisor=4 Kill and rm all docker cache:

docker kill $(docker ps -a -f "name=stormmonodocker" -q) ; docker rm $(docker ps -a -f "name=stormmonodocker" -q) Remove all docker image:

docker rmi $(docker images | grep "^ziyunhx" | awk "{print $3}") ##Building

rebuild.sh ##FAQ

How can I access Storm UI from my host?

Take a look at docker-compose.yml:

ui: image: ziyunhx/storm-ui ports: - "49080:8080" This tells Docker to expose the Docker UI container's port 8080 as port 49080 on the host

If you are running docker natively you can use localhost. If you're using boot2docker, then do:

$ boot2docker ip The VM's Host only interface IP address is: 192.168.59.103 Which returns your docker VM's IP. So, to open storm UI, type the following in your browser:

localhost:49080 or

192.168.59.103:49080 in my case.

How can I deploy a topology?

Since the nimbus host and port are not default, you need to specify where the nimbus host is, and what is the nimbus port number. Following the example above, after discovering the nimbus host IP (could be localhost, could be our docker VM ip as in the case of boot2docker), run the following command:

storm jar target/your-topology-fat-jar.jar com.your.package.AndTopology topology-name -c nimbus.host=192.168.59.103 -c nimbus.thrift.port=49627 If the above method is not successful, please change the storm.yaml file like this:

nimbus.seeds: ["192.168.59.103"] nimbus.thrift.port: 49627 And run the following command:

storm jar target/your-topology-fat-jar.jar com.your.package.AndTopology topology-name How can I connect to one of the containers?

Find the forwarded ssh port for the container you wish to connect to (use docker-compose ps)

$ ssh root@boot2docker ip -p $CONTAINER_PORT The password is 'ziyunhxpass' (from: https://registry.hub.docker.com/u/ziyunhx/base/dockerfile/).

转载于:https://my.oschina.net/runningwork/blog/1509928

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值