Tip
This is the documentation for the 20.10 version. Looking for the documentation of the latest version? Have a look here.
Configuration Database¶
TNSR maintains three separate configuration databases: startup, candidate, and running. These files are stored as XML in plain text files.
- startup:
The configuration loaded when the host boots up.
Note
A restart of TNSR services is not the same as a reboot. If, for example, the clixon services are restarted, TNSR will still be using the running database.
- candidate:
An in-process potential configuration that exists while the TNSR configuration is being actively edited. When committed, this configuration will be accepted as the running configuration by TNSR if it is free of errors.
- running:
The active running configuration, which reflects the current state of TNSR.
Note
These databases are located in /var/tnsr/
on the host, but these
files are not intended to be accessed outside of TNSR.
The configuration database is managed using the configuration
command from
within config
mode.
Saving the Configuration¶
For changes to persist between reboots of the TNSR host, the running configuration must be copied to the startup configuration as shown in this example:
tnsr# configure
tnsr(config)# configuration copy running startup
Viewing the Configuration¶
To view the configuration databases, use the show configuration
command
followed by the database name, for example:
tnsr# show configuration running
or:
tnsr# show conf run
The default output is XML, but the configuration may also be printed in json
format by adding json
to the end of the command.
Reverting to the Startup Configuration¶
TNSR can also revert to the previously saved startup configuration to remove undesirable changes to the running configuration, should a regression in behavior occur.
For example:
tnsr# configure
tnsr(config)# configuration copy startup candidate
tnsr(config)# configuration candidate commit
tnsr(config)# exit
Warning
It is not possible to copy the startup configuration directly to the running configuration as that will not result in the settings being active. The configuration must be committed after copying to the candidate.
Configuration Database Commands¶
These brief examples show other available configuration database management commands.
Delete the candidate database entirely, which if committed will leave TNSR with an empty configuration:
tnsr(config)# configuration candidate clear
Commit changes made to the candidate database, which if successful will become the running database:
tnsr(config)# configuration candidate commit
Discard the current candidate database to remove a change that has failed to validate, returning to the running configuration without the attempted changes:
tnsr(config)# configuration candidate discard
Attempt to validate the current candidate configuration to locate errors:
tnsr(config)# configuration candidate validate
Load a file from the host into the candidate database. The contents of the file can replace the candidate entirely, or merge a new section into an existing configuration. After loading, the candidate must be committed manually.
tnsr(config)# configuration candidate load <filename> [(replace|merge)]
Copy the candidate configuration to the startup configuration:
tnsr(config)# configuration copy candidate startup
Copy the running configuration to either the candidate or startup configuration:
tnsr(config)# configuration copy running (candidate|startup)
Copy the startup configuration to the candidate configuration:
tnsr(config)# configuration copy startup candidate
Save either the candidate or running configuration to a file on the host.
tnsr(config)# configuration save (candidate|running) <filename>
While not a configuration database command directly, the TNSR CLI automatically discards the candidate database if it fails to validate. This behavior can be changed using the following command:
tnsr(config)# no cli option auto-discard