[sheepdog] add http transport stub

MORITA Kazutaka morita.kazutaka at gmail.com
Wed Jul 3 02:53:31 CEST 2013


At Tue,  2 Jul 2013 00:35:26 +0800,
Liu Yuan wrote:
> 
> This patch set adds transport stub, on top of which we can build Swift or Amazon
> S3 service.
> 
> Only HTTP GET/PUT/POST/HEAD/DELETE (RESTful API) is allowd to interface with
> sheepdog storage.
> 
> The transport is implemented via fastcgi in the address space of sheepdog to
> favor performance. It is currently disabled at compile time.
> 
> How To Test:
> 
> 1 install libfcgi-dev and nginx
> 2 ./configure --enable-http
> 3 run nginx as following:
>   # edit ~/nginx.conf as following:
> =======================================================
> events {
> 	worker_connections 1024;
> }
> 
> http {
> 	server {
> 		listen 80;
> 		server_name localhost;
> 
> 		location / {
> 			fastcgi_pass   localhost:7100;
> 
> 			fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
> 			fastcgi_param   REQUEST_METHOD          $request_method;
> 			fastcgi_param	CONTENT_LENGTH		$content_length;
> 			fastcgi_param   HTTP_RANGE              $http_range;
> 		}
> 	}
> }
> =======================================================
>   # nginx -c ~/nginx.conf
> 4 sheep/sheep -d -f -o store/ -c local -r localhost:7100
> 5 use curl to test:
>   $ curl -v -X GET http://localhost/test # issue a get request
>   $ curl -v -X PUT -d "hello" http://localhost/test # issue a put request

Thanks a lot.  I like this simple implementation.

However, Joseph suggests using libmicrohttpd in the other thread.  Can
you explain why you adopt FastCGI and Nginx?

Thanks,

Kazutaka



More information about the sheepdog mailing list