2017-07-28 110 views
0

我目前在一個OpenStack項目上,我正在嘗試使用Ceilometer和Gnocchi。我已經安裝了DevStack與在local.conf文件中的以下行來安裝和配置雲高儀和麪疙瘩:[DevStack] [Ceilometer] [Gnocchi] Error 403

enable_plugin gnocchi https://github.com/gnocchixyz/gnocchi master 
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer 
enable_service gnocchi-grafana 

安裝成功,度量服務已經與雲高計和湯糰用戶一起創建。 Ceilometer和Gnocchi配置文件的​​部分顯然是正確設置的,我將Gnocchi設置爲Ceilometer配置文件中的電錶調度器。

但與metric參數有關的命令,如openstack metric status我得到一個403錯誤,雖然我採購了admin-openrc.sh文件。我嘗試了兩個版本2.0和3 API。

我認爲在OpenStack中添加admin用戶作爲service項目的成員和管理員可以解決問題,但我仍然收到錯誤消息。

我通過涉及麪疙瘩的Apache日誌看: - 在/var/log/apache2/gnocchi.log有「客戶端通過服務器配置否認:在/ usr/local/bin目錄/湯糰-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" 

是否有任何錯誤配置,我沒有注意到?

如果您想了解更多信息,只需問我一下。

感謝您的幫助。

回答

0

基於答案自Q &一個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 

的命令gnocchi statusservice apache2 restart輸出如下:

$ 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)