start datasource drivers before policy engine
Also starts API last to avoid accepting API requests before other services are up. HA doc updated to start DSD node before PE nodes. Change-Id: I27cd1149e1f52b596c1ae77ca1400113a53213f5 Closes-Bug: 1646280
This commit is contained in:
parent
c4ef12cb38
commit
5262be2d30
|
@ -75,18 +75,6 @@ def create2(node_id=None, bus_id=None, existing_node=None,
|
|||
|
||||
# create services as required
|
||||
services = {}
|
||||
if api:
|
||||
LOG.info("Registering congress API service on node %s", node.node_id)
|
||||
services['api'], services['api_service'] = create_api()
|
||||
node.register_service(services['api_service'])
|
||||
|
||||
if policy_engine:
|
||||
LOG.info("Registering congress PolicyEngine service on node %s",
|
||||
node.node_id)
|
||||
services[api_base.ENGINE_SERVICE_ID] = create_policy_engine()
|
||||
node.register_service(services[api_base.ENGINE_SERVICE_ID])
|
||||
initialize_policy_engine(services[api_base.ENGINE_SERVICE_ID])
|
||||
|
||||
if datasources:
|
||||
LOG.info("Registering congress datasource services on node %s",
|
||||
node.node_id)
|
||||
|
@ -104,6 +92,13 @@ def create2(node_id=None, bus_id=None, existing_node=None,
|
|||
# LOG.exception("Datasource %s creation failed. %s" % (ds, e))
|
||||
# node.unregister_service(ds)
|
||||
|
||||
if policy_engine:
|
||||
LOG.info("Registering congress PolicyEngine service on node %s",
|
||||
node.node_id)
|
||||
services[api_base.ENGINE_SERVICE_ID] = create_policy_engine()
|
||||
node.register_service(services[api_base.ENGINE_SERVICE_ID])
|
||||
initialize_policy_engine(services[api_base.ENGINE_SERVICE_ID])
|
||||
|
||||
# start synchronizer and other periodic tasks
|
||||
if policy_engine:
|
||||
services[api_base.ENGINE_SERVICE_ID].start_policy_synchronizer()
|
||||
|
@ -111,6 +106,12 @@ def create2(node_id=None, bus_id=None, existing_node=None,
|
|||
node.start_periodic_tasks()
|
||||
node.register_service(
|
||||
dse_node.DSManagerService(dse_node.DS_MANAGER_SERVICE_ID))
|
||||
|
||||
if api:
|
||||
LOG.info("Registering congress API service on node %s", node.node_id)
|
||||
services['api'], services['api_service'] = create_api()
|
||||
node.register_service(services['api_service'])
|
||||
|
||||
return services
|
||||
|
||||
|
||||
|
|
|
@ -80,24 +80,6 @@ For example:
|
|||
connection = mysql+pymysql://root:<database-password>@<shared-database-ip-address>/congress?charset=utf8
|
||||
|
||||
|
||||
Policy Engine Nodes
|
||||
=====================
|
||||
|
||||
In this step, we deploy N (at least 2) policy-engine nodes, each with an
|
||||
associated API server. Each node can be started as follows:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ python /usr/local/bin/congress-server --api --policy-engine --node-id=<unique_node_id>
|
||||
|
||||
Each node must have a unique node-id specified as a commandline option.
|
||||
|
||||
For high availability, each node is usually deployed on a different host. If
|
||||
multiple nodes are to be deployed on the same host, each node must have a
|
||||
different port specified using the ``bind_port`` configuration option in the
|
||||
congress configuration file.
|
||||
|
||||
|
||||
Datasource Drivers Node
|
||||
========================
|
||||
|
||||
|
@ -163,6 +145,26 @@ The RA has following configurable parameters.
|
|||
* binary(Option): a path of Congress binary Default is "/usr/local/bin/congress-server".
|
||||
* additional_parameters(Option): additional parameters of congress-server
|
||||
|
||||
|
||||
Policy Engine Nodes
|
||||
=====================
|
||||
|
||||
In this step, we deploy N (at least 2) policy-engine nodes, each with an
|
||||
associated API server. This step should be done only after the
|
||||
`Datasource Drivers Node`_ is deployed. Each node can be started as follows:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ python /usr/local/bin/congress-server --api --policy-engine --node-id=<unique_node_id>
|
||||
|
||||
Each node must have a unique node-id specified as a commandline option.
|
||||
|
||||
For high availability, each node is usually deployed on a different host. If
|
||||
multiple nodes are to be deployed on the same host, each node must have a
|
||||
different port specified using the ``bind_port`` configuration option in the
|
||||
congress configuration file.
|
||||
|
||||
|
||||
Load-balancer
|
||||
==============
|
||||
|
||||
|
|
Loading…
Reference in New Issue