flockdb - 有没有人从git成功构建它并安装它

时间:2011-03-29 14:36:36

标签: install graph-databases flockdb

我尝试从git的源代码构建flockdb,但是无法做到。我使用Mac OSX 10.6并在thrift / boost安装中遇到很多问题。有没有人成功构建并安装它。感谢任何指向执行此操作的信息的指针(flockdb git站点除外)。

另外,我不了解Scala,但是有没有现成的flockdb安装文件可以在Mac / Linux / Windows上安装它?

提前致谢。

2 个答案:

答案 0 :(得分:3)

我刚刚在Ubuntu 12.04下的amazon / ec2机器上成功安装了flockdb。

安装Java 1.6

  • sudo apt-get update
  • sudo apt-get install openjdk-6-jdk

安装Thrift(http://code.google.com/p/thrudb/wiki/UbuntuInstallGuide)

  • 安装构建工具和thrift依赖项:
  • sudo apt-get -y install subversion g++ make flex bison python-dev libboost-dev libevent-dev automake pkg-config libtool make
  • http://archive.apache.org/dist/incubator/thrift/0.5.0-incubating/
  • 下载thrift 0.5.0的副本
  • wget http://archive.apache.org/dist/incubator/thrift/0.5.0-incubating/thrift-0.5.0.tar.gz
  • tar zxvf thrift-0.5.0.tar.gz; cd thrift-0.5.0
  • ./configure
  • make
  • sudo make install
  • 安装ruby客户端
  • cd lib/rb/
  • sudo ruby setup.rb config
  • sudo ruby setup.rb install

安装SBT

REF 脚步

sbt包可从Typesafe Debian存储库获得。

  • 安装deb以将类型安全的debian存储库添加到已批准的源列表中。
  • wget http://apt.typesafe.com/repo-deb-build-0002.deb
  • sudo dpkg -i repo-deb-build-0002.deb
  • sudo apt-get update
  • sudo apt-get install sbt
  • 下载sbt launcher:
  • wget http://simple-build-tool.googlecode.com/files/sbt-launch-0.7.4.jar
  • mv sbt-launch-0.7.4.jar ~/bin/sbt-launch.jar
  • 创建~/bin/sbt文件并将其删除:
  • java -Xmx512M -jar dirname $ 0 /sbt-launch.jar "$@"
  • chmod u+x ~/bin/sbt
  • 修改~/.bashrcexport PATH=${PATH}:$HOME/bin
  • source ~/.bashrc

获取FlockDB

REF 脚步
  • git clone https://github.com/twitter/flockdb.git
  • cd flockdb
  • sbt update。您将看到如下所示的输出。
......
[info] == update ==
[success] Successful.
[info] 
[info] Total time: 213 s, completed Jan 7, 2013 11:02:48 PM
[info] 
[info] Total session time: 267 s, completed Jan 7, 2013 11:02:48 PM
[success] Build completed successfully.
  • 首先构建package-dist而不进行测试:NO_TESTS=1 sbt package-dist。您将看到如下所示的输出。
......
[info] == package-dist ==
[info] Packaging ./dist/flockdb-3e351842.zip ...
[info] Packaging complete.
[info] == package-dist ==
[success] Successful.
[info] 
[info] Total time: 7 s, completed Jan 7, 2013 11:09:51 PM
[info] 
[info] Total session time: 8 s, completed Jan 7, 2013 11:09:51 PM
[success] Build completed successfully.

安装mysql-server

  • sudo apt-get install mysql-server,然后设置env变量:
  • export DB_USERNAME="root"
  • export DB_PASSWORD="password"

构建FlockDB package-dist

  • 如果以上所有内容都成功cd flockdb,请继续尝试sbt package-dist。您将看到如下所示的输出。
[info] Passed: : Total 265, Failed 0, Errors 0, Passed 265, Skipped 0
[info]  
[info] All tests PASSED.
[info] == test-finish ==
[info] 
[info] == test-cleanup ==
[info] == test-cleanup ==
[info] 
[info] == package-dist ==
[info] Packaging ./dist/flockdb-3e351842.zip ...
[info] Packaging complete.
[info] == package-dist ==
[success] Successful.
[info] 
[info] Total time: 137 s, completed Jan 7, 2013 11:47:54 PM
[info] 
[info] Total session time: 138 s, completed Jan 7, 2013 11:47:54 PM
[success] Build completed successfully.

安装gizzmo并启动flockdb

只需按照twitter-flockdb中的教程进行操作:https://github.com/twitter/flockdb/blob/master/doc/demo.markdown

安装python客户端

>>> import flockdb
>>> client = flockdb.Client("localhost", 7915, {
...     "follows": 1,
...     "blocks": 2,
...     })
>>> client.add(1, "follows", 2)
>>> client.remove(1, "follows", 2)
>>> client.get(1, "follows", None)
()
>>> client.add(1, "follows", 2)
>>> client.get(1, "follows", None)
(2,)
>>> client.get(None, "follows", 2)
(1,)
>>> client.get_all([(1, "follows", 2), (2, "follows", 3)])
[(2,), ()]

答案 1 :(得分:1)

我遇到了一些问题,但是当我确定我使用的是FlockDB依赖项的确切版本时,它们得到了解决:

  • java 1.6
  • sbt 0.7.4
  • thrift 0.5.0