Specific options when creating or updating a Exoscale for Redis® service

You can find all the specific options for Exoscale for Redis® by using the CLI help:

exo dbaas create --help-redis
  --redis-fork-from              name of a Database Service to fork from
  --redis-ip-filter              allow incoming connections from CIDR address block
  --redis-recovery-backup-name   the name of the backup to restore when forking from a Database Service
  --redis-settings               Redis configuration settings (JSON format)

Restricting connections from the internet

By default, Exoscale DBaaS are not accessible from the whole internet. Data does not transmit in clear over the network as it is SSL encrypted by default and authenticated.

To allow incoming connections to your database service, you can add a filter allowing:

  • just one IP address,
  • a network range,
  • or a combination of IP address and network range

To do this, update your service or create it with the IP filter, which is a comma separated list of CIDRs:

exo dbaas update -z de-muc-1 test-redis --redis-ip-filter=1.2.3.4/24,5.6.7.8/32

Managing JSON configuration settings

You can list all settings available for the database service by using the command:

exo dbaas type show redis --settings redis

┼───────────────────────────────────┼───────────────┼────────────────────────────────────────────────────┼
│                KEY                │     TYPE      │                    DESCRIPTION                     │
┼───────────────────────────────────┼───────────────┼────────────────────────────────────────────────────┼
│ acl_channels_default              │ string        │ Determines default pub/sub channels' ACL for new   │
│                                   │               │ users if ACL is not supplied. When this option is  │
│                                   │               │ not defined, all_channels is assumed to keep       │
│                                   │               │ backward compatibility. This option doesn't affect │
│                                   │               │ Redis configuration acl-pubsub-default.            │
│                                   │               │   * Supported values:                              │
│                                   │               │     - allchannels                                  │
│                                   │               │     - resetchannels                                │
│ ssl                               │ boolean       │                                                    │
│ lfu_log_factor                    │ integer       │                                                    │
│ lfu_decay_time                    │ integer       │                                                    │
│ pubsub_client_output_buffer_limit │ integer       │ Set output buffer limit for pub / sub clients in   │
│                                   │               │ MB. The value is the hard limit, the soft limit is │
│                                   │               │ 1/4 of the hard limit. When setting the limit, be  │
│                                   │               │ mindful of the available memory in the selected    │
│                                   │               │ service plan.                                      │
│                                   │               │   * Minimum: 32 / Maximum: 512                     │
│                                   │               │   * Example: 64                                    │
│ timeout                           │ integer       │                                                    │
│ maxmemory_policy                  │ [string null] │                                                    │
│ io_threads                        │ integer       │                                                    │
│ notify_keyspace_events            │ string        │                                                    │
│ persistence                       │ string        │ When persistence is 'rdb', Redis does RDB dumps    │
│                                   │               │ each 10 minutes if any key is changed. Also RDB    │
│                                   │               │ dumps are done according to backup schedule for    │
│                                   │               │ backup purposes. When persistence is 'off', no RDB │
│                                   │               │ dumps and backups are done, so data can be lost at │
│                                   │               │ any moment if service is restarted for any reason, │
│                                   │               │ or if service is powered off. Also service can't   │
│                                   │               │ be forked.                                         │
│                                   │               │   * Supported values:                              │
│                                   │               │     - off                                          │
│                                   │               │     - rdb                                          │
┼───────────────────────────────────┼───────────────┼────────────────────────────────────────────────────┼

You can also update the settings of your database service:

exo dbaas update --zone de-fra-1 target-redis-service-name --redis-settings '{"notify_keyspace_events":"KEA"}'

Note

The parameter of --redis-settings has to be in JSON format.

Refer to the equivalent section for Managed PostgreSQL

Connect with redis-cli

To connect to the Redis database, you will need to install the redis-cli client. You can install redis-cli as part of the Redis server installation, or as standalone client.

Execute the following command from a terminal window:

redis-cli -u REDIS_URI

To check the connection is working, execute the following command returning all Redis parameters:

INFO

You can also list the keys using the command:

KEYS *

Migrating to Exoscale for Redis®

Note

Due to the fact that migrations always involve interaction with third-party services running outside of Exoscale, only best-effort support is provided on all migrations.

Migrate your Redis server database to our Exoscale for Redis® service. There are two methods: the replication method and the scan method.

The migration first attempts to use the replication method. If the replication method fails, it uses the scan method.

The replication method is preferred for production databases because it allows for the migration of data with minimal downtime. The scan method is slower and iterates over all keys, one database at a time.

Prerequisites

  • A target Redis service - a new or an existing service.
  • The hostname, port and password of the source Redis service.
  • The source Redis service must be secured with SSL/TLS, which is the default for migration. Refer to Redis TLS support
  • A publicly accessible source Redis service (you might need to set a bind parameter to a publicly reachable network interface in your Redis configuration file). Any firewalls need to be open on port TCP 6379 if using the default to allow traffic from the source to the target servers. Also pay attention to other protections that can restrict connections: SELinux should be disabled or set in permissive mode for the duration of the migration on the source server.
  • The number of Redis databases from source to target needs to match. Use the command redis-cli config get databases. By default, Redis has 16 databases. If you are migrating more databases, adjust accordingly on the target with the command in the section below and create the target service first before migration.

Performing data migration

To perform the migration, you can either use the Portal or the CLI, depending on when the action is performed - and if the service receiving the migration already exists or not.

Run the following command to create a new service and start the migration immediately:

exo dbaas create redis business-1 target-redis-service-name --redis-ip-filter 0.0.0.0/0 --redis-migration-host x.x.x.x --redis-migration-port 6379 --redis-migration-password xxxxx --redis-migration-method replication --redis-migration-ssl true
  • target-redis-service-name : Target DBaaS Service Name
  • –redis-migration-host : the IP address of your source Redis server
  • –redis-migration-port : the port on which your source Redis server is reachable
  • –redis-migration-password : your source Redis server password
  • –redis-migration-method : the chosen method (replication or scan) for migration.

In case the Redis service is already created, you can run the command below:

exo dbaas update --redis-migration-host x.x.x.x --redis-migration-port 6379 --redis-migration-password xxxxx --redis-migration-method dump target-redis-service-name

To check status of our migration we can run command:

exo dbaas migration status target-redis-service-name

And if we want to stop the running migration:

exo dbaas migration stop target-redis-service-name

Note

Ensure you are using at least version 1.53.0 of the Exoscale CLI

In case you need to increase the target Redis service number_of_databases, use this command:

exo dbaas update target-redis-service-name --redis-settings '{"number_of_databases": 20}'

Then check the Redis settings:

exo dbaas show target-redis-service-name --settings redis