我尝试从git的源代码构建flockdb,但是无法做到。我使用Mac OSX 10.6并在thrift / boost安装中遇到很多问题。有没有人成功构建并安装它。感谢任何指向执行此操作的信息的指针(flockdb git站点除外)。
另外,我不了解Scala,但是有没有现成的flockdb安装文件可以在Mac / Linux / Windows上安装它?
提前致谢。
答案 0 :(得分:3)
我刚刚在Ubuntu 12.04下的amazon / ec2机器上成功安装了flockdb。
sudo apt-get update
sudo apt-get install openjdk-6-jdk
sudo apt-get -y install subversion g++ make flex bison python-dev libboost-dev libevent-dev automake pkg-config libtool make
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
cd lib/rb/
sudo ruby setup.rb config
sudo ruby setup.rb install
sbt包可从Typesafe 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
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
~/.bashrc
:export PATH=${PATH}:$HOME/bin
source ~/.bashrc
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.
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.
sudo apt-get install mysql-server
,然后设置env变量:export DB_USERNAME="root"
export DB_PASSWORD="password"
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.
只需按照twitter-flockdb中的教程进行操作:https://github.com/twitter/flockdb/blob/master/doc/demo.markdown
sudo apt-get install python-setuptools
sudo python setup.py install
以下两个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依赖项的确切版本时,它们得到了解决: