Changing the persistence location in Redis Software after installation can help you reallocate disk usage, optimize I/O, or conform to infrastructure standards. This guide outlines a safe and supported way to migrate persistent storage to a new mount point, using Maintenance Mode, file system symbolic links, and Redis administrative tools. It includes Preparation and Prerequisites, Step-by-Step Migration, and Troubleshooting.
Preparation and Prerequisites
Before initiating the migration:
-
Perform in Test First
Validate these steps in a staging environment to confirm safety and compatibility.- Review the Deployment Planning guide to ensure your infrastructure is suitable.
-
Back Up All Data
Follow the Redis Backup guide to safeguard current data in case a rollback is needed. -
Verify Cluster Health
Run the following commands to ensure all services and nodes are healthy:rladmin status extra all sudo /opt/redislabs/bin/rlcheck --continue-on-error supervisorctl status
-
Migrate Shards Off Node (if applicable)
Only perform this procedure on nodes that do not host master or replica shards. Userladmin migrateto offload endpoints/shards:rladmin migrate shard <shard-id> to <target-node>
For guidance on storage design considerations, see Persistent and Ephemeral Storage Planning.
-
Generate and Save a Support Package
Generate a support package for pre-change validation and post-mortem if needed.
Step-by-Step Migration Procedure
-
Enable Maintenance Mode
rladmin node <node-id> maintenance_mode on
-
Stop All Redis Services
supervisorctl stop all cnm_ctl stop dmc_ctl stop sudo /opt/redislabs/bin/redis_ctl stop-all
-
Create the New Persistence Directory
sudo mkdir -p /u01/app/RedisSoftware/persistentstorage/<node-id>-persist chown -R redislabs:redislabs /u01/app/RedisSoftware/persistentstorage/<node-id>-persist sudo chmod -R 755 /u01/app/RedisSoftware/persistentstorage/<node-id>-persist
-
Move Existing Data to New Location
Usemvwhile preserving ownership and timestamps:sudo mv /var/opt/redislabs/persist/* /u01/app/RedisSoftware/persistentstorage/<node-id>-persist/
-
Remove Old Directory and Create Symbolic Link
rmdir /var/opt/redislabs/persist ln -s /u01/app/RedisSoftware/persistentstorage/<node-id>-persist /var/opt/redislabs/persist
Verify the symlink:
ls -alR /var/opt/redislabs/persist readlink -f /var/opt/redislabs/persist
For more details about default and configurable file system paths, see the Redis File Locations guide.
-
Start Services
sudo /opt/redislabs/bin/redis_ctl start-all cnm_ctl start dmc_ctl start supervisorctl start all supervisorctl status
-
Exit Maintenance Mode
rladmin node <node-id> maintenance_mode off
-
Verify Cluster Health
Confirm all services are healthy:rladmin status extra all
-
Migrate Shards and Endpoints Back (if needed)
rladmin migrate shard <shard-id> to <original-node>
-
Clean Up Legacy AOF Files
Remove*.aof.prevfiles to free up space:find /u01/app/RedisSoftware/persistentstorage/<node-id>-persist/ -name '*.aof.prev' -delete
-
Repeat for Other Nodes
Sequentially repeat this process on each applicable node.
Troubleshooting
| Issue | Explanation / Fix |
|---|---|
| Cluster health degraded | Run rladmin status extra all and check logs under /var/log/ or Redis logs in the new persistence directory. |
| Symbolic link not followed | Verify ln -s was used correctly and ownership is redislabs:redislabs. |
| Permission denied on new path | Ensure directory and files are readable/writable by Redis processes. Use chmod -R 755 and chown -R redislabs:redislabs. |
| Redis doesn’t start after a restart | Confirm that supervisorctl, redis_ctl, and cnm_ctl services are all running. |
| Data rollback needed | Restore from your pre-migration backup and reverse the symbolic link setup. |
0 comments
Please sign in to leave a comment.