Skip to content

Instantly share code, notes, and snippets.

@Whitespace
Created June 20, 2012 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whitespace/2957765 to your computer and use it in GitHub Desktop.
Save Whitespace/2957765 to your computer and use it in GitHub Desktop.
Nimbus Connection Errors
# Checkout the storm repo at version 0.7.0 (the version I was using)
cd ~/code/test
git clone https://github.com/nathanmarz/storm.git
cd ~/code/test/storm
git checkout 3159347
# Install the ruby thrift gem
gem install thrift
# Create our test project
mkdir -p ~/code/test/thrift-rb-test/rb
cd ~/code/test/thrift-rb-test
cp ~/code/test/storm/src/storm.thrift ~/code/test/thrift-rb-test
thrift --gen rb storm.thrift
# Copy test.rb from above
cd ~/code/test/thrift-rb-test/rb
wget https://raw.github.com/gist/2957765/5725011bcd2d163451f4b6687ae4c9a7da291dbc/test.rb
ruby test.rb
$:.push('../gen-rb')
require 'thrift'
require 'nimbus'
begin
transport = Thrift::BufferedTransport.new(Thrift::Socket.new('nimbus.example.com', 6627))
protocol = Thrift::BinaryProtocol.new(transport)
client = Nimbus::Client.new(protocol)
transport.open()
summary = client.getClusterInfo()
transport.close()
rescue Thrift::Exception => tx
print 'Thrift::Exception: ', tx.message, "\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment