问题
I tried building flockdb from the sources from git, but couldn't do it. Am using Mac OSX 10.6 and getting lot of issues in thrift/boost installations. Has anyone successfully build it and installed it. Appreciate any pointer to information on doing this (except the one from flockdb git site).
Also, I don't know about Scala, but is there any readily available flockdb installation file to install it on Mac/Linux/Windows?
Thanks in advance.
回答1:
I just successfully installed flockdb on an amazon/ec2 machine under Ubuntu 12.04.
Install Java 1.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
Install Thrift (http://code.google.com/p/thrudb/wiki/UbuntuInstallGuide)
- install build tools and thrift dependencies:
sudo apt-get -y install subversion g++ make flex bison python-dev libboost-dev libevent-dev automake pkg-config libtool make
- download a copy of thrift 0.5.0 from: http://archive.apache.org/dist/incubator/thrift/0.5.0-incubating/
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
- Install ruby client
cd lib/rb/
sudo ruby setup.rb config
sudo ruby setup.rb install
Install SBT
ref- https://github.com/harrah/xsbt/wiki/Getting-Started-Setup
- http://www.scala-sbt.org/0.7.7/docs/Setup.html
The sbt package is available from the Typesafe Debian Repository.
- Install the deb to add the typesafe debian repository to your list of approved sources.
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
- download 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
- create
~/bin/sbt
file and make it excutable: java -Xmx512M -jar
dirname $0/sbt-launch.jar "$@"
chmod u+x ~/bin/sbt
- modify
~/.bashrc
:export PATH=${PATH}:$HOME/bin
source ~/.bashrc
Get FlockDB
ref- https://github.com/twitter/flockdb/blob/master/README.markdown
- https://github.com/twitter/flockdb/blob/master/doc/demo.markdown
git clone https://github.com/twitter/flockdb.git
cd flockdb
sbt update
. You will see the outputs like below.
...... [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.
- build package-dist without test first:
NO_TESTS=1 sbt package-dist
. You will see the outputs like below.
...... [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.
Install mysql-server
sudo apt-get install mysql-server
, then setting env variables:export DB_USERNAME="root"
export DB_PASSWORD="password"
Build FlockDB package-dist
- if all above succeed,
cd flockdb
and go ahead to trysbt package-dist
. You will see the outputs like below.
[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.
Install gizzmo and start flockdb
Just follow the tutorial in twitter-flockdb: https://github.com/twitter/flockdb/blob/master/doc/demo.markdown
Install python client
sudo apt-get install python-setuptools
sudo python setup.py install
for below two python modules- Install thrift python client: http://pypi.python.org/pypi/thrift/0.9.0
- Install flockdb python client: https://github.com/pyronicide/python-flockdb/blob/master/README.md
>>> 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,), ()]
回答2:
I ran into some issues too, but they were resolved when I made sure that I was using the exact versions for FlockDB's dependencies:
- java 1.6
- sbt 0.7.4
- thrift 0.5.0
来源:https://stackoverflow.com/questions/5474273/flockdb-has-anyone-successfully-build-it-from-git-and-installed-it