Install Cassandra with Ruby 1.9.1 on Windows
2010-02-28 03:51
190 查看
To get it done is not easy. I spent a whole day to figure out the various compatibility issues along the way out.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
You may know that the Ruby gem cassandra will do it for you.
To me, I simply want to keep Cassandra independent from Ruby stuff, to ease the upgrade and administration.
Refer to my blog "Setup Cassandra on Windows"
(http://blog.csdn.net/goodxp/archive/2010/02/26/5327732.aspx) for details.
Step 2: Install Thrift (0.2.0)
If you do "gem install cassandra", it should install thrift automatically (being a dependency).
However, there is a compatibility issue on thrift with Ruby 1.9, so to fail Cassandra gem installation.
It will be better to install thrift first and fix it before installing cassandra gem.
Refer to my blog "fix thrift 0.2.0 installation with ruby 1.9.1"
(http://blog.csdn.net/goodxp/archive/2010/02/28/5333145.aspx) for details.
Step 3: Install gem Cassandra
This part is easy:
$ gem install cassandra
Do NOT do this: "$ cassandra_helper cassandra". It does not work.
I did not dig deeper since I already have a working up-to-date version of Cassandra 0.5.0 installed.
Switch to Cassandra bin folder and start cassandra server:
$ cassandra -f
Open another command console window:
$ irb
irb> require 'rubygems'
irb> require 'cassandra'
If you see a warning pop-up window asking for "msvcrt-ruby18.dll", do this:
irb> quit
$ gem uninstall json
Don't worry, Ruby 1.9 has a good json support.
Now run irb again as above, and then:
irb> include Cassandra::Constants
irb> db = Cassandra.new 'Keyspace1'
irb> niceguy = {'name' => 'goodxp'}
irb> db.insert (:Standard1, '10', niceguy)
Keyspace1 and Standard1 are the sample config for Cassandra. This should work if you did not change schema yet.
Now we can check whether the data were inserted. To be sure, let's use cassandra command line client:
irb> quit
$ cassandra-cli
cassandra> connect localhost/9160
cassandra> get Keyspace1.Standard1['10']
You should see the niceguy 'name' 'goodxp' shows up. It means your Ruby API just works.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
You may know that the Ruby gem cassandra will do it for you.
To me, I simply want to keep Cassandra independent from Ruby stuff, to ease the upgrade and administration.
Refer to my blog "Setup Cassandra on Windows"
(http://blog.csdn.net/goodxp/archive/2010/02/26/5327732.aspx) for details.
Step 2: Install Thrift (0.2.0)
If you do "gem install cassandra", it should install thrift automatically (being a dependency).
However, there is a compatibility issue on thrift with Ruby 1.9, so to fail Cassandra gem installation.
It will be better to install thrift first and fix it before installing cassandra gem.
Refer to my blog "fix thrift 0.2.0 installation with ruby 1.9.1"
(http://blog.csdn.net/goodxp/archive/2010/02/28/5333145.aspx) for details.
Step 3: Install gem Cassandra
This part is easy:
$ gem install cassandra
Do NOT do this: "$ cassandra_helper cassandra". It does not work.
I did not dig deeper since I already have a working up-to-date version of Cassandra 0.5.0 installed.
Switch to Cassandra bin folder and start cassandra server:
$ cassandra -f
Open another command console window:
$ irb
irb> require 'rubygems'
irb> require 'cassandra'
If you see a warning pop-up window asking for "msvcrt-ruby18.dll", do this:
irb> quit
$ gem uninstall json
Don't worry, Ruby 1.9 has a good json support.
Now run irb again as above, and then:
irb> include Cassandra::Constants
irb> db = Cassandra.new 'Keyspace1'
irb> niceguy = {'name' => 'goodxp'}
irb> db.insert (:Standard1, '10', niceguy)
Keyspace1 and Standard1 are the sample config for Cassandra. This should work if you did not change schema yet.
Now we can check whether the data were inserted. To be sure, let's use cassandra command line client:
irb> quit
$ cassandra-cli
cassandra> connect localhost/9160
cassandra> get Keyspace1.Standard1['10']
You should see the niceguy 'name' 'goodxp' shows up. It means your Ruby API just works.
相关文章推荐
- Install IIS with Tomcat 5.5.17 using J2SE JDK 5.0 Update 6 for ArcIMS 9.2 on Windows
- 179-Geolocation-with-MaxMind-s-GeoIP-and-the-geoip-city-RubyGemInstall
- Ruby Install on mac with RVM
- Solving install issues with Python 2.7.10 on Windows
- How To Install Ruby with rbenv on Cent OS 7.2
- How install ruby1.9.1 rails-2.3.4 on window
- Fix Thrift 0.2.0 Installation with Ruby 1.9.1
- How to install redis with Ruby
- [Django] Get started with Django -- Install python and virtualenv
- Installation failed with message INSTALL_PARSE_FAILED_MANIFEST_MALFORMED.的问题
- Install:Wrapper.CreateFile failed with error 123:文件名、目录名或卷标语法不正确
- installation failed with message install_canceled_by_user应用安装失败
- Install Cassandra on windows
- Install opencv-2.4.7 in Ubuntu 11.10 with Qt support
- How to Install Kali Linux on Android - Tutorial With Screenshot
- Installation failed with message INSTALL_FAILED_TEST_ONLY:installPackageLI.
- OpenSAF install & configure with 4 nodes
- fedora 上yum install rubygem-sqlite3-ruby
- How to Install SugarCRM with SQL Server 2008 and IIS 7.0
- 关于pip install安装python依赖包时报错:command 'gcc' failed with exit status 1的解决方案