手机版
你好,游客 登录 注册
背景:
阅读新闻

使用Bosh在OpenStack上部署CloudFoundry碰到的问题

[日期:2013-09-23] 来源:Linux社区  作者:tiger435 [字体:大 中 小]

2.2、部署Bosh时的RateLimit报错问题

Error 100: Expected([200, 202]) <=> Actual(413 Request Entity Too Large)
  request => {:connect_timeout=>60, :headers=>{"Content-Type"=>"application/json", "X-Auth-Token"=>"23bc718661d54252aba2d9c348c264e3", "Host"=>"10.68.19.61:8774", "Content-Length"=>44}, :instrumentor_name=>"excon", :mock=>false, :nonblock=>true, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/var/vcap/packages/director/bosh/director/vendor/bundle/ruby/1.9.1/gems/excon-0.16.2/data/cacert.pem", :ssl_verify_peer=>true, :write_timeout=>60, :host=>"10.68.19.61", :path=>"/v2/8cf196acd0494fb0bc8d04e47ff77893/servers/046ac2d3-09b5-4abe-ab61-64b33d1348e1/action.json", :port=>"8774", :query=>"ignore_awful_caching1366685706", :scheme=>"http", :body=>"{\"addFloatingIp\":{\"address\":\"10.68.19.132\"}}", :expects=>[200, 202], :method=>"POST"}
  response => #<Excon::Response:0x000000044862d8 @body="{\"overLimit\": {\"message\": \"This request was rate-limited.\", \"code\": 413, \"retryAfter\": \"2\", \"details\": \"Only 10 POST request(s) can be made to * every minute.\"}}", @headers={"Retry-After"=>"2", "Content-Length"=>"161", "Content-Type"=>"application/json; charset=UTF-8", "Date"=>"Tue, 23 Apr 2013 02:55:06 GMT"}, @status=413>

查看Openstack文档,可以看到一下Limit信息:

Table 4.15. Default API Rate Limits
HTTP method API URI API regular expression Limit
POST any URI (*) .* 10 per minute
POST /servers ^/servers 50 per day
PUT any URI (*) .* 10 per minute
GET *changes-since* .*changes-since.* 3 per minute
DELETE any URI (*) .* 100 per minute

解决办法(修改所有计算节点上的nova配置:/etc/nova/api-paste.ini):

 

1、去掉Compute API Rate Limiting配置

[composite:openstack_compute_api_v2]
use = call:nova.api.auth:pipeline_factory
noauth = faultwrap sizelimit noauth ratelimit osapi_compute_app_v2
keystone = faultwrap sizelimit authtoken keystonecontext ratelimit osapi_compute_app_v2
keystone_nolimit = faultwrap sizelimit authtoken keystonecontext osapi_compute_app_v2

[composite:openstack_volume_api_v1]
use = call:nova.api.auth:pipeline_factory
noauth = faultwrap sizelimit noauth ratelimit osapi_volume_app_v1
keystone = faultwrap sizelimit authtoken keystonecontext ratelimit osapi_volume_app_v1
keystone_nolimit = faultwrap sizelimit authtoken keystonecontext osapi_volume_app_v1

去掉其中的ratelimit的filter即可。

 

2、修改Compute API Rate Limiting Value,在[filter:ratelimit]下增加limits配置并修改其中的值,如下代码:

[filter:ratelimit]
paste.filter_factory = nova.api.openstack.compute.limits:RateLimitingMiddleware.factory
limits =(POST, "*", .*, 10, MINUTE);(POST, "*/servers", ^/servers, 50, DAY);(PUT, "*", .*, 10, MINUTE);(GET, "*changes-since*", .*changes-since.*, 3, MINUTE);(DELETE, "*", .*, 100, MINUTE)

修改完之后重启nova-api服务,参考Openstack官方文档:http://docs.openstack.org/essex/openstack-compute/admin/content/configuring-compute-API.html#d6e1844

linux
相关资讯       OpenStack  CloudFoundry 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款