This commit is contained in:
parent
5d2bed0f14
commit
13842daf1c
77
README.rst
77
README.rst
@ -2,6 +2,79 @@
|
|||||||
P2P Consumer Scheduler
|
P2P Consumer Scheduler
|
||||||
======================
|
======================
|
||||||
|
|
||||||
Repository for the consumer's scheduler
|
The scheduler part of a consumer system for the P2P storage system.
|
||||||
|
|
||||||
|
Produced by GoldenPogácsa Inc.
|
||||||
|
|
||||||
|
Basics
|
||||||
|
------
|
||||||
|
This is a component of a fully working consumer system.
|
||||||
|
In order to setup a consumer you will need the consumer API as well and a Redis database.
|
||||||
|
|
||||||
|
This component faciliates the automatic synchronization between consumers.
|
||||||
|
As well as detecting IP changes of the host which is running on.
|
||||||
|
|
||||||
|
Part of a system
|
||||||
|
----------------
|
||||||
|
|
||||||
|
This component works as a complimentary part for the consumer API.
|
||||||
|
|
||||||
|
The information exchange between the API is solved by using a Common Redis database.
|
||||||
|
This database must be shared between the API and the Scheduler instance.
|
||||||
|
|
||||||
|
Also the UUID is shared between the two components. This is obvious since they are essentially both parts of the same system.
|
||||||
|
|
||||||
|
|
||||||
|
Communications
|
||||||
|
--------------
|
||||||
|
|
||||||
|
The communication between other consumers and producers are solved by their REST API endpoints.
|
||||||
|
|
||||||
|
The follwing events will cause communication by this object:
|
||||||
|
* A sychronization task
|
||||||
|
* An IP address change detected
|
||||||
|
|
||||||
|
Since the communication between consumers happens regularly the IP address change event does not cause an immediate synchronization
|
||||||
|
However communication originated by scheduler toward producers only happens when the IP address change is detected.
|
||||||
|
|
||||||
|
Synchronization
|
||||||
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
This call originated by the scheduler and happens regularly (See. configuration).
|
||||||
|
|
||||||
|
A synchronization task causes the followings:
|
||||||
|
* Each consumer known by this consumer is checked for availability
|
||||||
|
* Each consumer this consumer communicated with updated the availability of this consumer.
|
||||||
|
* Each consumer which had no information of this consumer, now have.
|
||||||
|
|
||||||
|
Consumers learn about each other, and their IP addresses (and changes) during a synchronization.
|
||||||
|
|
||||||
|
Called URL::
|
||||||
|
|
||||||
|
http://<consumer ip>/sync
|
||||||
|
|
||||||
|
Body::
|
||||||
|
|
||||||
|
{
|
||||||
|
"uuid" : "str: LOCAL_UUID"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IP update
|
||||||
|
~~~~~~~~~
|
||||||
|
|
||||||
|
This communication is originated by the scheduler when an IP address change is detected.
|
||||||
|
|
||||||
|
This call is used to let producers immanently know about an IP change of their consumer, so that they can converge faster.
|
||||||
|
|
||||||
|
Called URL::
|
||||||
|
|
||||||
|
http://<producer ip>/ip
|
||||||
|
|
||||||
|
Body::
|
||||||
|
|
||||||
|
{
|
||||||
|
"uuid" : "str: LOCAL_UUID",
|
||||||
|
"ip": "str: provided by param"
|
||||||
|
}
|
||||||
|
|
||||||
Functionality: updates the database of the available consumers periodically
|
|
||||||
|
19
docs/config.rst
Normal file
19
docs/config.rst
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
=============
|
||||||
|
Configuration
|
||||||
|
=============
|
||||||
|
|
||||||
|
This software component can be configured via environmental variables, which are very useful in a containerized environment.
|
||||||
|
|
||||||
|
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| Variable | Default | Description |
|
||||||
|
+====================+==========================+=====================================================================================================================================================================+
|
||||||
|
| `LOCAL_UUID` | **N/A** | The UUID of the consumer system. Must be the same as the API's |
|
||||||
|
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| `RUN_INTERVAL` | 10 | Interval between synchronizations, and local ip checks. |
|
||||||
|
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| `CUSTOMER_TIMEOUT` | 30 | Default timeout to be set for a consumer. If the timeout expires, the consumer will be considered invalid, and no further attempts will be made to contact with it. |
|
||||||
|
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| `REDIS_URL` | redis://localhost:6379/0 | URL of the Redis database shared with the consumer api |
|
||||||
|
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
| `INITIAL_SERVERS` | **N/A** | A comma separated list of the initially known consumers (Can be empty, but must be specified) |
|
||||||
|
+--------------------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
@ -11,9 +11,11 @@ Welcome to Consumer Scheduler's documentation!
|
|||||||
:caption: Contents:
|
:caption: Contents:
|
||||||
|
|
||||||
readme
|
readme
|
||||||
|
config
|
||||||
source/modules
|
source/modules
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user