I am not sure why everyone is having so many issues with DRPC. Yes there are several moving parts involved, and I did run into one small bug that I, but it was simple to work around. The following is everything I ran. NOTE this was on a mac with no security enabled, and I am not doing http, although I have done it in the past.
$ git checkout v1.1.0$ mvn clean install -DskipTests$ cd storm-dist/binary/$ mvn clean package$ tar -xzvf ./target/apache-storm-1.1.0.tar.gz$ cd apache-storm-1.1.0/$ vim ./conf/storm.yaml$ cat ./conf/storm.yaml## Locations of the drpc servers drpc.servers: - "localhost"$ cd examples/storm-starter/$ # I should file a ticket for a stand alone command line DRPC Client $ vim ./src/jvm/BasicDRPCClient.java$ cat ./src/jvm/BasicDRPCClient.java/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import org.apache.storm.generated.DistributedRPC; import org.apache.storm.utils.DRPCClient; import org.apache.storm.utils.Utils; import org.apache.storm.Config; import java.util.Map; import java.util.List; public class BasicDRPCClient { public static void main(String[] args) throws Exception { Map<String, Object> conf = Utils.readDefaultConfig(); conf.putAll(Utils.readCommandLineOpts()); String server = ((List<String>)conf.get(Config.DRPC_SERVERS)).get(0); int port = ((Number)conf.get(Config.DRPC_PORT)).intValue(); DistributedRPC.Iface client = new DRPCClient(conf, server, port); for (int i = 0; i < args.length; i += 2) { System.out.println(args[i] + "("+args[i+1]+") => " + client.execute(args[i], args[i+1])); } } }$ mvn clean install -DskipTests$ cd ../..$ ./bin/storm dev-zookeeper & $ ./bin/storm nimbus & $ ./bin/storm ui & $ ./bin/storm logviewer & $ ./bin/storm supervisor & $ ./bin/storm drpc &$ #look at the logs or check on the UI that everything is up$ ./bin/storm jar ./examples/storm-starter/target/storm-starter-1.1.0.jar org.apache.storm.starter.BasicDRPCTopology drpcTopo$ ./bin/storm jar ./examples/storm-starter/target/storm-starter-1.1.0.jar BasicDRPCClient exclamation test -c drpc.servers='["localhost"]'...exclamation(test) => test!$ #Not sure why but drpc.servers was not getting picked up by the client in this case. I would have to debug it, but the command line is working fine. - Bobby On Friday, June 30, 2017, 9:05:48 AM CDT, kalliopi kalantzaki <[email protected]> wrote: Hello to all,I am glad that other people face the same problem. I thought i was making something wrong all this time. Typical DRPC topology examples give the same error message to me as well. I set up the DRPC server running and i send a message from another java app using DRPC client. My app never gets a response, only the message WARN o.a.s.u.StormBoundedExponentialBackoffRetry - WILL SLEEP FOR 2020ms (NOT MAX) Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: org.apache.storm.thrift.transport.TTransportException: java.net.ConnectException: Connection refused: connect at org.apache.storm.security.auth.ThriftClient.reconnect(ThriftClient.java:108) at org.apache.storm.security.auth.ThriftClient.<init>(ThriftClient.java:69) at org.apache.storm.utils.DRPCClient.<init>(DRPCClient.java:44) at org.apache.storm.utils.DRPCClient.<init>(DRPCClient.java:39) at com.jrtechnologies.pciengine.clientsource.Source.main(Source.java:84) The DRPC client gives a response only if i use DRPC client inside the topology code... If i use postman to send http request, i also get the same error i the DRPC server console. I use storm 1.1.0 and i have used the default settings for DRPC server in localmode. Στις 4:54 μ.μ. Παρασκευή, 30 Ιουνίου 2017, ο/η Bobby Evans <[email protected]> έγραψε: Do you have your topology running? The read timeout indicates that you successfully sent a message to the DRPC server, but no response was returned before the socket got a read timeout. This typically means that the topology was not running or was not able to talk to the DRPC server. Please check for errors in the topology logs and the DRPC server logs if the topology is up and running. - Bobby On Friday, June 30, 2017, 6:27:18 AM CDT, J.R. Pauley <[email protected]> wrote: Hello All: I'm trying to get running an example from trident tutorial (Part04_BasicStateAndDRPC) and I can submit and run the main class but also have built a DRPCClient and trying to run that client on same box. I have my DRPC server running and listening on 3772 but all I can see from the client is a timeout. I have reverted my install to 0.9.6 to more closely match that of the tutorial but not sure what to look for at this point. Has anyone experience with drpc client? Exception: java.net.SocketTimeoutException: Read timed outorg.apache.thrift7.transport.TTransportException: java.net.SocketTimeoutException: Read timed out at org.apache.thrift7.transport.TIOStreamTransport.read(TIOStreamTransport.java:129) at org.apache.thrift7.transport.TTransport.readAll(TTransport.java:84) at org.apache.thrift7.transport.TFramedTransport.readFrame(TFramedTransport.java:129) at org.apache.thrift7.transport.TFramedTransport.read(TFramedTransport.java:101) at org.apache.thrift7.transport.TTransport.readAll(TTransport.java:84) at org.apache.thrift7.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378) at org.apache.thrift7.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297) at org.apache.thrift7.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204) at org.apache.thrift7.TServiceClient.receiveBase(TServiceClient.java:69) at backtype.storm.generated.DistributedRPC$Client.recv_execute(DistributedRPC.java:92) at backtype.storm.generated.DistributedRPC$Client.execute(DistributedRPC.java:78) at backtype.storm.utils.DRPCClient.execute(DRPCClient.java:71) at storm.trident.DrpcTestClient.main(DrpcTestClient.java:39)Caused by: java.net.SocketTimeoutException: Read timed out
