Redis Connection

See the Connector Marketplace topic. Please request your administrator to start a trial or subscribe to the Premium Redis connector.

Redis is an open-source, high-performance, and in-memory data structure store, commonly used for caching.

Redis versions 2.8.0 and above are supported.

This topic describes how to authenticate to Redis and configure any necessary connection properties in the Redis connection connector.

Prerequisites

Set the Server connection property to the name or address of the server your Redis instance is running on.

If your Redis server is running on a port other than the default (6379), you can specify your port in the Port property.

Authenticating to Redis

Connections to Redis instances that aren’t password protected are supported as well.

No Authentication

Set the AuthScheme property to None. This indicates the Redis instance is not password protected (using the requirepass directive in the configuration file).

Password

Set the AuthScheme property to Password and set the Password property to the password used to authenticate with a password protected Redis instance using the Redis AUTH command.

ACL (Access Control List)

Set the following to connect:

  • AuthScheme: Set this to ACL.

  • User: Set this to the username you use to authenticate with Redis ACL.

  • Password: Set this to the password you use to authenticate with Redis ACL.

Securing Redis Connections

You can set UseSSL to negotiate SSL/TLS encryption when you connect.


Connection Configuration

Each connection property available in the Redis connector is explained below.


Connection Name

The name of the connection to be created should be provided. This is the name that will display on the list of available connections.


Connection Type

Option to choose between either connecting securely using SSH Tunnel or, proceed with a Direct Connection when connecting to Redis.

If Connection Type value is SSH Tunnel, additional fields will be displayed.

To know more about SSH Tunneling with Gathr, see SSH Tunneling


SSH Tunnel

If SSH Tunnel is selected, additional configuration parameters will get listed.

SSH Key

The SSH key should be provided to authenticate the associated SSH host and SSH user.

SSH Host

Public IP address of your SSH host.

SSH User

Default SSH username.


If Connection Type value is Direct Connection, then proceed by updating the following fields.


Server

The host name or IP address of the server hosting the Redis instance.


Port

The port for the Redis database.


Auth Scheme

The authentication mechanism that the provider will use to authenticate with Redis.

Choose one of the following:

  • Password: The connector attempts to connect using the AUTH Redis command, using Password.

  • ACL: The connector authenticates using ACL credentials.

  • None: Indicates that the Redis instance is not password protected (using the requirepass directive in the configuration file).


User

The username provided for authentication with Redis ACL.


Password

The password used to authenticate with Redis.


Logical Database

The index of the Redis Logical Database.

The default value is 0.


Tables

This property restricts the tables reported to a subset of the available tables. For example, Tables=TableA,TableB,TableC.

Listing the tables from some databases can be expensive. Providing a list of tables in the connection string improves the performance.

This property can also be used as an alternative to automatically listing views if you already know which ones you want to work with and there would otherwise be too many to work with.

Specify the tables you want in a comma-separated list. Each table should be a valid SQL identifier with any special characters escaped using square brackets, double-quotes or backticks. For example, Tables=TableA,[TableB/WithSlash],WithCatalog.WithSchema.TableC With Space.

Note that when connecting to a data source with multiple schemas or catalogs, you will need to provide the fully qualified name of the table in this property, as in the last example here, to avoid ambiguity between tables that exist in multiple catalogs or schemas.


Define Tables

Define the tables exposed by the provider using table names and Redis key patterns.

This property is used to define the key pattern within Redis that will appear as tables. The value is a comma-separated list of name-value pairs in the form [Table Name]=[Redis key pattern]. Table Name is the name of the table you want to use for the data and will be used when issuing queries. The Redis key pattern is the pattern to be used to group and pivot corresponding keys into the named table.

Example:

DefineTables="DefinedTable1=table1:*,DefinedTable2=table2:*"

Given this value, all of the keys that begin with “table1:” will be found in DefinedTable1, while all keys that begin with “table2:” will be found in DefinedTable2.

If there is any conflict between tables defined with this property and those defined by the TablePattern, these statically defined tables will take precedence.


Pattern Separator

Define the table pattern’s delimiter.

This property is used in tandem with TablePattern to define the delimiter character for the pattern, which determines where the table names derived from the key pattern will end.

This is especially useful when there is more than one delimiter in your TablePattern.

For example, if TablePattern is set to @:* and there is a key called “first@second:1”, a pattern separator of “@” produces the table name “first” and a PatternSeparator of “:” produces the table name “first@second”.

Note that the behavior of the pattern separator is greedy, meaning the last instance of the separator character is used to specify the end of the table name.

For example, if there is a key called “first:second:1”, a pattern separator of “:” produces the table name “first:second”.


Reader Endpoints

The slave hosts and port array, which indicates the Redis Master/Slave cluster’s slave instances, are split by a comma.

Example: ReaderEndpoints=app:6381,app:6382;


Table Pattern

Define the tables exposed by the provider using Redis key patterns.

This property is used to define the key patterns within Redis that will appear as tables. The value is a Redis key pattern. The Redis key pattern is a string pattern containing a separator to determine a hierarchical structure for the key-values stored in the Redis data store. Any other string patterns in the value will limit which keys will be pivoted and returned as tables.

For example, TablePattern="*:*" causes the “:” character to be used as the separator. Given the following keys;

user:1001, user:1002, user:1003, admin:001, admin:002, admin:003

two tables would be exposed, user and admin, with the related keys corresponding to individual rows in each table.


Enable Cluster

This field sets whether the Redis Cluster Mode is enabled.

Replica Set

This property allows you to specify multiple servers in addition to the one configured in Server and Port. Specify both a server name and port; separate servers with a comma.

This property only works when EnableCluster is True. This property allows you to specify the other servers in the replica set in addition to the one configured in Server and Port. You must specify all servers in the replica set using ReplicaSet, Server, and Port.

Specify both a server name and port in ReplicaSet; separate servers with a comma. For example:

Server=localhost;Port=6379;ReplicaSet=localhost:6380,localhost:6381;

To find the primary server, the connector queries the servers in ReplicaSet and the server specified by Server and Port.


Enable SSL

Option for creating the connection with SSL enabled.

Upload Keystore File

Option to upload keystore file.


Add Configuration: Additional properties can be added using this option as key-value pairs.


After entering all the details, click on the TEST button.

If the connection service identification and authentication details are provided correctly, a success message stating “connection available” is generated.

Click on the CREATE button to save the changes.

If the details are incorrect or the server is down, you will get a message “Connection unavailable”.

Top