CDN
CDN Service
Running a local CDN server with MongoDB
Note: These instructions are for running a local instance of CDN and not all of these steps are required. It is assumed you have MongoDB installed and running.
From your home folder create the
~/.cdn
folder and clone the repo:$ cd $ mkdir .cdn $ git clone https://github.com/rackerlabs/cdn.git
Copy the CDN config files to the directory
~/.cdn
:$ cp cdn/etc/cdn.conf-sample ~/.cdn/cdn.conf $ cp cdn/etc/logging.conf-sample ~/.cdn/logging.conf
Find the
[drivers:storage:mongodb]
section in~/.cdn/cdn.conf
and modify the URI to point to your local mongod instance:uri = mongodb://$MONGODB_HOST:$MONGODB_PORT
For logging, find the
[DEFAULT]
section in~/.cdn/cdn.conf
and modify as desired:log_file = server.log
Change directories back to your local copy of the repo:
$ cd cdn
Run 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 CDN server:
$ cdn-server
Test out that CDN is working by requesting the home doc:
$ curl -i -X GET http://127.0.0.1:8888/v1/
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