How to pass external configuration properties to storm topology?

I want to pass some custom configuration properties to storm topology that are not part of storm yaml, how can I pass it.

https://community.hortonworks.com/questions/36969/how-to-pass-external-configuration-properties-to-s.html

https://stackoverflow.com/questions/18061332/storm-topology-configuration

------------------------------------------------------------------------------------------------------------------------------------------------------

you can use following ways to get the external configuration inside the topplogy

  

1:

pass the arguments like this

storm jar storm-jar topology-name -c sKey=sValue -c key1=value1 -c key2=value2 >/tmp/storm.txt

2:

Create a simple java resource file (properties files) and pass it as arguments to your topology main class, in main method read the properties from the main file

and build the storm configuration object using conf.put()

3:

create separate yaml file read it through the Utils method provided by storm api,look for more documentation https://nathanmarz.github.io/storm/doc/backtype/storm/utils/Utils.html

Utils.findAndReadConfigFile()

--------------------------

You can use

Config conf = new Config();

conf.put(key, val);

conf.put(key1, val1);

e.g redis config, etc.

and then you can use this in prepare method of bolts(in case of trident in functions/ filters, etc).

Hope this helps.

How to pass external configuration properties to storm topology?的更多相关文章

  1. External Configuration Store Pattern 外部配置存储模式

    Move configuration information out of the application deployment package to a centralized location. ...

  2. STORM_0005_第一个非常简单的storm topology的提交运行

    配置好storm之后就可以开始在eclipse里面写topology了. 下面是我在网上搜到的一个简单的例子,我按照自己的理解注释了一下. 第一步,创建mvn工程 这是pom.xml文件 <pr ...

  3. Storm Topology Parallelism

    Understanding the Parallelism of a Storm Topology What makes a running topology: worker processes, e ...

  4. java.lang.ClassNotFoundException: org.apache.storm.topology.IRichSpout

    java.lang.NoClassDefFoundError: org/apache/storm/topology/IRichSpout at java.lang.Class.getDeclaredM ...

  5. Caused by: java.lang.ClassNotFoundException: backtype.storm.topology.IRichSpout

    1:初次运行Strom程序出现如下所示的错误,贴一下,方便脑补,也希望帮助到看到的小伙伴: 错误如下所示,主要问题是刚开始使用maven获取jar包的时候需要写<scope>provide ...

  6. Storm Topology 提交 总结---Kettle On Storm 实现

    一,目的 在学习的过程中,需要用到 PDI---一个开源的ETL软件.主要是用它来设计一些转换流程来处理数据.但是,在PDI中设计好的 transformation 是在本地的执行引擎中执行的,(参考 ...

  7. Storm本地启动拓扑报错:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/storm/topology/IRichSpout

    问题描述: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/storm/topology ...

  8. SpringBoot(三) Core Features: External Configuration(配置文件)

    码云: external-configuration 可以使用属性文件,YAML文件,环境变量和命令行参数来外部化配置 一.属性值可以直接注入到bean 系统属性值不可以 // application ...

  9. Storm Topology及分组原理

    Storm的通信机制,需要满足如下一些条件以满足Storm的语义. 1.建立数据传输的缓冲区.在通信连接没有建立之前把发送的数据缓存起来.数据发送方可以在连接建立之前发送消息,而不需要等连接建立起来, ...

随机推荐

  1. yrzl-cloud

  2. Pet(dfs)

    http://acm.hdu.edu.cn/showproblem.php?pid=4707 题意:判断距离大于D的点有多少个. 思路: 邻接表建图,dfs每一个点,记录步数. #include &l ...

  3. Sorting It All Out(拓扑排序)

    http://poj.org/problem?id=1094 1.判断所给关系是否为合法的拓扑序列,若存在环,输出 "Inconsistency found after %d relatio ...

  4. codevs1519 过路费(最小生成树+LCA)

    1519 过路费  时间限制: 1 s  空间限制: 256000 KB  题目等级 : 大师 Master     题目描述 Description 在某个遥远的国家里,有 n个城市.编号为 1,2 ...

  5. Asp.net三种事务处理

    事务处理是在数据处理时经常遇到的问题,经常用到的方法有以下三种总结整理如下:方法1:直接写入到sql 中在存储过程中使用 BEGIN TRANS, COMMIT TRANS, ROLLBACK TRA ...

  6. Linux安装java jdk、mysql、tomcat

    安装javajdk 1.8 检查是否安装 rpm -qa | grep jdk rpm方式安装 下载java1.8 jdk http://download.oracle.com/otn-pub/jav ...

  7. 5.30dao-service-controller层,mybatis自动生成。(获取根据id主键获取指定详细数据)

    获取权限详细数据:(参考)                    1.controller:1.注入Servcie调用方法findConsumerById(参数是id);               ...

  8. MySql-Connector for NET 连接驱动选择

    尝试在Visual Studio2010, 2012环境下链接Mysql, 为啥不直接在App.config里面写字符串, 当然是可以,但是当你想用EF 的时候,必须要有个数据源, 首先在[服务资源管 ...

  9. react中withRouter解决props返回为空

    利用 react + antd 框架书写导航栏时,遇到了几个坑,分别是一级菜单和二级菜单在点击的情况下,高亮没有任何问题,但是再点击浏览器返回按钮时,却就乱套了. 1. 二级菜单中,我们可以通过 pr ...

  10. 如何用js代码实现图片切换效果

    通过点击按钮,实现图片的隐藏与显现,切换. 实现代码:<style> .a{ width: 300px; height: 300px; border: 1px solid black; } ...