This patch implements the register/deregister/lookup operations for the sharding manager. As a result of this patch, the sharding driver now takes the control driver as a paramater. This gives it the access needed to make decisions about queue placement (and lookups) based on the entries in the control plane. In order to get the sharding manager working correctly, several methods had to be overridden to properly handle the QueueNotMapped error. When a QueueNotMapped error is encountered under normal conditions, it is equivalent to the target resource not being found. The overrides mimic the default behavior of those controllers' methods in the case where the queue isn't found. An inconsistency was found between the base storage driver and the concrete implementations. message_controller.list did not provide an include_claimed parameter. This has been corrected. To avoid DuplicateOptErrors in the mongodb driver in a sharded context, a filtering algorithm is applied. To make it clear to data drivers that they need to apply this filtering algorithm, conf.dynamic is set by the sharding driver. Unit tests have been added for the weighted select algorithm. Up next: sharded queue listing support, caching Change-Id: Ic36cd657ba13fa4c0b624dc5c71bfe99f9a70139 Partitally-implements: blueprint storage-sharding
Marconi
Message queuing service for OpenStack
Running a local Marconi server with MongoDB
Note: These instructions are for running a local instance of Marconi and not all of these steps are required. It is assumed you have MongoDB installed and running.
From your home folder create the
~/.marconifolder and clone the repo:$ cd $ mkdir .marconi $ git clone https://github.com/openstack/marconi.gitCopy the Marconi config files to the directory
~/.marconi:$ cp marconi/etc/marconi-proxy.conf-sample ~/.marconi/marconi-proxy.conf $ cp marconi/etc/marconi-queues.conf-sample ~/.marconi/marconi-queues.conf $ cp marconi/etc/logging.conf-sample ~/.marconi/logging.confFind the
[drivers:storage:mongodb]section in~/.marconi/marconi-queues.confand modify the URI to point to your local mongod instance:uri = mongodb://$MONGODB_HOST:$MONGODB_PORTFor logging, find the
[DEFAULT]section in~/.marconi/marconi-queues.confand modify as desired:log_file = server.logChange directories back to your local copy of the repo:
$ cd marconiRun the following 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 Marconi server:
$ marconi-serverTest out that Marconi is working by creating a queue:
$ curl -i -X PUT http://127.0.0.1:8888/v1/queues/samplequeue -H "Content-type: application/json" -d '{"metadata": "Sample Queue"}'
You should get an HTTP 201 along with some headers that will look similar to this:
HTTP/1.0 201 Created
Date: Fri, 25 Oct 2013 15:34:37 GMT
Server: WSGIServer/0.1 Python/2.7.3
Content-Length: 0
Location: /v1/queues/samplequeue