Help Center/ Distributed Cache Service/ User Guide/ Managing Instances/ Renaming Critical Commands for DCS Instances
Updated on 2025-09-02 GMT+08:00

Renaming Critical Commands for DCS Instances

Certain high-risk commands can be modified for DCS Redis instances. Once a command is modified, it is only known to the modifier. Running the original command by other users is blocked.

Notes and Constraints

  • Only DCS Redis 4.0 and later instances support command renaming.
  • Currently, you can only rename the COMMAND, KEYS, FLUSHDB, FLUSHALL, HGETALL, SCAN, HSCAN, SSCAN, and ZSCAN commands. For Proxy Cluster instances, you can also rename the DBSIZE and DBSTATS commands.
  • Renaming commands for a single-node, master/standby, or Redis Cluster instance may automatically restart the instance. Restarting a single-node instance will clear its data. Exercise caution. For details, see Will the Instance Be Restarted During Renaming.
  • Renaming takes effect immediately once it is complete. Renamed commands will not be displayed on the console for security purposes. If you forget a renamed command, rename it again.
  • Renaming can be performed multiple times. Each new name overwrites the previous name. (For example, when commands COMMAND and KEYS are renamed, then to rename command FLUSHDB, COMMAND and KEYS should be renamed again, or will be restored otherwise.)
  • A command cannot be renamed to other original commands. For example, KEYS can be renamed to KEYS or ABC123, but cannot be renamed to SCAN.
  • Renaming a command starts only with a letter and contains 4–64 characters of letters, digits, hyphens (-), and underscores (_).

Procedure

  1. Log in to the DCS console.
  2. Click in the upper left corner of the console and select the region where your instance is located.
  3. In the navigation pane, choose Cache Manager.
  4. In the Operation column of an instance, choose More > Command Renaming.
  5. Select a command, enter a new name, and click OK.

    Previously Modified indicates whether the command has been renamed (Yes or No). If yes, it can be renamed again. Multiple commands can be renamed at a time.

    Figure 1 Command renaming

  6. After renaming commands, you can view the renaming operation record on the Background Tasks page.

    Only the renaming operation records can be viewed. The renamed commands cannot be viewed. If you forget them, rename them again.

    Figure 2 Command renaming operation record

Command Renaming Result

For example, when command FLUSHALL is renamed, accessing an instance and executing it returns an error message: (error) ERR ERR unknown command `flushall`.

Will the Instance Be Restarted During Renaming

  • No: for Proxy Cluster and read/write splitting instances.
  • For single-node, master/standby, or Redis Cluster instances, if Caution! Instance restart required. is displayed in the operation window (as shown in Figure 3), the instance will be restarted. Otherwise, no restart is required.
    Figure 3 Command renaming window