当前位置: 首页 > 工具软件 > Glance Specs > 使用案例 >

Liberty glance 新功能 healthcheck

姚阳德
2023-12-01

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

 



转载于:https://www.cnblogs.com/allcloud/p/4901496.html

 类似资料: