Bolt Examples
This page shows some examples of what we can do with Bolt to administer a set of MariaDB servers. Bolt is a tool that is part of the Puppet ecosystem.
Invenvory Files
The simplest way to call Bolt and instruct it to do something on some remote targets is the following:
bolt ... --nodes 100.100.100.100,200.200.200.200,300,300,300,300
However, for non-trivial setups it is usually better to use an inventory file. An example:
targets: - uri: maria-1.example.com name: maria_1 alias: mariadb_main ...
In this way, it will be possible to refer the target by name or alias.
We can also define groups, so we will be able to run actions against all targets that are part of a group:
groups: - name: mariadb-staging targets: - uri: maria-1.example.com name: maria_1 - uri: maria-2.example.com name: maria_2 - name: mariadb-production targets: ... ...
In the examples in the rest of the page, the --targets
parameter will be indicated in this way, for simplicity: --targets <targets>
.
Running Commands on Targets
The simplest way to run a command remotely is the following:
bolt command run 'mariadb-admin start-all-slaves' --targets <targets>
References
Content initially contributed by Vettabase Ltd.