By default, append-only file (AOF) persistence is enabled for Tair. This topic describes how to enable or disable AOF persistence by setting the appendonly parameter.
Overview
Tair provides two data persistence options: AOF persistence and Redis Database (RDB) persistence. AOF persistence logs every write operation received by the server, such as SET. When you restart a Tair instance, the system reruns the commands in the AOFs to restore data. If an AOF is too large, Tair runs an AOF rewrite task to recreate the AOF at a reduced file size.
You can specify the AOF_FSYNC_EVERYSEC policy to enable AOF persistence for Tair instances. After you specify this policy, the system records all write commands in an AOF every second and saves the AOF to disks. The policy has a negligible impact on the performance and can minimize data loss caused by accidental operations. Tair allows you to archive incremental backups based on AOFs and ensures service performance when the system runs the AOF rewrite task.
AOF persistence may affect write performance. If a Tair instance is used in a cache-only scenario, you can perform the operations described in this topic to set the appendonly parameter to disable AOF persistence for the instance.
Status and impacts of AOF persistence
- By default, when you create a Tair instance, AOF persistence is enabled for the instance.
- If you set the appendonly parameter to no, the following impacts exist:
- The system disables AOF persistence without the need to restart the instance.
- After AOF persistence is disabled, AOFs cannot be used to restore data.
- The existing AOF logs remain unaffected.
- For a standard instance, AOF persistence is disabled for the master node and the replica node is not affected.
- For a cluster instance, AOF persistence is disabled for the master nodes of all data shards and the replica nodes are not affected.
- For a read/write splitting instance, AOF persistence is disabled for the master node and all read replicas and the replica node is not affected.
- If you change the appendonly value to yes, the system enables AOF persistence without the need to restart the instance.
Procedure
- Log on to the Tair console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click its ID.
- In the left-side navigation pane, click System Parameters.
- On the System Parameters page, click Modify in the Actions column corresponding to the appendonly parameter.
- In the dialog box that appears, perform the following steps:
Related API operations
Operation | Description |
---|---|
DescribeParameters | Queries the configuration and operational parameters of a Tair instance. |
ModifyInstanceConfig | Modifies parameters of a Tair instance. |