zoukankan      html  css  js  c++  java
  • nova-api nova-compute 启动服务的时候有的没有加配置文件有的加了

    nova/nova/cmd/api.py
    from nova import config

    def main():
    config.parse_args(sys.argv)
    logging.setup(CONF, "nova")
    utils.monkey_patch()
    objects.register_all()
    if 'osapi_compute' in CONF.enabled_apis:
    # NOTE(mriedem): This is needed for caching the nova-compute service
    # version which is looked up when a server create request is made with
    # network id of 'auto' or 'none'.
    objects.Service.enable_min_version_cache()
    log = logging.getLogger(__name__)

    gmr.TextGuruMeditation.setup_autorun(version)

    launcher = service.process_launcher()
    started = 0
    for api in CONF.enabled_apis:
    should_use_ssl = api in CONF.enabled_ssl_apis
    try:
    server = service.WSGIService(api, use_ssl=should_use_ssl)
    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."), six.text_type(ex))

    if started == 0:
    log.error(_LE('No APIs were started. '
    'Check the enabled_apis config option.'))
    sys.exit(1)

    launcher.wait()

    nova/nova/config.py

    def parse_args(argv, default_config_files=None, configure_db=True,
    init_rpc=True):
    log.register_options(CONF)
    # We use the oslo.log default log levels which includes suds=INFO
    # and add only the extra levels that Nova needs
    if CONF.glance.debug:
    extra_default_log_levels = ['glanceclient=DEBUG']
    else:
    extra_default_log_levels = ['glanceclient=WARN']
    log.set_defaults(default_log_levels=log.get_default_log_levels() +
    extra_default_log_levels)
    rpc.set_defaults(control_exchange='nova')
    config.set_middleware_defaults()

    CONF(argv[1:], 代码从这里跟进去会用到第三方库,然后会去查找配置文件从etc 下面
    project='nova',
    version=version.version_string(),
    default_config_files=default_config_files)

    if init_rpc:
    rpc.init(CONF)

    if configure_db:
    sqlalchemy_api.configure(CONF)


    每天做好自己该做的事情,你就不会感到迷茫。
  • 相关阅读:
    ASP.NET中的MSChart 控件使用 (示例)
    Win server2003 中 右键IE属性 “无法定位序数325于动态链接库SHDOCVW.dll”
    javascript实现图片左右轮换效果(鼠标控制亦可)
    ASP.NET ServerSide Charting With OWC11——饼状图
    Flex LineChart曲线——动态加载组件
    从公交塞车,看C# 多线程同步问题
    用于.NET环境的时间测试
    ASP.NET中 Repeater嵌套应用
    GridView合并单元格(所有内容相同的单元格)
    JUnit 4 单元测试
  • 原文地址:https://www.cnblogs.com/sosogengdongni/p/10069915.html
Copyright © 2011-2022 走看看