Backing Up and Restoring Configuration Files
- To prevent configuration files from being unavailable due to configuration modification, haf-tool provides the config command to back up configuration files. Go to the tool installation path and run the following backup command:
./tools/haf-tool config --backup --path <conf-bak-path>
After the command is executed successfully, the backup file haf_user.conf.bak of the haf_user.conf configuration file is generated on host nodes, and the backup file haf_offload.conf.bak of the haf_offload.conf configuration file is generated on offload nodes.
Table 1 Parameter description Option
Description
Mandatory
--backup
Keyword for backing up the configuration file.
Yes
--path <conf-bak-path>
Path for storing the configuration file. The default path is conf-bak in the tool installation directory.
No
- If a configuration file is unavailable due to problems such as missing of key configuration items, you can restore the configuration from the backup file. To restore the configuration, run the following command in the installation path:
./tools/haf-tool config --restore --path <conf-bak-path>
After this command is executed, the system searches for the backup file in the path and restores the configuration data from the backup file. For example, when this command is executed on a host node, the system searches for haf_user.conf.bak in the specified path.
Table 2 Parameter description Option
Description
Mandatory
--restore
Keyword for restoring the configuration.
Yes
--path <conf-bak-path>
Path for storing the configuration file. The default path is conf-bak in the tool installation directory.
No
- The configuration file has the read and write permission options, and the backup file has the read-only permission option.
- After the tool is installed, the configuration file is automatically backed up and stored in the default path conf-bak.
- The O&M tool has the permission for all subdirectories in the installation directory. For directories other than the tool installation directory, ensure that access to the path is available.
- During data backup and restoration, configuration items are verified.
- If a configuration item is missing and has a default value, the system restores the configuration item to the default value. If a configuration item is missing and does not have a default value, the system reports an alarm that indicates that data backup or restoration fails.
- If the format of a configuration item is incorrect, the data backup or restoration fails.