Monday, April 13, 2015

Inkscope and ceph-rest-api (edited)

Edited 2015/04/13: found a better way for apache configuration (proxypass vs rewrite)

Inkscope is essentially based on the use of the ceph-rest-api.

There are two ways to access the ceph-rest-api :
  • as a standalone server.
  • as an Apache WSGI application. 


ceph-rest-api standalone server

You can start a standalone instance form the command line:
nohup ceph-rest-api -i admin&


In this case, inkscope configuration uses the proxy feature of apache. For this the typical inkscope.cong for apache is:



ceph-rest-api as a WSGI application

A better way is to make ceph-rest-api part of the inkscope server by launching ceph-rest-api as an apache wsgi application.

You need to create a ceph user named client.restapi with caps : [mds] allow, [mon] allow * , [osd] allow *
sudo ceph auth get-or-create client.restapi mds 'allow' osd 'allow *' mon 'allow *' > /etc/ceph/ceph.client.restapi.keyring

Then you need to add the following section in your \<cluster\>.conf:
[client.restapi]
    log_file = /dev/null
    keyring = /etc/ceph/ceph.client.restapi.keyring

After that, you need to add the following lines to your Apache inkscope.conf :
WSGIScriptAlias /ceph_rest_api /var/www/inkscope/inkscopeCtrl/ceph-rest-api.wsgi<Directory "/var/www/inkscope/inkScopeCtrl">
       Require all granted
</Directory>
        ProxyRequests Off  # we want  a "Reverse proxy"
        ProxyPass /ceph-rest-api/ http://<inkscope_host>:<inkscope_port>/ceph_rest_api/api/v0.1/

 


You need to restart apache:
service apache2 restart

When this is done, you will have to modify the file /opt/inkscope/etc/inkscope.conf:

"ceph_rest_api": "ceph_rest_api_host:5000",
"ceph_rest_api_subfolder": "",
to
"ceph_rest_api": "inkscope_host:inkscope_port",
"ceph_rest_api_subfolder": "ceph_rest_api",

1 comment:

  1. It is not tested yet with Infernalis.
    So I don't know if it will work with it.

    ReplyDelete