Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Connecting a GeminiDB Redis Instance over SSL

Updated on 2025-01-24 GMT+08:00

GeminiDB Redis allows you to connect to a GeminiDB Redis instance through Redis-cli in SSL mode for data encryption and higher security. This section describes how to connect to a GeminiDB Redis instance using SSL.

Usage Notes

  • The target instance must be in the same VPC and subnet as the ECS.
  • The ECS must be in a security group that has access to the instances. For details, see Configuring Security Group Rules for a GeminiDB Redis Instance.
  • After the SSL connection is enabled, download the SSL certificate for your applications to access to the GeminiDB Redis instance.
  • If the SSL connection is used, ensure that the Redis client, for example, Redis-cli 6.x, supports SSL.

Prerequisites

An ECS has been created. The following uses a Linux ECS as an example. For details, see Purchasing an ECS in Getting Started with Elastic Cloud Server.

Procedure

  1. Log in to the ECS. For details, see Logging In to an ECS in Getting Started with Elastic Cloud Server.
  2. Obtain the Redis client.

    Method 1

    Run the following command to download the Redis client.

    wget https://download.redis.io/releases/redis-6.2.6.tar.gz

    Method 2

    Download the Redis client and upload the Redis client installation package to the ECS.

  3. Obtain the SSL certificate.

    Click the target instance name. On the Basic Information page, in the Connection Information area, click the download button in the SSL field to obtain the SSL certificate.

    Figure 1 Obtaining the SSL certificate

  4. Upload the SSL certificate to the ECS.
  5. Check the OpenSSL version supported by the ECS OS.

    openssl version
    NOTE:
    • The SSL function provided by GeminiDB Redis supports only TLS 1.3 or later.
    • The OpenSSL version in the ECS OS must be 1.1.1 or later so that redis-cli can support TLS 1.3 or later.
    • If the OS version is earlier than 1.1.1, perform the following steps to install OpenSSL:
      wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
      tar -zxvf openssl-1.1.1m.tar.gz
      cd openssl-1.1.1m/
      ./config --prefix=/usr/local/openssl-1.1.1m_install_dir
      make
      make install

      After OpenSSL is installed, go to 6.

    • If the OS is 1.1.1 or later, go to 6.

  6. Decompress the client package.

    tar -xzf redis-6.2.6.tar.gz

  7. Open the src directory and connect to the DB instance.

    • If the required OpenSSL version has been installed by performing 5 and the version is earlier than 1.1.1, you can connect to the DB instance using the following method:
      cd redis-6.2.6
      make BUILD_TLS=yes OPENSSL_PREFIX=/usr/local/openssl-1.1.1m_install_dir
      cd src
      LD_PRELOAD=/usr/local/openssl-1.1.1m_install_dir/lib/libssl.so.1.1:/usr/local/openssl-1.1.1m_install_dir/lib/libcrypto.so.1.1 ./redis-cli -h <DB_HOST> -p <DB_PORT> -a <DB_PWD> --tls --cacert <CACERT_PATH>

      Example:

      LD_PRELOAD=/usr/local/openssl-1.1.1m_install_dir/lib/libssl.so.1.1:/usr/local/openssl-1.1.1m_install_dir/lib/libcrypto.so.1.1 ./redis-cli -h 192.168.0.208 -p 6379 -a <DB_PWD> --tls --cacert ./cacert.crt
    • If the OpenSSL version in the ECS OS is 1.1.1 or later, you can connect to the DB instance using the following method:
      cd redis-6.2.6
      make BUILD_TLS=yes
      cd src
      ./redis-cli -h <DB_HOST> -p <DB_PORT> -a <DB_PWD> --tls --cacert <CACERT_PATH>

      Example:

      ./redis-cli -h 192.168.0.208 -p 6379 -a <DB_PWD> --tls --cacert ./cacert.crt
    Table 1 Parameter Description

    Parameter

    Description

    <DB_HOST>

    Private IP address of an instance to be connected.

    To obtain this IP address, go to the Instances page, locate the instance, and click its name. The IP address can be found in the Private IP Address field under Node Information on the Basic Information page.

    If the instance you purchased has multiple nodes, select the private IP address of any node.

    <DB_PORT>

    Port for accessing the target instance. Configure this parameter based on service requirements.

    To obtain the port number, perform the following steps:

    On the Instances page, locate the instance and click its name. On the Basic Information page, in the Network Information area, view the database port.

    <DB_PWD>

    Administrator password set when you buy a GeminiDB Redis instance

    <CACERT_PATH>

    SSL certificate path

  8. Check the results. If information similar to the following is displayed, the connection is successful.

    IP:port>

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback