3.1 KiB
Installing Poppy
Note: These instructions are for running a local instance of Poppy. We suggest you run this inside a virtualenv.
You must have CassandraDB installed and running. We recommend using Docker (see below)
From your home folder, create the
~/.poppyfolder and clone the repo:$ cd $ mkdir .poppy $ git clone https://github.com/stackforge/poppy.gitCopy the Poppy config files to the directory
~/.poppy:$ cp poppy/etc/poppy.conf ~/.poppy/poppy.conf $ cp poppy/etc/logging.conf ~/.poppy/logging.confFind the
[drivers:storage:cassandradb]section in~/.poppy/poppy.confand modify the URI to point to your local casssandra cluster:[drivers:storage:cassandra] cluster = "localhost" keyspace = poppyYou need to create the default keyspace "poppy" on your cassandra host/cluster. Log into cqlsh, do:
cqlsh> CREATE KEYSPACE poppy WITH REPLICATION = { 'class' : 'SimpleStrategy' , 'replication_factor' : 1} ;For logging, find the
[DEFAULT]section in~/.poppy/poppy.confand modify as desired:log_file = server.logChange directories back to your local copy of the repo:
$ cd poppyRun the following command so you can see the results of any changes you make to the code without having to reinstall the package each time:
$ pip install -e .Start the Poppy server:
$ poppy-serverTest that Poppy is working by requesting the home doc (with a sample project ID):
$ curl -i -X GET http://0.0.0.0:8888/v1.0/123You should get an HTTP 200 along with some headers that look similar to the following example:
HTTP/1.0 200 OK Date: Thu, 13 Feb 2014 14:34:21 GMT Server: WSGIServer/0.1 Python/2.7.3 Content-Length: 464 Content-Type: application/json-home Cache-Control: max-age=86400
Installing CassandraDB (using Docker)
From the docker/cassandra folder:
$ docker build -t db .Open the 9160 and 9042 ports for Cassandra. Name the container 'cassandra':
$ docker run -d -p 9160:9160 -p 9042:9042 --name cassandra dbTest the running cassandra instance (you may need to
pip install cqlsh):$ cqlsh <local ip> 9160Where local ip is the ip address of your running docker container
Import the schema file from the poppy/storage/cassandra/schema.cql file.