Creating a new Redise Pack database
You can create as many databases as you wish in the cluster, so long as you do not exceed the available memory or the number of shards you purchased in your subscription.
To create a new database in the UI:
- On the Databases page, click the + (plus) sign below the table.
The buttons of the various database types that can be created will appear.
Note: If no databases exist, the new database buttons are displayed upon entering the page.
- Select the type of database to create: a Redis database or a Memcached database.
Note: If the nodes in your cluster are Flash-enabled, you can opt to create a Redise Flash database or a Memcached Flash database. For additional details, refer to Redise Flash.
- Enter a name for the database.
The database name must comply with the following rules:
- Length: up to 63 characters.
- Characters: only letters, digits and hyphen (‘-‘) are allowed.
- Start with a letter and end with a letter or digit.
Note: The database name is case-insensitive, i.e. uppercase and lowercase letter are treated exactly the same.
- Set the memory limit of the database. The application displays the total amount of memory available in the cluster. For relevant considerations, refer to Database memory limit.
Note: If you create a Redis Flash or a Memcached Flash database, you also have to set the RAM-to-Flash ratio for this database. Minimum RAM portion is 10%, and maximum RAM portion is 50%. For additional details, refer to Redise Flash.
Note: The name and the memory limit are the only mandatory parameters.
- Specify whether to enable replication. For a full explanation, refer to Database replication.
Note: Enabling replication affects the total database size, as explained in Database memory limit.
- If the cluster is configured to support rack-zone awareness, once you enable replication you can also choose whether to enable rack-zone awareness for the database. For additional details, refer to Rack-zone awareness.
- Specify whether to enable data persistence, and if so, what type to employ. For a full explanation, refer to Database persistence.
- Next, you can specify security settings:
- If you are creating a Redis database, enter a Redis password.
- If you are creating a Memcached database, enter a username and password for SASL Authentication.
- If you would like to define the port number that will be part of the endpoint used to connect to the database, you can insert it in the endpoint port number field. If you do not define it the system will allocate a randomly selected free port.
Note: Defining the port number during database creation is a one-time operation; the number cannot be changed at a later stage. For additional details, refer to Machine ports configuration.
- Select whether to enable database clustering. If you enable clustering, select the number of database shards. For a Redis database, select also the hashing policy. For additional details, refer to Database clustering.
- Set the data eviction policy (for additional details, refer to Database eviction policy). This policy is applied when the total size of the database reaches its memory limit.
- If you would like the database to be a replica of one or more databases, you can define the source databases with which this database will synchronize on an ongoing basis. For additional details, refer to Replica of.
- If you would like to encrypt the connection to the database endpoint with SSL encryption, you have to enter the contents of the client certificate to the SSL client authentication field. For additional details, refer to Securing client connection with SSL.
- Specify whether to perform a periodic back up of the database. For additional details, refer to Database backup. If you specify periodic backup, set the interval and specify the backup location parameters, as appropriate.
- Configure database alerts. For additional details, refer to Database alerts.
- Click Activate.
Simple Connectivity Test
There are two simple ways to check connectivity to your database:
As a quick smoke test, telnet to your endpoint and port for the database you wish to test. Then do the redis PING command. You should see something like this:
$ telnet redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com 19836
Connected to redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com.
Escape character is ‘^]’.
The AUTH command is only needed if your database has a Redis password, if not then omit that line.
You will find the endpoint and port for the database in the web UI on the configuration page of each database.
It would be best to load the redis-cli command line utility for future use as it has features you may want to use to manage your Redis databases.
$ redis-cli -h redis-19836.c9.us-east-1-2.ec2.cloud.redislabs.com -p 19836 -a astrongpassword
You can get redis-cli and other command line redis tools through your favorite package manager or by installing Redise Pack.