-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #10005: Add documentation about inventory upload on root server #278
Merged
Normation-Quality-Assistant
merged 1 commit into
Normation:branches/rudder/3.1
from
fanf:arch_10005/add_documentation_about_inventory_upload_on_root_server
Jan 18, 2017
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
=== Inventory workflow, from nodes to Root server | ||
|
||
One of the main information workflow in a Rudder managed system is the node's | ||
inventory one. | ||
|
||
Node inventories are generated on nodes, are sent to the node policy server (be | ||
it a Relay or the Root server) up to the Root server, and stored in the | ||
Rudder database (technically an LDAP server), waiting for later use. | ||
|
||
The goal of that section is to detail the different steps and explain how to | ||
spot and solve a problem on the inventory workflow. Following schema sum up | ||
the whole process. | ||
|
||
image:./images/rudder-inventory-workflow.png[Inventory workflow, from node to | ||
Root server] | ||
|
||
|
||
==== Processing inventories on node | ||
|
||
Inventories are generated daily during an agent run in the 00:00-06:00 time | ||
frame window local to the node. The exact time is randomly spread on the time | ||
frame for a set of nodes, but each node will always keep the same time (modulo | ||
the exact time of the run). | ||
|
||
User can request the generation and upload of inventory with the command: | ||
|
||
---- | ||
|
||
$ rudder agent inventory | ||
|
||
---- | ||
|
||
In details, generating inventory does: | ||
|
||
* ask the node policy server for its UUID with an HTTP GET on | ||
`https://server/uuid`, | ||
* generate an inventory by scanning the node hardware and software components, | ||
* optionally make a digital signature of the generated inventory file, | ||
* send file(s) to the node's policy server on `https://POLICY-SERVER/inventory-updates/` | ||
|
||
The individual commands can be displayed with the `-i` option to `rudder agent | ||
inventory` command. | ||
|
||
|
||
==== Processing inventories on relays | ||
|
||
On the Relay server: | ||
|
||
* the inventory is received by a `webdav` endpoint, | ||
* the `webdav` service store the file in the folder | ||
`/var/rudder/inventories/incoming` | ||
* on each agent runs, files in `/var/rudder/inventories/incoming` are | ||
forwarded to the Relay own policy server. | ||
|
||
==== Processing inventories on root server | ||
|
||
On the Root server, the start of the workflow is the same than on a relay: | ||
|
||
* the inventory is received by a `webdav` endpoint, | ||
* the `webdav` service store the file in the folder | ||
`/var/rudder/inventories/incoming` | ||
|
||
Then, on each run, the agent: | ||
|
||
* look for inventory / signature pairs: | ||
** inventories without a corresponding signature file are processed only if | ||
they are older than 2 minutes, | ||
* POST the inventory or inventory+signature pair to the local API of | ||
"inventory-endpoint" application on `http://localhost:8080/endpoint/upload/` | ||
* the API makes some quick checks on inventory (well formed, mandatory fields...) | ||
and : | ||
** if checks are OK, *ACCEPTS* (HTTP code `200`) the inventory, | ||
** if signature is configured to be mandatory and is missing, or if the | ||
signature is not valid, refuses with *UNAUTHORIZED* error (HTTP code `401`) | ||
** else fails with a *PRECONDITION FAILED* error (HTTP code `412`) | ||
* on error, inventory file is moved to `/var/rudder/inventories/failed`, | ||
* on success: | ||
** the inventory file is moved to `/var/rudder/inventories/received`, | ||
** in parallel, _inventory web_ parses and updates Rudder database. | ||
|
||
==== Queue of inventories waiting to be parsed | ||
|
||
The _inventory endpoint_ has a limited number of slot available for succesfully | ||
uploaded inventories to be queued waiting for parsing. | ||
That number can be configured in file `/opt/rudder/etc/inventory-web.properties`: | ||
|
||
---- | ||
|
||
waiting.inventory.queue.size=50 | ||
|
||
---- | ||
|
||
Since Rudder 3.1.18 / 3.2.11 / 4.0.3, the number of currently waiting | ||
inventories can be obtained via a local REST API call to | ||
`http://localhost:8080/endpoint/api/info`: | ||
|
||
---- | ||
|
||
$ curl http://localhost:8080/endpoint/api/info | ||
|
||
{ | ||
"queueMaxSize": 50, | ||
"queueFillCount": 50, | ||
"queueSaturated": true | ||
} | ||
|
||
---- | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need an empty line at the end (to avoid breaking the following title)