Knowledgebase

How to use Redli to Securely Connect to a Managed Database for Redis Print

  • 0

Redli is an open-source Go-based tool that makes TLS/SSL connections to remote Redis Databases. Since the Redis command line tool (redis-cli) does not support TLS/SSL connections natively, Redli serves as the best alternative to the tool with direct TLS support. This article describes how you can use the Redli tool to securely connect to a Rcs Managed Database for Redis.

Prerequisites

Install Redli

  1. For easy accessibility, create a new Redli directory.

      $ mkdir Redli
  2. Switch to the directory.

      $ cd Redli
  3. Using the wget utility, download the latest Redli release file from the project’s GitHub Repository. For this article, v0.7.0 is the latest version.

      $ wget https://github.com/IBM-Cloud/redli/releases/download/v0.7.0/redli_0.7.0_linux_amd64.tar.gz
  4. Extract files from the downloaded tarball.

      $ tar xvf redli_0.7.0_linux_amd64.tar.gz
  5. List the extracted files and verify that a new redli directory is available.

      $ ls

    Output:

      LICENSE.txt
      README.md
      redli

Configure Redli as a System-wide Command

  1. Move the redli binary file to the /usr/local/bin directory where the system looks for standard user executable files.

      $ sudo mv redli /usr/local/bin/
  2. Switch to your user home directory.

      $ cd ~/
  3. Run the redli command to verify that you can access the application.

      $ redli --version

    Output:

      0.5.2     

Connect to a Rcs Managed Database for Redis

When connecting to remote Redis databases, Redli uses the command syntax below:

     $ redli --tls -h <redis-host> -p <port> -a <password>
  • --tls: Activates TLS/SSL connectivity.
  • -h: The remote Redis database host.
  • -p: Redis Port to connect to.
  • -a: Redis database password to authenticate with the server.

The rediss: scheme:

     $ redli -u rediss://user:password@host:port

The -u flag specifies that the connection points to a URI address. You can find your direct Rediss URI in the Rcs Managed Database for Redis control panel.

  1. To connect to your Rcs managed database for Redis, run any of the following commands.

      $ redli --tls -h redis.vultrdb.com -p 1234 -a password

    OR

      $ redli --tls -u rediss://user:password@redis.vultrdb.com:1234

    Replace redis.vultrdb.com, 1234, and password with the actual Rcs Redis database details displayed in your control panel respectively.

  2. Enter PING to verify that you're connected to the Rcs Redis database.

      > PING

    Output:

      PONG
  3. Start managing your Redis database. To close the session, run the following command.

      > exit

Next Steps

In this article, you have used the Redli tool to connect to a Rcs Managed Database for Redis. With a secure connection to your database, you can start managing and safely cutover applications as explained in the following articles.

Redli is an open-source Go-based tool that makes TLS/SSL connections to remote Redis Databases. Since the Redis command line tool (redis-cli) does not support TLS/SSL connections natively, Redli serves as the best alternative to the tool with direct TLS support. This article describes how you can use the Redli tool to securely connect to a Rcs Managed Database for Redis. Prerequisites Deploy a Rcs Managed Database for Redis. Install Redli For easy accessibility, create a new Redli directory. $ mkdir Redli Switch to the directory. $ cd Redli Using the wget utility, download the latest Redli release file from the project’s GitHub Repository. For this article, v0.7.0 is the latest version. $ wget https://github.com/IBM-Cloud/redli/releases/download/v0.7.0/redli_0.7.0_linux_amd64.tar.gz Extract files from the downloaded tarball. $ tar xvf redli_0.7.0_linux_amd64.tar.gz List the extracted files and verify that a new redli directory is available. $ ls Output: LICENSE.txt README.md redli Configure Redli as a System-wide Command Move the redli binary file to the /usr/local/bin directory where the system looks for standard user executable files. $ sudo mv redli /usr/local/bin/ Switch to your user home directory. $ cd ~/ Run the redli command to verify that you can access the application. $ redli --version Output: 0.5.2 Connect to a Rcs Managed Database for Redis When connecting to remote Redis databases, Redli uses the command syntax below: $ redli --tls -h -p -a --tls: Activates TLS/SSL connectivity. -h: The remote Redis database host. -p: Redis Port to connect to. -a: Redis database password to authenticate with the server. The rediss: scheme: $ redli -u rediss://user:password@host:port The -u flag specifies that the connection points to a URI address. You can find your direct Rediss URI in the Rcs Managed Database for Redis control panel. To connect to your Rcs managed database for Redis, run any of the following commands. $ redli --tls -h redis.vultrdb.com -p 1234 -a password OR $ redli --tls -u rediss://user:password@redis.vultrdb.com:1234 Replace redis.vultrdb.com, 1234, and password with the actual Rcs Redis database details displayed in your control panel respectively. Enter PING to verify that you're connected to the Rcs Redis database. > PING Output: PONG Start managing your Redis database. To close the session, run the following command. > exit Next Steps In this article, you have used the Redli tool to connect to a Rcs Managed Database for Redis. With a secure connection to your database, you can start managing and safely cutover applications as explained in the following articles. Implement Redis Transactions and Locks with Golang and MySQL on a Linux Server. Implement Redis Queue and Worker with PHP on Ubuntu 20.04. How to setup Redis Caching for WordPress with Ubuntu 20.04 and Nginx. Create a Redis Leaderboard with Golang.

Was this answer helpful?
Back

Powered by WHMCompleteSolution