Skip to content

Instantly share code, notes, and snippets.

View jatrost's full-sized avatar

Jason Trost jatrost

View GitHub Profile
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("word", new TestWordSpout(), 10);
builder.setBolt("exclaim1", new ExclamationBolt(), 3)
.shuffleGrouping("word");
builder.setBolt("exclaim2", new ExclamationBolt(), 2)
.shuffleGrouping("exclaim1");
Config conf = new Config();
conf.setDebug(true);
conf.registerMetricsConsumer(LoggingMetricsConsumer.class, 2);
2014-01-05 09:25:34,809 5479318 1388931931 localhost:6702 9:exclaim2 execute_count 196
2014-01-05 09:25:49,806 5494315 1388931949 localhost:6703 8:exclaim1 execute_count 28
2014-01-05 09:25:59,812 5504321 1388931959 localhost:6703 8:exclaim1 execute_count 34
2014-01-05 09:25:59,812 5504321 1388931946 localhost:6702 6:exclaim1 execute_count 29
2014-01-05 09:25:59,825 5504334 1388931951 localhost:6702 9:exclaim2 execute_count 989
2014-01-05 09:25:59,831 5504340 1388931957 localhost:6704 7:exclaim1 execute_count 656
2014-01-05 09:26:29,821 5534330 1388931977 localhost:6704 7:exclaim1 word_count {bertels=435, jackson=402, nathan=405, mike=414, golda=451}
2014-01-05 09:26:29,821 5534330 1388931977 localhost:6704 7:exclaim1 word_length 5.790223065970574
2014-01-05 09:26:29,822 55343
git clone https://github.com/endgameinc/storm-metrics-statsd.git
cd storm-metrics-statsd
mvn compile package install
<dependency>
<groupId>com.endgame</groupId>
<artifactId>storm-metrics-statsd</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
import com.endgame.storm.metrics.statsd.StatsdMetricConsumer;
...
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("word", new TestWordSpout(), 10);
builder.setBolt("exclaim1", new ExclamationBolt(), 3).shuffleGrouping("word");
builder.setBolt("exclaim2", new ExclamationBolt(), 2).shuffleGrouping("exclaim1");
//
topology.metrics.consumer.register:
- class: "com.endgame.storm.metrics.statsd.StatsdMetricConsumer"
parallelism.hint: 2
argument:
metrics.statsd.host: "statsd.server.mydomain.com"
metrics.statsd.port: 8125
metrics.statsd.prefix: "storm.metrics."
STORM_HOME=/usr/local/storm # set this based on your system's setup
mvn package
mvn org.apache.maven.plugins:maven-dependency-plugin:2.7:copy-dependencies -DincludeArtifactIds=java-statsd-client
cp target/dependency/java-statsd-client-1.0.1.jar $STORM_HOME/lib/
cp target/storm-metrics-statsd-*.jar $STORM_HOME/lib/
statsdConfig.put(Config.TOPOLOGY_NAME, "myTopologyName");
// OR
statsdConfig.put("topology.name", "myTopologyName");
@jatrost
jatrost / Bind9-with-RPZs.md
Last active May 14, 2018 10:52
This is a mini tutorial on getting bind9 on Ubuntu 12.04 working with Response Policy Zones (RPZ). See this for more info: http://www.zytrax.com/books/dns/ch9/rpz.html.

Bind9 with RPZs

This is a mini tutorial on getting bind9 on Ubuntu 12.04 working with Response Policy Zones (RPZ). See this for more info: http://www.zytrax.com/books/dns/ch9/rpz.html.

Install bind and make sure it is working

$ sudo apt-get install bind9
$ sudo /etc/init.d/bind9 status
 * bind9 is running

$ dig www.google.com @127.0.0.1

@jatrost
jatrost / troubleshooting-mhn.md
Last active August 29, 2015 14:03
This is a Work in Progress troubleshooting guide to MHN, compiled from responses to questions to the MHN alias ([email protected]).

MHN Troubleshooting

Note: This will likely be taken down soon since it has been posted on the MHN wiki here: https://github.com/threatstream/mhn/wiki/MHN-Troubleshooting-Guide

This is a Work in Progress troubleshooting guide to MHN, compiled from responses to questions to the MHN alias ([email protected]).

I can't login to the MHN server web app

Can you describe the error you're encountering when logging in? Password failure? Connection failure?