示例#1
0
def collector_service():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(
        collector.CollectorService(),
        workers=service.get_workers('collector'))
    launcher.wait()
示例#2
0
def agent_notification():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(
        notification.NotificationService(),
        workers=service.get_workers('notification'))
    launcher.wait()
示例#3
0
def agent_notification():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(
        notification.NotificationService(),
        workers=service.get_workers('notification'))
    launcher.wait()
示例#4
0
def collector_service():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(collector.CollectorService(cfg.CONF.host,
                                                       'ceilometer.collector'),
                            workers=service.get_workers('collector'))
    launcher.wait()
示例#5
0
def setup_app(pecan_config=None, extra_hooks=None):
    # FIXME: Replace DBHook with a hooks.TransactionHook
    app_hooks = [hooks.ConfigHook(),
                 hooks.DBHook(),
                 hooks.NotifierHook(),
                 hooks.TranslationHook()]
    if extra_hooks:
        app_hooks.extend(extra_hooks)

    if not pecan_config:
        pecan_config = get_pecan_config()

    pecan.configuration.set_config(dict(pecan_config), overwrite=True)

    # NOTE(sileht): pecan debug won't work in multi-process environment
    pecan_debug = CONF.api.pecan_debug
    if service.get_workers('api') != 1 and pecan_debug:
        pecan_debug = False
        LOG.warning(_LW('pecan_debug cannot be enabled, if workers is > 1, '
                        'the value is overrided with False'))

    app = pecan.make_app(
        pecan_config.app.root,
        debug=pecan_debug,
        force_canonical=getattr(pecan_config.app, 'force_canonical', True),
        hooks=app_hooks,
        wrap_app=middleware.ParsableErrorMiddleware,
        guess_content_type_from_ext=False
    )

    return app
示例#6
0
def agent_notification():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(notification.NotificationService(
        cfg.CONF.host, 'ceilometer.agent.notification'),
                            workers=service.get_workers('notification'))
    launcher.wait()
示例#7
0
def build_server():
    app = load_app()
    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port

    LOG.info(_('Starting server in PID %s') % os.getpid())
    LOG.info(_("Configuration:"))
    cfg.CONF.log_opt_values(LOG, logging.INFO)

    if host == '0.0.0.0':
        LOG.info(
            _('serving on 0.0.0.0:%(sport)s, view at http://127.0.0.1:%(vport)s'
              ) % ({
                  'sport': port,
                  'vport': port
              }))
    else:
        LOG.info(
            _("serving on http://%(host)s:%(port)s") % ({
                'host': host,
                'port': port
            }))

    workers = service.get_workers('api')
    serving.run_simple(cfg.CONF.api.host,
                       cfg.CONF.api.port,
                       app,
                       processes=workers)
示例#8
0
def collector_service():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(
        collector.CollectorService(),
        workers=service.get_workers('collector'))
    launcher.wait()
示例#9
0
def agent_notification():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(
        notification.NotificationService(cfg.CONF.host,
                                         'ceilometer.agent.notification'),
        workers=service.get_workers('notification'))
    launcher.wait()
示例#10
0
def collector_service():
    service.prepare_service()
    launcher = os_service.ProcessLauncher()
    launcher.launch_service(
        collector.CollectorService(cfg.CONF.host,
                                   'ceilometer.collector'),
        workers=service.get_workers('collector'))
    launcher.wait()
示例#11
0
def build_server():
    app = load_app()
    # Create the WSGI server and start it
    host, port = cfg.CONF.api.host, cfg.CONF.api.port

    LOG.info(_('Starting server in PID %s') % os.getpid())
    LOG.info(_("Configuration:"))
    cfg.CONF.log_opt_values(LOG, logging.INFO)

    if host == '0.0.0.0':
        LOG.info(_(
            'serving on 0.0.0.0:%(sport)s, view at http://127.0.0.1:%(vport)s')
            % ({'sport': port, 'vport': port}))
    else:
        LOG.info(_("serving on http://%(host)s:%(port)s") % (
                 {'host': host, 'port': port}))

    workers = service.get_workers('api')
    serving.run_simple(cfg.CONF.api.host, cfg.CONF.api.port,
                       app, processes=workers)
def main():
    service.prepare_service()
    os_service.launch(CONF,
                      notification.NotificationService(),
                      workers=service.get_workers('notification')).wait()
def main():
    service.prepare_service()
    os_service.launch(udpservice.UdpService(),
                      workers=service.get_workers('udpservice')).wait()
示例#14
0
def main():
    service.prepare_service()
    os_service.launch(CONF, notification.NotificationService(),
                      workers=service.get_workers('notification')).wait()
示例#15
0
def main():
    service.prepare_service()
    os_service.launch(consumer.ConsumerService(),
                      workers=service.get_workers('collector')).wait()
示例#16
0
def main():
    service.prepare_service()
    os_service.launch(CONF,
                      collector.CollectorService(),
                      workers=service.get_workers('collector')).wait()
示例#17
0
def main():
    service.prepare_service()
    os_service.launch(CONF, collector.CollectorService(), workers=service.get_workers("collector")).wait()