oslo.middleware‘s healthcheck
http://specs.openstack.org/openstack/oslo-specs/specs/kilo/oslo-middleware-healthcheck.html
http://docs.openstack.org/developer/oslo.middleware/api.html
Openstack API endpoints是否可用
For API endpoint that rely on a backend,仅仅check api还是不够的,如nova api在DB不可用的时候仍然可以返回200
实现为一个wsgi middleware 所有 openstack components都可以用
[filter:healthcheck] paste.filter_factory = oslo.middleware.healthcheck:Healthcheck path = /healthcheck (default) backends = database,disable_by_file (optional, default: empty) # used by the 'disable_by_file' backend disable_by_file_path = /var/run/nova/healthcheck_disable (optional, default: empty)
“backends” will the name of a stevedore extentions in the namespace “oslo.middleware.healthcheck”.
[entry_points] healthcheck = database = oslo.db:DBHealthcheck disable_by_file = oslo.middleware.healthcheck:DisableByFileHealthcheck
如果config配置了disable_by_file,而且该文件存在则返回503 DISABLED BY FILE
[filter:healthcheck] paste.filter_factory = oslo_middleware:Healthcheck.factory backends = disable_by_file disable_by_file_path = /etc/glance/healthcheck_disable