Skip to content

Instantly share code, notes, and snippets.

View phobos182's full-sized avatar

Jeremy Carroll phobos182

View GitHub Profile
@phobos182
phobos182 / help
Created January 27, 2012 19:04
Hadoop help.
[user@dn1-r178u1 ~]$ hadoop --help
Error: No command named `--help' was found. Perhaps you meant `hadoop -help'
[user@dn1-r178u1 ~]$ hadoop -help
Error: No command named `-help' was found. Perhaps you meant `hadoop help'
[user@dn1-r178u1 ~]$ hadoop help
Exception in thread "main" java.lang.NoClassDefFoundError: help
Caused by: java.lang.ClassNotFoundException: help
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
root@jobs-aa-hdn160:/usr/share/java/logstash# java -cp ./logstash-1.1.0-monolithic.jar org.jruby.Main -S gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.9.2 (2012-06-06 patchlevel 312) [java]
- INSTALLATION DIRECTORY: file:/usr/share/java/logstash/logstash-1.1.0-monolithic.jar!/META-INF/jruby.home/lib/ruby/gems/1.8
- RUBY EXECUTABLE: java -jar /usr/share/java/logstash/logstash-1.1.0-monolithic.jar
- EXECUTABLE DIRECTORY: file:/usr/share/java/logstash/logstash-1.1.0-monolithic.jar!/META-INF/jruby.home/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.6
root@jobs-aa-hdn160:/usr/share/java/logstash# java -cp ./logstash-1.1.0-monolithic.jar org.jruby.Main -S gem list
*** LOCAL GEMS ***
addressable (2.2.6)
aws-sdk (1.5.2)
backports (2.3.0)
beefcake (0.3.7)
bouncy-castle-java (1.5.0146.1)
bson (1.6.4 jruby)
irb(main):001:0> require "filewatch/tail"; FileWatch::Tail.new
=> #<FileWatch::Tail:0x478dabf1 @opts={:sincedb_write_interval=>10, :sincedb_path=>"/root/.sincedb", :stat_interval=>1, :discover_interval=>5, :exclude=>[]}, @lastwarn={}, @sincedb_last_write=0, @files={}, @statcache={}, @buffers={}, @watch=#<FileWatch::Watch:0x2d83e895 @exclude=[], @watching=[], @logger=#<Logger:0x2f1aa58b @logdev=#<Logger::LogDevice:0x7e6a60d5 @shift_age=nil, @filename=nil, @dev=#<IO:fd 2>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x79fb80c9 @mon_count=0, @mon_mutex=#<Mutex:0x6ec44aaf>, @mon_owner=nil>, @shift_size=nil>, @formatter=nil, @progname=nil, @default_formatter=#<Logger::Formatter:0x19035ff9 @datetime_format=nil>, @level=1>, @files={}>, @logger=#<Logger:0x2f1aa58b @logdev=#<Logger::LogDevice:0x7e6a60d5 @shift_age=nil, @filename=nil, @dev=#<IO:fd 2>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x79fb80c9 @mon_count=0, @mon_mutex=#<Mutex:0x6ec44aaf>, @mon_owner=nil>, @shift_size=nil>, @formatter=nil, @progname=nil, @defa
root@hbase2-zoo1:~# ./zookeeper.py
zk.avg_latency 3 1339023823
zk.min_latency 0 1339023823
zk.max_latency 711 1339023823
zk.node_count 98 1339023823
zk.outstanding 0 1339023823
zk.received 10575333 1339023823
zk.sent 8857855 1339023823
_discover_file: /var/log/messages: new: /var/log/messages (exclude is []) {"level":"debug","file":"/usr/share/java/logstash/logstash-1.1.0.1-monolithic.jar!/gems/filewatch-0.3.3/lib/filewatch/watch.rb","line":"119","method":"_discover_file"}
_open_file: /var/log/messages: opening {"level":"debug","file":"/usr/share/java/logstash/logstash-1.1.0.1-monolithic.jar!/gems/filewatch-0.3.3/lib/filewatch/tail.rb","line":"89","method":"_open_file"}
/var/log/messages: initial create, no sincedb, seeking to end 71193 {"level":"debug","file":"/usr/share/java/logstash/logstash-1.1.0.1-monolithic.jar!/gems/filewatch-0.3.3/lib/filewatch/tail.rb","line":"122","method":"_open_file"}
/
"filter|worker|0" daemon prio=10 tid=0x00007ff74447f000 nid=0x107b in Object.wait() [0x00007ff749a30000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000608948d60> (a org.jruby.libraries.ThreadLibrary$SizedQueue)
at java.lang.Object.wait(Object.java:443)
at org.jruby.RubyThread$SleepTask.run(RubyThread.java:816)
- locked <0x0000000608948d60> (a org.jruby.libraries.ThreadLibrary$SizedQueue)
at org.jruby.RubyThread.executeBlockingTask(RubyThread.java:832)
at org.jruby.RubyThread.wait_timeout(RubyThread.java:1102)
at org.jruby.libraries.ThreadLibrary$Queue.pop(ThreadLibrary.java:402)
@phobos182
phobos182 / haproxy.conf
Created July 17, 2012 23:19
LogStash Configuration for HAProxy
input {
syslog {
type => "haproxy-access"
port => 514
}
}
filter {
grok {
type => "haproxy-access"
## These patterns were tested w/ haproxy-1.4.15
## Documentation of the haproxy log formats can be found at the following links:
## http://code.google.com/p/haproxy-docs/wiki/HTTPLogFormat
## http://code.google.com/p/haproxy-docs/wiki/TCPLogFormat
HAPROXYTIME (?!<[0-9])%{HOUR:haproxy_hour}:%{MINUTE:haproxy_minute}(?::%{SECOND:haproxy_second})(?![0-9])
HAPROXYDATE %{MONTHDAY:haproxy_monthday}/%{MONTH:haproxy_month}/%{YEAR:haproxy_year}:%{HAPROXYTIME:haproxy_time}.%{INT:haproxy_milliseconds}
# Override these default patterns to parse out what is captured in your haproxy.cfg
#_ FIRST RUN _#
root@server:~# puppet agent -t
info: Retrieving plugin
info: Caching catalog for server
info: Applying configuration version '1345065227'
notice: /Stage[main]/Test/File[/tmp/myfile]/content:
--- /tmp/myfile 2012-08-15 21:18:04.816031799 +0000
+++ /tmp/puppet-file20120815-627-do01b1-0 2012-08-15 21:18:32.011877658 +0000