Skip to content

Instantly share code, notes, and snippets.

@kongliangzhong
Last active August 29, 2015 14:12
Show Gist options
  • Save kongliangzhong/f0b806e6099101e6313c to your computer and use it in GitHub Desktop.
Save kongliangzhong/f0b806e6099101e6313c to your computer and use it in GitHub Desktop.
parallel-computing
### Docker ###
1) hello world:
sudo docker run ubuntu:14.04 /bin/echo "hello, world!"
2) interactive:
sudo docker run -t -i ubuntu:14.04 /bin/bash
3) daemonized hello world:
sudo docker run -d ubuntu:14.04 /bin/bash -c "while true; do echo hello world; sleep 1; done"
this will return a container id.
a). sudo docker ps -l : list running containers. with name asigned.
b). sudo docker logs container_name: show output of daemonized container.
c). sudo docker stop container_name: stop daemonized container.
4) running a webapp in docker:
sudo docker run -d -P training/webapp python app.py
training/webapp is a pre-buildin image. will pulled from remote repository automatically if not found in local place.
a) port binding: sudo docker port container_name [port_in_docker]
b) show log continuously: sudo docker logs -f contianer_name
c) look at container's process id: sudo docker top container_name
d) inspect container: sudo docker inspect container_name
e) stop and restart container: sudo docker stop/start container_name
f) remove container: sudo docker rm container_name
5) docker images:
a) search image from repository(default Docker Hub): sudo docker search centos
##############
### STORM ###
1) deploy a storm cluster on multi machines:
a). setup a zookeeper cluster.
b). start nimbus on master: bin/storm nimbus
c). start supervisor on each worker machine: bin/storm supervisor
d). start ui: bin/storm ui
#############
### ZOOKEEPER ###
1) clustered setup:
a) config zookeeper: the default config file is at conf/zoo.cfg,
modify zoo.cfg, and add myid file under data path:
server.n = host:port1:port2
content of file myid: n
conf file sample:
tickTime=2000
dataDir=/var/lib/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
server.1=zoo1:2888:3888
server.2=zoo2:2888:3888
server.3=zoo3:2888:3888
b) start zookeeper on each machine: bin/zkServer.sh start
#################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment