Skip to content

Advanced usage

Yoann Valeri edited this page Mar 14, 2023 · 6 revisions

General architecture

To properly function, Phobos uses a daemon called the phobosd (internally called the Local Resource Scheduler (LRS)). It centralizes all requests on its node and schedules them in an optimized way. However, it is not responsible for any I/O, which are left to the client, but rather reserves media, handle load/unload of the later on devices, and the mounting of the underlying filesystems.

image

When trying to put data in Phobos, a client will thus ask the phobosd for media where to do the I/O. In turn, the phobosd will reserve those media, load/mount them if necessary, and return them back to the client. The client will then actually perform the I/O, and when done, will notify the daemon is the operation is over.

To properly manage and keep the system information, Phobos also uses a component called the Distributed State Service (DSS) which is responsible for interaction with a database. This component is used both by the clients when trying to put data (for instance to check whether an object already exists) and by the phobosd (to check the devices already known at startup for example).

With this architecture in mind, we define a Phobos Server as:

  • a set of devices to access a media library, shared or not,
  • a Phobos service (the phobosd as explained above) to schedule I/Os,
  • a tool/script which receives I/O requests and call Phobos client API.

image

Using this definition of a Phobos server, we can then parallelize Phobos so that it runs on multiples servers, synchronized by the DSS as a common database. I/O distribution is then done by a front-end which has access to every server and can chose which to use with the locate feature, as explained in Store commands.

image

TODO

layout, lyt-params, alias force unlock

Storage layouts

When putting data in Phobos, you can specify which storage layout you want and characteristics about this layout.

Currently though, Phobos can only manage the raid1 storage layout for mirroring, and the number of replica. In Phobos, this value is the number of data replicates, so a replica count of 1 means that there is only one copy of the data (the original), and 0 additional copies of it. Therefore, a replica count of 2 means the original copy of the data, plus 1 additional copy.

Specifying the storage layout to use and its parameter can be done in multiple ways.

Layout specification at put

To specify the layout to use with the CLI, you can use the --layout option of the phobos put command, with the value being the name of the layout to use.

Alongside it, you can also provide the --lyt-params option, with a list of comma-separated key=value. These parameters will be interpreted by the layout, so if a given key/value couple does not make sense for the layout, it will be ignored.

Here is an example of a put call with both parameters given, which aims to put the data on 4 different media:

phobos put --layout raid1 --lyt-params repl_count=4 /etc/hosts blob

Similarly, to specify the layout and its parameters in the API, you have to use the layout_name and lyt_params fields of the pho_xfer_put_params structure.

Default layout in the configuration file

In the configuration file (see Configure Phobos for more information), especially in the store section, you can define the default_layout key. The associated value will be used as the default layout for putting data if not provided by the client in the API or CLI.

In case a default layout is given in the configuration file and a layout is provided at put, the later will be used if valid.

Moreover, you can also define in the configuration file the default parameters to use. Those are however defined per layout, meaning you have to put them in another section, called [layout_<layout], and define in it the key lyt-params with the value a list of comma-separated key=value.

Here is an example for these sections:

[store]
default_layout = raid1

[layout_raid1]
repl_count = 2 

If an alias is defined, you can set it as default instead of the layout:

[store]
default_alias = simple

[alias "simple"]
layout = raid1
lyt-params = repl_count=1

Alternatively, you can override this default value by using the 'right' option in your put commands:

# put data using a raid1 layout
phobos put --layout raid1 file.in obj123

phobos dir add --unlock dummy
phobos tape add --unlock dummy
phobos drive add --unlock dummy
# put data using a simple alias
phobos put --alias simple file.in obj123

Layouts can have additional parameters. For now, the only additional parameter is the number of replicas for raid1. This is for now specified using the following env variable:

# put data using a raid1 layout with 3 replicas
PHOBOS_LAYOUT_RAID1_repl_count=3 phobos put --layout raid1 file.in obj123

Extents

When putting an object in Phobos, it will be written on media in potentially The API function associated with this command is phobos_admin_layout_list().

Clone this wiki locally