Storm deployments are not particularly troublesome, but in a production environment, it is a good choice to use Docker for unified management of deployments in order to improve deployment efficiency and facilitate administrative maintenance. Here is a new project for my open source, a Docker image orchestration with the storm and mono environments: Storm-mono-docker.
This project benefits from Https://github.com/ptgoetz/storm-vagrant and https://github.com/wurstmeister/storm-docker; thank them for paying!
The Docker image used by the project is hosted on Https://index.docker.io.
Preparatory work
Installing Docker engine,https://docs.docker.com/
Installing Docker-compose http://docs.docker.com/compose/install/
To clone a git project:
https://github.com/ziyunhx/storm-mono-docker
Use
First, switch the command-line directory to the GIT project directory you just cloned;
Start the cluster with the following command:
-d
- You can also use the docker-compose up command to output the results to the current command line interface, but you will not be able to do anything else until you end it, and once the command line exits, all containers are stopped. And Docker-compose up-d will start all containers in the background.
Stop all containers for this cluster:
stop
Once the container is stopped, the next direct launch will not link the container properly, causing storm to run abnormally, and you can end and remove all Docker caches after the end using the following command:
docker kill $(docker ps -q) ; docker rm $(docker ps -a -q)
Add more supervisors:
docker-compose scale supervisor=4
Use the following command to delete all the image files (be careful, this will allow you to take more time to download the container at the next boot, only if you do not want to continue using it):
docker rmi $(docker images -q -a)
Re-build and update
You can reconstruct the image using the following command after modifying the dockerfile: rebuild.sh;
Use the following command to update the image to the latest version: Refresh.sh.
Q. How do I access the Storm UI to view health?
The following configuration is available in the DOCKER-COMPOSE.YML:
ui: image: ziyunhx/storm-ui ports: - "49080:8080"
It tells us that the 8080 port of the Docker image is mapped to 49080 of the host, so you can access it by accessing http://localhost:49080. If you use Boot2docker, you can get the IP of the virtual machine via the following command:
boot2docker ipThe VM‘s Host only interface IP address is: 192.168.59.103
The returned result is your IP, which can be accessed through http://192.168.59.103:49080 in this example.
How to deploy commit a topology?
If the IP and port of Nimbus are not the default, you need to specify that they will be submitted later, in this case you can use 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 command does not work, you can configure the following key in the local storm configuration file (Storm.yaml):
nimbus.host: "192.168.59.103" nimbus.thrift.port: 49627
Then execute the following command to commit:
storm jar target/your-topology-fat-jar.jar com.your.package.AndTopology topology-name
How do I connect to my container?
Use Docker-compose PS to locate the SSH port of the container you wish to connect to, and then connect via SSH:
$CONTAINER_PORT
The password is ' Ziyunhxpass ' (located at: https://registry.hub.docker.com/u/ziyunhx/base/dockerfile/).
This article is from the Newidea, author Carey Tzou.
Starting Address: http://www.tnidea.com/deploy-storm-by-docker.html
Without authorization, reject any full text and summary reprint!
Quickly deploy a storm environment with Docker