elasticsearch,apache-kafka,apache-storm,Maven,elasticsearch,Apache Kafka,Apache Storm" /> elasticsearch,apache-kafka,apache-storm,Maven,elasticsearch,Apache Kafka,Apache Storm" />

Maven 为什么当我将元组发送到ElasticSearch时,我的storm拓扑没有确认

Maven 为什么当我将元组发送到ElasticSearch时,我的storm拓扑没有确认,maven,elasticsearch,apache-kafka,apache-storm,Maven,elasticsearch,Apache Kafka,Apache Storm,我是使用Storm的新手,我刚刚开始了一个数据架构师培训课程,正是在这种背景下,我面临着今天给大家带来的问题 我通过一个名为CurrentPriceSpout的卡夫卡斯波特收到卡法的消息。到目前为止,一切正常。然后,在我的CurrentPriceBolt中,我重新发布了一个元组,以便使用EsCurrentPriceBolt在ElasticSearch中写入数据。问题就在这里。我不能直接将数据写入ElasticSearch,只有在删除拓扑时才会写入数据 是否有一个Storm参数可以通过检索确认来强

我是使用Storm的新手,我刚刚开始了一个数据架构师培训课程,正是在这种背景下,我面临着今天给大家带来的问题

我通过一个名为CurrentPriceSpout的卡夫卡斯波特收到卡法的消息。到目前为止,一切正常。然后,在我的CurrentPriceBolt中,我重新发布了一个元组,以便使用EsCurrentPriceBolt在ElasticSearch中写入数据。问题就在这里。我不能直接将数据写入ElasticSearch,只有在删除拓扑时才会写入数据

是否有一个Storm参数可以通过检索确认来强制写入元组

我尝试添加选项“.addConfiguration(Config.TOPOLOGY\u TICK\u TUPLE\u FREQ\u SECS,5)”,这些元组在ElasticSearch中编写得很好,但没有得到确认。所以风暴无限期地重写了它们

谢谢你的帮助
蒂埃里我设法找到了问题的答案。 主要问题是ES的设计并不像在研究项目中生成的数据那么少。默认情况下,ES以1000个条目为一批写入数据。在这个项目中,我每30秒生成一个数据,或每500分钟(或8h20)生成1000个数据

因此,我详细查看了拓扑结构的配置,并使用了以下选项:

  • es.batch.size.entries:1
  • es.storm.bolt.flush.ENTERS.尺寸:1
  • topology.producer.batch.size:1
  • topology.transfer.batch.size:1
现在是这样的:

...
...

public class App 
{
    ...    
    ...    

    public static void main( String[] args ) throws AlreadyAliveException, InvalidTopologyException, AuthorizationException
    {
        ...
        ...

        StormTopology topology  = topologyBuilder.createTopology();                 // je crée ma topologie Storm
        String topologyName     = properties.getProperty("storm.topology.name");    // je nomme ma topologie
        StormSubmitter.submitTopology(topologyName, getTopologyConfig(properties), topology);               // je démarre ma topologie sur mon cluster storm
        System.out.println( "Topology on remote cluster : Started!" );              
    }


    private static Config getTopologyConfig(Properties properties)
    {
        Config stormConfig = new Config();
        stormConfig.put("topology.workers",                 Integer.parseInt(properties.getProperty("topology.workers")));
        stormConfig.put("topology.enable.message.timeouts", Boolean.parseBoolean(properties.getProperty("topology.enable.message.timeouts")));
        stormConfig.put("topology.message.timeout.secs",    Integer.parseInt(properties.getProperty("topology.message.timeout.secs")));
        stormConfig.put("topology.transfer.batch.size",     Integer.parseInt(properties.getProperty("topology.transfer.batch.size")));
        stormConfig.put("topology.producer.batch.size",     Integer.parseInt(properties.getProperty("topology.producer.batch.size")));      
        return stormConfig;
    }

    ...    
    ...    
    ...    
}

现在它工作了

杀死拓扑做我想做的,但我不能继续杀死和添加拓扑杀死拓扑:1。刷新消息2。发送确认是一个storm命令或storm选项,其作用与杀死拓扑相同您考虑过仅使用Kafka Connect吗?这比你在这里做的要容易如果我有选择的话,我可以做到的,是的!但这是一个评估培训成果的项目,它将工作流程kafka-->storm-->elasticsearch强加给了我。祝你好运