Я только что успешно установил flockdb на машине amazon / ec2 под Ubuntu 12.04.
Установить Java 1.6
sudo apt-get update
sudo apt-get install openjdk-6-jdk
Установить SBT
ссылка
меры
Пакет sbt доступен в репозитории Typesafe Debian.
Get FlockDB
ссылка
меры
......
[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.
Установить MySQL-сервер
sudo apt-get install mysql-server
, затем установка переменных env:
export DB_USERNAME="root"
export DB_PASSWORD="password"
Сборка пакета FlockDB-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,), ()]