Created
June 20, 2012 02:13
-
-
Save Whitespace/2957765 to your computer and use it in GitHub Desktop.
Nimbus Connection Errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.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