To setup a Redis cluster without persistence, you need to turn off the default persistence options. Redis supports two forms of persistence: RDB and AOF. By default, Redis uses RDB for persistence.
This is done by modifying the Redis configuration file (redis.conf), particularly the following parts:
save directives from the configuration.
These lines mean that Redis will automatically save datasets every 15 minutes if at least one key has changed, every five minutes if at least ten keys have changed, and every minute if at least 10,000 keys have changed. Commenting out these lines disables RDB snapshotting.
appendonly directive to no.
After making these changes, restart your Redis server for the changes to take effect. Be careful, though, as disabling persistence means your data is ephemeral and will be lost if the Redis server crashes or is restarted.
While there are use cases where persistence is not needed, it's usually advisable to keep some form of it enabled to avoid data loss.