我目前在一个Openstack项目中,我正在尝试使用Ceilometer和Gnocchi。我在local.conf
文件中使用以下几行安装了DevStack,以安装和配置Ceilometer和Gnocchi:
enable_plugin gnocchi https://github.com/gnocchixyz/gnocchi master
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer
enable_service gnocchi-grafana
安装成功,已与ceilometer和gnocchi用户一起创建了Metric服务。Ceilometer和Gnocchi配置文件的[keystone_authtoken]
部分显然设置正确,我在Ceilometer配置文件中将Gnocchi设置为仪表调度器。
但是使用与metric
参数相关的命令,比如openstack metric status
,我得到了一个403错误,尽管我之前已经找到了admin-openrc.sh
文件。我尝试了2.0和3API两个版本。
我以为在OpenStack中添加admin用户作为service
项目的成员和admin就可以解决这个问题,但是我仍然收到这个错误。
我查看了与gnocchi相关的Apache日志:-在/var/log/apache2/gnocchi.log
中有“客户端被服务器配置拒绝: /usr/local/bin/gnocchi-api”错误,-在var/log/apache2/gnocchi-acces.log
中有403个这样的错误:
10.0.3.29 - - [28/Jul/2017:16:24:34 +0300] "POST /v1/batch/resources/metrics/measures?create_metrics=True HTTP/1.1" 403 501 "-" "ceilometer-agent-notification keystoneauth1/3.1.0 python-requests/2.18.2 CPython/2.7.12"
10.0.3.29 - - [28/Jul/2017:16:24:34 +0300] "PATCH /v1/resource/image/bc130fad-36f6-48a5-852b-b78e41863d09 HTTP/1.1" 403 520 "-" "ceilometer-agent-notification keystoneauth1/3.1.0 python-requests/2.18.2 CPython/2.7.12"
是不是有什么我没注意到的配置错误?
如果你想要更多的信息,尽管问我。
谢谢你的帮助。
发布于 2017-09-21 07:07:19
基于OpenStack here问答的回答
目前,/etc/apache2/sites-available/gnocchi.conf
的以下配置可以正常工作:
Listen 8041
<VirtualHost *:8041>
WSGIDaemonProcess gnocchi lang='en_US.UTF-8' locale='en_US.UTF-8' user=stack display-name=%{GROUP} processes=2 threads=32
WSGIProcessGroup gnocchi
WSGIScriptAlias / /usr/local/bin/gnocchi-api
WSGIApplicationGroup %{GLOBAL}
<IfVersion >= 2.4>
ErrorLogFormat "%{cu}t %M"
</IfVersion>
<Directory />
Options FollowSymLinks
AllowOverride None
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
ErrorLog /var/log/apache2/gnocchi.log
CustomLog /var/log/apache2/gnocchi-access.log combined
</VirtualHost>
WSGISocketPrefix /var/run/apache2
在service apache2 restart
之后,命令gnocchi status
的输出如下:
$ gnocchi status
+-----------------------------------------------------+-------+
| Field | Value |
+-----------------------------------------------------+-------+
| storage/number of metric having measures to process | 0 |
| storage/total number of measures to process | 0 |
+-----------------------------------------------------+-------+
与以前不同:
$ gnocchi status
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /v1/status
on this server.<br />
</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at 10.92.76.44 Port 8041</address>
</body></html>
(HTTP 403)
https://stackoverflow.com/questions/45374863
复制相似问题