[Openstack] [Ceilometer] v2 pecan api with uwsgi
Chris Dent
chdent at redhat.com
Thu Jun 4 12:24:39 UTC 2015
On Mon, 4 May 2015, Sam Morrison wrote:
> We have upgraded our ceilometer setup to Juno and we can no longer get it working under UWSGI.
>
> The reason it does’t work is that it looks like the V2 pecan API doesn’t support auth and so there is no keystone middleware.
>
> Has anyone got ceilometer working behind uwsgi with keystone support?
As promised, I've finally gotten around to testing this and doing
some poking around. The short answer is I think you might have a
a bad /etc/ceilometer/api_paste.ini, related to this change
https://review.openstack.org/#/c/102353/
Another option is that your api_paste.ini isn't getting read for
some reason.
The longer answer is "works for me" but I'm using master. Here's how
I tested it:
Made a devstack with ceilometer-api running in the usual fashion and
tested it as follows (checkceilo.yaml is attached, gabbi is here[1]):
$ . openrc admin admin
$ TOKEN=$(openstack token issue -c id -f value)
$ # confirm auth behaves as expected
$ cat /tmp/checkceilo.yaml |sed -e "s/\$TOKEN/${TOKEN}/g" | \
gabbi-run localhost:8777
$ # kill ceilometer-api in whatever fashion \
(depends on how you sarted it)
$ # start uwsgi standalone of ceilo wsgi ap
$ uwsgi --http-socket :8777 --plugin python \
--wsgi-file /var/www/ceilometer/app
$ # confirm again
$ cat /tmp/checkceilo.yaml |sed -e "s/\$TOKEN/${TOKEN}/g" | \
gabbi-run localhost:8777
For me that all works as expected. If your uwsgi setup (if, for
example you are using emperor) is changing users or changing working dirs
I wouldn't be surprised if it is losing track of where the
ceilometer config is. However this ought to cause an error so an out
of date paste file seems more likely.
If none of that gets it then let me know more about your setup so I
can duplicate it more correctly because the configuration you're
using ought to work (and is definitely the best choice if you have
the option, in my experience) and if it doesn't we should fix it.
[1] http://gabbi.readthedocs.org/en/latest/
--
Chris Dent tw:@anticdent freenode:cdent
https://tank.peermore.com/tanks/cdent
-------------- next part --------------
tests:
- name: no auth
url: /v2/meters
status: 401
- name: bad auth
url: /v2/meters
request_headers:
x-auth-token: 0123456789abcde0123456789abcde01
status: 401
- name: good auth
url: /v2/meters
request_headers:
x-auth-token: $TOKEN
response_headers:
content-type: /application/json/
status: 200
More information about the Openstack
mailing list