[DOCS] Improvements for worker drivers and fixes
Change-Id: I7185555f0b613ea5e5d913755e49d1b97ec382f1
This commit is contained in:
parent
4aa8f2b7da
commit
f408a9180d
@ -351,7 +351,7 @@ Note that nodes that are assigned to a load balancer that is delivering data to
|
||||
a Galera database cluster may require a primary write node be specified to avoid
|
||||
database locking problems that can occur. For this case, a load balancer can be
|
||||
configured to use the special "GALERA" protocol type. When a "GALERA" protocol
|
||||
is chosen, all of the specified nodes must use the node "backup" attribute to
|
||||
is chosen, all of the specified nodes must use the node "backup" attribute to
|
||||
specify whether it is a backup node or the primary node. There may only be a
|
||||
single primary node specified by setting the "backup" attribute to FALSE. All
|
||||
other nodes must have the "backup" attribute set to TRUE.
|
||||
@ -382,7 +382,7 @@ creation, examples....
|
||||
|
||||
**Request body example to create a load balancer with two nodes and an
|
||||
optional "weight" assigned. Note that a default weight of 1 does not
|
||||
have to be explicitly assigned **
|
||||
have to be explicitly assigned**
|
||||
|
||||
::
|
||||
|
||||
@ -424,8 +424,8 @@ balancer virtual IP**
|
||||
]
|
||||
}
|
||||
|
||||
**Request body example to create a load balancer that specifies a
|
||||
single primary write node for a Galera cluster **
|
||||
**Request body example to create a load balancer that specifies a
|
||||
single primary write node for a Galera cluster**
|
||||
|
||||
::
|
||||
|
||||
@ -449,7 +449,7 @@ single primary write node for a Galera cluster **
|
||||
"port": "3306",
|
||||
"backup": "FALSE"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
Normal Response Code
|
||||
|
@ -5,7 +5,7 @@ Building Libra Images using Diskimage Builder.
|
||||
|
||||
|
||||
Setup the builder - Manual way
|
||||
-----------------
|
||||
------------------------------
|
||||
|
||||
1. Set DIB path
|
||||
|
||||
|
@ -21,6 +21,7 @@ Gearman Worker Thread
|
||||
normally exit. This function identifies that situation and periodically
|
||||
attempts to restart the worker in an endless loop.
|
||||
|
||||
|
||||
EventServer Class
|
||||
-----------------
|
||||
|
||||
@ -62,51 +63,8 @@ LBaaSController Class
|
||||
LoadBalancerDriver Class
|
||||
------------------------
|
||||
|
||||
.. py:module:: libra.worker.drivers
|
||||
See :ref:`libra-worker-driver` for information
|
||||
|
||||
.. py:class:: LoadBalancerDriver
|
||||
|
||||
This defines the API for interacting with various load balancing
|
||||
appliances. Drivers for these appliances should inherit from this
|
||||
class and implement the relevant API methods that it can support.
|
||||
`This is an abstract class and is not meant to be instantiated directly.`
|
||||
|
||||
Generally, an appliance driver should queue up any configuration changes
|
||||
made via these API calls until the :py:meth:`create` method is called.
|
||||
The :py:meth:`suspend`, :py:meth:`enable`, :py:meth:`delete`,
|
||||
:py:meth:`get_stats()` and :py:meth:`archive` methods should take
|
||||
immediate action.
|
||||
|
||||
.. py:method:: init()
|
||||
|
||||
.. py:method:: add_server(host, port)
|
||||
|
||||
.. py:method:: set_protocol(protocol, port)
|
||||
|
||||
.. py:method:: set_algorithm(algorithm)
|
||||
|
||||
.. py:method:: create()
|
||||
|
||||
.. py:method:: suspend()
|
||||
|
||||
.. py:method:: enable()
|
||||
|
||||
.. py:method:: delete()
|
||||
|
||||
.. py:method:: get_stats()
|
||||
|
||||
.. py:method:: archive()
|
||||
|
||||
Known Load Balancer Drivers Dictionary
|
||||
--------------------------------------
|
||||
|
||||
.. py:data:: known_drivers
|
||||
|
||||
This is the dictionary that maps values for the
|
||||
:option:`--driver <libra_worker.py --driver>` option
|
||||
to a class implementing the driver :py:class:`~LoadBalancerDriver` API
|
||||
for that appliance. After implementing a new driver class, you simply add
|
||||
a new entry to this dictionary to plug in the new driver.
|
||||
|
||||
Relationship Diagram
|
||||
--------------------
|
||||
|
@ -63,10 +63,6 @@ Command Line Options
|
||||
Full path to the file with the SSL private key to use when
|
||||
connecting to an SSL-enabled Gearman job server.
|
||||
|
||||
.. option:: --haproxy_logfile <FILE>
|
||||
|
||||
Configure the path for where to put haproxy log.
|
||||
|
||||
.. option:: -s <SECONDS>, --reconnect_sleep <SECONDS>
|
||||
|
||||
The number of seconds to sleep between job server reconnect attempts
|
||||
|
71
doc/worker/driver.rst
Normal file
71
doc/worker/driver.rst
Normal file
@ -0,0 +1,71 @@
|
||||
.. _libra-worker-driver:
|
||||
|
||||
Drivers
|
||||
=======
|
||||
|
||||
The driver is the part of the Worker which is responsible for doing actions
|
||||
towards the underlying service like HAProxy or other.
|
||||
|
||||
It's a plugin based python class that has a generic API for configuring up
|
||||
:term:`device`.
|
||||
|
||||
LoadBalancerDriver Class
|
||||
------------------------
|
||||
|
||||
See Drivers for driver documentation
|
||||
|
||||
.. py:module:: libra.worker.drivers
|
||||
|
||||
.. py:class:: LoadBalancerDriver
|
||||
|
||||
This defines the API for interacting with various load balancing
|
||||
appliances. Drivers for these appliances should inherit from this
|
||||
class and implement the relevant API methods that it can support.
|
||||
`This is an abstract class and is not meant to be instantiated directly.`
|
||||
|
||||
Generally, an appliance driver should queue up any configuration changes
|
||||
made via these API calls until the :py:meth:`create` method is called.
|
||||
The :py:meth:`suspend`, :py:meth:`enable`, :py:meth:`delete`,
|
||||
:py:meth:`get_stats()` and :py:meth:`archive` methods should take
|
||||
immediate action.
|
||||
|
||||
.. py:method:: init()
|
||||
|
||||
.. py:method:: add_server(host, port)
|
||||
|
||||
.. py:method:: set_protocol(protocol, port)
|
||||
|
||||
.. py:method:: set_algorithm(algorithm)
|
||||
|
||||
.. py:method:: create()
|
||||
|
||||
.. py:method:: suspend()
|
||||
|
||||
.. py:method:: enable()
|
||||
|
||||
.. py:method:: delete()
|
||||
|
||||
.. py:method:: get_stats()
|
||||
|
||||
.. py:method:: archive()
|
||||
|
||||
Known Load Balancer Drivers Dictionary
|
||||
--------------------------------------
|
||||
|
||||
.. py:data:: known_drivers
|
||||
|
||||
This is the dictionary that maps values for the
|
||||
:option:`--driver <libra_worker.py --driver>` option
|
||||
to a class implementing the driver :py:class:`~LoadBalancerDriver` API
|
||||
for that appliance. After implementing a new driver class, you simply add
|
||||
a new entry to this dictionary to plug in the new driver.
|
||||
|
||||
.. note::
|
||||
|
||||
See below for driver specific documentation
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:glob:
|
||||
|
||||
drivers/*
|
45
doc/worker/drivers/haproxy.rst
Normal file
45
doc/worker/drivers/haproxy.rst
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
.. _libra-worker-driver-haproxy:
|
||||
|
||||
HAProxy driver
|
||||
==============
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
.. option:: --haproxy_logfile <FILE>
|
||||
|
||||
Configure the path for where to put haproxy log.
|
||||
|
||||
.. note::
|
||||
|
||||
See :ref:`libra-worker-driver-haproxy-archiving` for information on
|
||||
archiving.
|
||||
|
||||
.. option:: --haproxy_service <service>
|
||||
|
||||
The underlying OS Service implementation to use
|
||||
|
||||
Default: ubuntu
|
||||
|
||||
.. _libra-worker-driver-haproxy-archiving:
|
||||
|
||||
Log archiving
|
||||
-------------
|
||||
|
||||
In order to support log-archiving with haproxy you need to redirect
|
||||
the rsyslog feed from local0 to a dedicated file
|
||||
|
||||
.. note::
|
||||
|
||||
Change the /var/log/haproxy.log to the path you have set in the worker
|
||||
section of the config.
|
||||
|
||||
::
|
||||
|
||||
cat >/etc/rsyslog.d/10-haproxy.conf<<EOF
|
||||
$template Haproxy,"%TIMESTAMP% %msg%\n"
|
||||
local0.* -/var/log/haproxy.log;Haproxy
|
||||
# don't log anywhere else
|
||||
local0.* ~
|
||||
EOF
|
@ -5,8 +5,10 @@ Libra Gearman Worker
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:glob:
|
||||
|
||||
about
|
||||
config
|
||||
code
|
||||
messages
|
||||
driver
|
Loading…
x
Reference in New Issue
Block a user