How to use DRPC?

1,595 views
Skip to first unread message

山 金

unread,
Dec 28, 2011, 10:33:33 PM12/28/11
to storm-user
Hi all:
I have 3 machines.Their storm.yaml are like these:
storm.zookeeper.servers:
- "10.13.41.98"
- "10.13.41.104"
- "10.13.41.64"
storm.zookeeper.port: "2181"
nimbus.host: "10.13.41.98"
storm.local.dir: "/mnt/storm"
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
drpc.servers:
- "10.13.41.104"
- "10.13.41.64"
- "10.13.41.98"

Do I start DRPC by these steps:
1 execute ./strom nimbus on 10.13.41.98
2 execute ./strom drpc on 10.13.41.104 and 10.13.41.64
3 execute ./storm jar storm-starter-full.jar
storm.starter.ReachTopology "ReachTopology" on 10.13.41.104
and then , can the example ReachTopology works?

I get nimbus.log and no result return :
[INFO] Task ReachTopology-1-1325127888:21 timed out

songhe yang

unread,
Dec 29, 2011, 12:01:05 PM12/29/11
to storm-user
1) You need start nimbus and supervisor as usual(e.g: 1 nimbus, 2
supervisor).

@10.13.41.98
./bin/storm nimbus

@10.13.41.104 and @10.13.41.64
./bin/storm supervisor


2) start DRPC server

@10.13.41.98
./bin/storm drpc


3) submit the jar to storm
./bin/storm jar storm-starter-full.jar storm.starter.ReachTopology
reach

("reach" is a self defined topology name)

Hope this will help you!

Nathan Marz

unread,
Dec 29, 2011, 11:36:41 PM12/29/11
to storm...@googlegroups.com
DRPC topologies only "do stuff" when you make DRPC requests. You should use backtype.storm.utils.DRPCClient to connect to the DRPC server and make requests using the "execute" method on the client.

--
Twitter: @nathanmarz
http://nathanmarz.com

songhe yang

unread,
Dec 30, 2011, 1:17:31 AM12/30/11
to storm-user
Three questions:

1) If the drpc server configure as follows, then i need run "./bin/
storm drpc" on all of these servers?
drpc.servers:
- "10.13.41.104"
- "10.13.41.64"
- "10.13.41.98"

2) I need use storm jar summit the topology to storm first, then write
a application using DRPCClient to call "execute" ?


3) If i can give more than one hosts to DRPCClient?

DRPCClient client = new DRPCClient("drpc-host", 3772);

Nathan Marz

unread,
Dec 30, 2011, 1:37:58 AM12/30/11
to storm...@googlegroups.com
Answers inline.

On Thu, Dec 29, 2011 at 10:17 PM, songhe yang <songh...@gmail.com> wrote:
Three questions:

1) If the drpc server configure as follows, then i need run "./bin/
storm drpc" on all of these servers?
drpc.servers:
   - "10.13.41.104"
   - "10.13.41.64"
   - "10.13.41.98"

Yes, you do.
 

2) I need use storm jar summit the topology to storm first, then write
a application using DRPCClient to call "execute" ?

Yes.
 


3) If i can give more than one hosts to DRPCClient?

DRPCClient client = new DRPCClient("drpc-host", 3772);

No, you can't. DRPCClient can definitely be improved (or a higher level one can be written on top of it).

山 金

unread,
Jan 13, 2012, 3:20:48 AM1/13/12
to storm-user
Thanks all.
The method "execute(String func, String args)" of DRPCClient can only
return String?
Are there more examples about DPRC usage?

On Dec 30 2011, 2:37 pm, Nathan Marz <nathan.m...@gmail.com> wrote:
> Answers inline.
>

Nathan Marz

unread,
Jan 13, 2012, 6:47:43 AM1/13/12
to storm...@googlegroups.com
It currently can only return String because of the limitations of Thrift. but if you want a more complicated return value you could always use JSON or something like that. 

The only examples I've made public are BasicDRPCTopology and ReachTopology from storm-starter.

Reply all
Reply to author
Forward
0 new messages