Changes between Version 8 and Version 9 of waue/2011/1107


Ignore:
Timestamp:
Nov 9, 2011, 4:41:17 PM (12 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2011/1107

    v8 v9  
    1010
    1111}}}
    12 [[PageOutline]]
     12
     13
     14= 前言 =
     15透過官方頁面得知,若使用以下專案可以免去安裝thrift的困擾
     16[http://wiki.apache.org/cassandra/ClientOptions]
     17
     18 * Cassandra PHP Client Library:
     19[https://github.com/kallaspriit/Cassandra-PHP-Client-Library]
     20
     21
     22
     23
     24
     25
     26
     27{{{
     28#!html
     29<div style="text-align: center; color:red"><big><big>
     30cassandra 1.0 + Thrift 0.7
     31</big></big></div>
     32}}}
     33
    1334 * cassandra 1.0 + Thrift 0.7 為 2011 / 11/ 08 可取得的最新版
    1435 * 官方文件說 cassandra 0.8 搭配 Thrift 0.6 , cassandra 0.7 <-> Thrift 0.5 .. ,沒註明 cassandra 1.0 用哪個版本[http://wiki.apache.org/cassandra/InstallThrift]
    1536
    16  = 環境準備 =
    1737
    1838{{{
     
    2848 * 並非 thrift 必定得放在 cassandra 的目錄底下,而是因為版本有對應關係,因此這樣放比較不會搞錯
    2949
    30  = Cassandra 1.0 安裝 =
    31 
    32  = Thrift 安裝 =
    33 
    3450{{{
    3551
    3652cd /opt/cassandra-1.0.1/thrift-0.7.0
    37 sudo bash ./contrib/fb303/bootstrap.sh
    38 sudo ./configure
    39 sudo make
     53bash ./contrib/fb303/bootstrap.sh
     54./configure
     55make
    4056sudo make install
    4157
    4258}}}
    4359
    44  接著 lib/ 下就有各式各樣語言的資料夾,找到 lib/php/README
     60但從此之後有些怪怪的地方,如沒有
    4561{{{
    46 #!text
    47 #1) Copy all of thrift/lib/php/src into your PHP codebase
    48 #2) Set $GLOBALS['THRIFT_ROOT'] to the path you installed Thrift
    49 #3) include_once $GLOBALS['THRIFT_ROOT'].'/Thrift.php';
     62./compiler/cpp/thrift -gen php ../PATH-TO-CASSANDRA/interface/cassandra.thrift
    5063}}}
    51 
    52 {{{
    53 #!text
    54 $GLOBALS['THRIFT_ROOT']="/opt/cassandra-1.0.1/thrift-0.7.0/lib/php/src";
    55 }}}
     64可以產生 gen-php 的地方,以下的作法使用 thrift 0.6 搭配 cassandra 0.8 可行
     65[https://wiki.fourkitchens.com/display/PF/Using+Cassandra+with+PHP]