Create Redis Data Source
NineData supports adding various types and environments of data sources to the console for unified management. You can use database DevOps, backup and recovery, data replication, and database comparison features for data sources that have been added. This article introduces how to add a Redis data source to NineData.
Prerequisites
The server IP address of NineData has been added to the data source allowlist. Please refer to the image below for instructions on how to obtain the server IP address.
Make sure you have available data source quota; otherwise, the data source cannot be added. You can quickly check your remaining quota at the top-right corner of the NineData console.
Operation Steps
Log in to the NineData Console.
On the left navigation pane, click > .
- Click tab, and click on the page. In the popup window for selecting the data source type, choose > (the type of data source to be added), and configure the parameters based on the table below on the page.tip
If you make a mistake during the operation, you can click the
icon at the top of the page to make a new selection.
Configure the parameters of the data source:
Parameter Description Enter the name of the data source. To facilitate subsequent search and management, please use meaningful names. Choose the access method of the data source. Supports access through , , SSH Tunnel three methods. - : Access the data source through a public network address.
- (, not supported): A secure and fast intranet access method provided by NineData, you need to first connect the host where the data source is located, please refer to Add Gateway for the connection method.
- SSH Tunnel (, not supported): Access the data source through an SSH tunnel.
Choose the deployment type of your Redis database. - : Standalone deployment.
- : A high availability solution based on the master-slave replication model, under the sentinel mode, there are multiple Redis instances and several sentinel processes in the system, if the master node goes down, the sentinel will automatically upgrade one of the slave nodes to a new master node, ensuring the high availability of the system.
- : Data is distributed across multiple nodes in the cluster and automatically handles data sharding and data migration between nodes. Each node is responsible for processing part of the data, providing high performance and high availability.
choose configuration items - : The public network connection address and port of the data source.
- : The name of the master node specified in the sentinel configuration, defined by the
master-name
parameter. - : In sentinel mode, the node address and port where the sentinel process is located, used to monitor the status of the master-slave nodes, take corresponding measures in case of failure or when failover is needed, click to add multiple sentinel nodes.
- : The name of the master node specified in the sentinel configuration, defined by the
- : In cluster mode, the address and port of all Redis nodes, click to add multiple Redis nodes. Please add all nodes here, missing nodes may cause some cluster-related operations to fail.
choose configuration items - : Select the NineData gateway installed on the host where the data source is located.
- : Can be written as localhost (data source is on this machine) or the intranet IP of the host where the data source is located.
choose SSH Tunnel configuration items - : Enter the public IP or domain name of the server where the target data source is located, as well as the corresponding port number (the default port number for SSH service is 22).
- : Choose the SSH authentication method.
- : Connect through (i.e., the server's login name) and (i.e., the server's login password).
- : Enter the login username of the server where the target data source is located.
- : Enter the login password of the server where the target data source is located.
- (recommended): Connect through and .
- : Enter the login username of the server where the target data source is located.
- : Click to upload the private key file, which is a key file without a suffix. If you have not created one, please refer to Generate SSH Tunnel Key File.
- : Enter the password set when the key file was generated. If you did not set a password during the key generation process, leave this field blank.
Note: After the SSH configuration is completed, you need to click the on the right, there may be the following two results: - : Connect through (i.e., the server's login name) and (i.e., the server's login password).
- Prompt : Indicates that the SSH Tunnel has been established.
- Prompt error message: Indicates the connection failed, you need to troubleshoot the cause of the failure according to the error message and retry.
- : Can be written as localhost (data source is on this machine) or the intranet IP of the host where the data source is located.
The username of the data source. Some older versions of cloud vendors may have authentication failure issues. If you confirm that the account password is correct but still prompt authentication failure, please leave this item blank and then input the account name and password in the format of <username>@<password>
or<username>:<password>
in (different cloud vendors have different formats). For example:example_user@abcdefg
orexample_user:abcdefg
.The password of the data source. Choose the region closest to your data source location to effectively reduce network latency. Select based on the actual business purpose of the data source, as an environmental identifier of the data source. Default provides and environments, and supports you to create a custom environment.
Note: Under the organization mode, the database environment can also be applied to permission policy management, for example, the default role only supports access to data sources in the environment and cannot access data sources in other environments. More information, please refer to Manage Roles.Whether to use SSL encryption to access the data source (default off). If the data source enforces SSL encrypted connections, this switch must be turned on, otherwise, the connection will fail.
Click the switch on the right to turn on or off encrypted transmission. Click the > on the left side of to expand detailed configuration.- : Supports the following two methods.
- : Automatically detect the SSL status of the server, if the server has SSL enabled, it will connect through SSL first, if the server does not have SSL enabled, it will connect in a non-SSL manner.
- : Always use SSL to connect to the data source, if the server does not support this method or cannot establish an SSL connection for other reasons, the connection will fail.
- : If the server uses a certificate issued by a self-signed CA, you need to upload the root certificate of this CA here.
- : If the server requires the client to provide a certificate, you need to upload the client's certificate and key here, the MySQL server will verify the information you upload to ensure the security of the connection.
After all configurations are completed, click the next to to test whether the data source can be accessed normally, if prompted , you can click to complete the addition of the data source. Otherwise, please recheck the connection settings until the connection test is successful.
Appendix II: Add NineData's IP address to the database whitelist
When adding data sources located in , you need to add the IP address of the NineData service to the database whitelist to allow NineData to provide services.
All versions of Redis can add IP whitelists in the following way.
Open the Redis configuration file
redis.conf
with a text editor, which is usually located at:/etc/redis/redis.conf
.Find the
bind
parameter and configure its value to the IP address or address segment that needs to be allowed to access, multiple IP addresses or address segments are separated by spaces or English commas (,).Example:
bind 121.199.39.25 123.57.58.208
Find the
protected-mode
parameter and configure its value tono
to allow external connections to access Redis.Example:
protected-mode no
Save the configuration file.