storm启动报错: InvalidTopologyException(msg:Component: [mybolt] subscribes from non-existent stream: [default] of component [es-bolt])

storm每一个bolt在emit之后需要把数据传递到下一个bolt,所以declareOUtputFields 一定要写

默认的情况下不用加streamId,如果加了streamId,后面的bolt在使用shuffleGrouping时一定要写上steamId

    @Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
// outputFieldsDeclarer.declare(new Fields("source"));
}

加streamId为

    @Override
public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
// outputFieldsDeclarer.declare("streamId",new Fields("source"));
}

topology写法如下

builder.setBolt("bolt", new SenqueceBolt()).shuffleGrouping("spout","streamId");
上一篇:centos5.5下mangodb启动报错glibc


下一篇:练习SQL代码