Changes between Version 8 and Version 9 of waue/2011/1107
- Timestamp:
- Nov 9, 2011, 4:41:17 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
waue/2011/1107
v8 v9 10 10 11 11 }}} 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> 30 cassandra 1.0 + Thrift 0.7 31 </big></big></div> 32 }}} 33 13 34 * cassandra 1.0 + Thrift 0.7 為 2011 / 11/ 08 可取得的最新版 14 35 * 官方文件說 cassandra 0.8 搭配 Thrift 0.6 , cassandra 0.7 <-> Thrift 0.5 .. ,沒註明 cassandra 1.0 用哪個版本[http://wiki.apache.org/cassandra/InstallThrift] 15 36 16 = 環境準備 =17 37 18 38 {{{ … … 28 48 * 並非 thrift 必定得放在 cassandra 的目錄底下,而是因為版本有對應關係,因此這樣放比較不會搞錯 29 49 30 = Cassandra 1.0 安裝 =31 32 = Thrift 安裝 =33 34 50 {{{ 35 51 36 52 cd /opt/cassandra-1.0.1/thrift-0.7.0 37 sudobash ./contrib/fb303/bootstrap.sh38 sudo./configure39 sudomake53 bash ./contrib/fb303/bootstrap.sh 54 ./configure 55 make 40 56 sudo make install 41 57 42 58 }}} 43 59 44 接著 lib/ 下就有各式各樣語言的資料夾,找到 lib/php/README 60 但從此之後有些怪怪的地方,如沒有 45 61 {{{ 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 50 63 }}} 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]