So writing a test storm topology with minimal Java experience, so I'm figuring things out in a brute force way. My experience writing storm topologies is also minimal.
I have three supervisor nodes on my cluster and want each of them to run ls
in the terminal, funnel the output to a file and then return it to the nimbus node.
Firstly, how would i code an individual computer to run ls
in the terminal? Funneling the output to a file is simple enough for me to figure out. I just don't know how to write programs that execute terminal commands.
Secondly, how do i tell each of my supervisor nodes to run ls
individually?
You can use below snippet to run a command in shell. So use this same method to invoke the specific
ls
command usingssh
in all supervisor nodes (from external node like nimbus).Hope this helped.