In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how ocata starts nova-api service", the content is simple and easy to understand, the organization is clear, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how ocata starts nova-api service" this article.
To start the nova api service, you need to call the nova-api command, which ultimately calls the main method in the nova.cmd.api module.
main method parsing of nova-api command: def main (): config. parse_args (sys.argv)#This method parses arguments (sys.argv) passed in from the command line, and parameter management of the configuration file is managed using the oslo.config module. logging. setup (CONF,"nova ")#Call solo.log module to create log space for nova domain utils. monkey_patch ()#This method determines whether to patch certain modules based on the monkey_path parameter in the configuration file. objects. register_all ()#Register all required module objects if 'osapi_compute' in CONF. enabled_apis: #This is necessary to cache the nova-compute service version that will be looked up when a server creation request is made with a network ID of 'auto' or 'none.' objects.Service.enable_min_version_cache() log = logging. getLogger (__name__)#build get logger gmr. TextGuruMeditation. setup_autorun (version)#Use the oslo.reports module to manage collecting error reports launcher = service. process_launcher ()#Get a service startup instance of the oslo.service module started = 0 for api in CONF. enabled_apis: #defines api-paste. ini two default sections, osapi_compute, metadata should_use_ssl = api in CONF.enabled_ssl_apistry: server = service. WSGIService (api, use_ssl = should_use_ssl)#Traverse the wsgi service instance, and the app will be loaded according to the api-paste.ini configuration file launcher.launch_service(server, workers=server.workers or 1) started += 1 except exception.PasteAppNotFound as ex: log.warning( _LW("%s. ``enabled_apis`` includes bad values. " "Fix to remove this warning. "), ex)if started == 0: log.error(_LE('No APIs were started. ' 'Check the enabled_apis config option. ')) sys.exit(1) launcher.wait ()#Service blocking api-paste.ini parsing:
PasteDeploy assembles functions together in a modular manner through file configuration. The advantage of doing so is that it is convenient to assemble and disassemble after each functional characteristic is divided into blocks, which plays a role of loose coupling.
############# Metadata #############[composite:metadata]use = egg:Paste#urlmap #Call urlmap of paste module to forward URL, one of the default values of enabled_apis in configuration file is metadata/: meta #Forward the path of/to [pipeline: meta] for processing. The: sign can also be replaced by a = sign to map [pipeline: meta] pipeline = cor metaapp [app: metaapp] paste.app_factory = nova. api. metadata. handler: MetadataRequestHandler. factory ############OpenStack ###############nova. api. openstack. urlmap: urlmap_factory #Here nova customizes the urlmap factory to handle URLs, and one of the default values for enabled_apis in the configuration file is osapi_compute/: oscomputations #Forwarding the path of/to [pipeline: oscomputations] processing #v21 is an exact match to v2, but it has stricter input validation on the wsgi surface (to prevent early API fuzzification)# It also offers new functionality through API micro-versions, which are available for customer selection. Unwitting clients will receive the same frozen v2 API feature set, but with some lax validation/v2: openstack_compute_api_v21_legacy_v2_compatible #Turn the url that starts with/v2 to [composite: openstack_compute_api_v21_legacy_v2_compatible] processing/v2.1: openstack_compute_api_v21 #Go url at the beginning of/v2.1 to [composite: openstack_compute_api_v21] handle [composite: openstack_compute_api_v21]#Call custom composite factory method. The method will decide which of the following applications to load according to the authentication policy of the configuration file. Keystone is loaded by default, or auth_strategy in the configuration file can be set to noauth 3. use = call: nova. api. auth: pipeline_factory_v21#The difference between noauth 3 and keystone configurations is the two authentication filters noauth 3 and authtoken. authtoken will first perform keystone login verification noauth 3 = cor http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler noauth 3 osapi_compute_app_v21 keystone = cor http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler authtoken keystonecontext osapi_compute_app_v21 [composite: openstack_compute_api_v21_legacy_v2_compatible] use = call: nova. api. auth: pipeline_factory_v21noauth3 = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler noauth3 legacy_v2_compatible osapi_compute_app_v21keystone = cors http_proxy_to_wsgi compute_req_id faultwrap sizelimit osprofiler authtoken keystonecontext legacy_v2_compatible osapi_compute_app_v21 [filter: request_id]#This ensures that each API request is assigned a request ID and set to the request environment. The request ID is also added to the API response. paste. filter_factory = oslo_middleware: RequestId. factory #Middleware that ensures request ID [filter: compute_req_id]#It ensures that request ID is assigned to each api requesting to compute service and set to request environ. The request ID is also added to the API response. paste. filter_factory = nova. api. compute_req_id: ComputeReqIdMiddleware. factory [filter: faultwrap] paste. filter_factory = nova. api. openstack: FaultWrapper. factory [filter: noauth 3] paste. filter_factory = nova. profiler: WsgiMiddleware. factory [filter: sizelimit] paste. filter_factory = oslo_middleware: RequestBodySizeiter. factory #Middleware that limits the size of incoming requests. [filter: http_proxy_to_wsgi]#This middleware overloads the WSGI environment variable with environment variables provided by the remote HTTP reverse proxy. paste. filter_factory = oslo_middleware. http_proxy_to_wsgi: HTTPProxyToWSGI. factory #HTTP proxy to WSGI termination middleware. [filter: legacy_v2_compatible] paste. filter_factory = nova. api. openstack: legacyV2Compatible Wrapper.factory [app: osapi_compute_app_v21] paste.app_factory = nova. api. openstack. compute: APIRouterV21.factory [pipeline: oscomputationapps] pipeline = cors faultwrap http_proxy_to_wsgi oscomputationapp [app: oscomputationapp] paste.app_factory = nova. api. openstack. compute. versions: Versions. factory ##########Shared ##############[filter: cor]#This middleware allows WSGI applications to provide CORS headers for multiple configured domains. paste. filter_factory = oslo_middleware. cor: filter_factory #CORS middleware oslo_config_project = nova [filter: keystonecontext] paste. filter_factory = nova. api. auth: NovaKeystoneContext. factory [filter: authtoken] paste. filter_factory = keystonemiddling. auth_token: filter_factory The above is "ocata how to start nova-api service" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.