Skip to content

Redis Cluster Issue with Memory and Connections

Redis Cluster Issue with Memory and Connections in Redis Issues.

2 min read Updated SS RS

Redis Cluster Issue with Memory and Connections#

Redis nodes 2 and 3 were unable to start, with memory usage on each node of the 6-node Redis cluster exceeding 98%.

RCA: The high memory consumption prevented nodes from starting. Additionally, the maximum number of connections on Consul was exceeded, contributing to the issue.

Solution:

  1. Memory Increase: 1GB of memory was added to each node.
  2. Connection Limit Increase: The maximum connections were increased to 2000 on each node in below file,

    /etc/consul.d/consul.hcl
    
    1. Restart both Consul and Nomad services on each node.
    2. Permission Issues: On the heal db-3 node, a lack of permissions on the /heal mount point prevented the formation of the OpenSearch and Consul clusters.
    3. Bootstrap Adjustment: The value of bootstrap in below file was changed from 6 to 5,
    /etc/consul.d/consul.hcl
    

    This facilitates the restart of Consul and Nomad services on each node.

  3. Data Receiver Timeout Adjustment: The max connections per user were increased from 22,000 to 48,000 on each data receiver node, and the socket timeout settings in Consul keys were adjusted from 90 milliseconds to 120,000 milliseconds , resolving data collection issues in the UI.

    Adjustments Made:

    1. Increased ulimit for max user processes to 48,000 .
    2. Adjusted Consul keys for service socket timeouts to 120,000 milliseconds for various services.

Redis Connection Failure (UI and Control Center Access Issue)#

During an attempt to access the Control Center (CC) and User Interface (UI) in the customer environment (2.3.1 dev branch installer), the services were running, but the logs were not printing, and both CC and UI were inaccessible.

The investigation revealed missing Consul keys and Redis connection issues.

Solution :

  1. Identified Missing Consul Keys: Add the following missing Consul keys,

    consul kv put service/redis/sslenabled true
    consul kv put service/data/receiver/kpi/endpoint
    https://192.0.2.85:9998/raw-agents-kpi-data
    consul kv put service/redis/nodes redis-node1.example:7001,redis-
    node1.example:7002,redis-node1.example:7003,redis-
    node1.example:7004,redis-node1.example:7005,redis-
    node1.example:7006
    consul kv put service/controlcenter/kpi/aggs/bucket/size 500
    consul kv put service/connector/ssl/enable true
    consul kv put service/controlcenter/kpi/lookback/days 30
    
    1. After updating the Consul keys, restart the services.
    2. The logs will be generated correctly. However, the CC and UI will not be accessible.
    3. Redis Connection Failure : Upon checking the logs, the following Redis connection error was identified:
    ERROR c.a.a.c.m.RedisConnectionManager:116 - Error occurred while
    establishing the connection with Redis Cluster - redis-
    node1.example:7001,redis-node1.example:7002,redis-
    node1.example:7003,redis-node1.example:7004,redis-
    node1.example:7005,redis-node1.example:7006, SSL:true, Username:
    io.lettuce.core.RedisConnectionException: Unable to establish a
    connection to Redis Cluster
    

    The error indicated that the application could not establish a connection to the Redis cluster, likely due to missing port openings between the Control Center/UI and Redis nodes.

  2. Port Opening Issue : The Redis cluster was running on ports `7001 ` through `7006 `, and these ports needed to be opened for proper communication between the UI and Redis boxes.

    Required Ports: `7001, 7002, 7003, 7004, 7005, 7006` between the Control Center/UI and Redis box.

Solution : After opening the required ports between the Control Center/UI and Redis, the connection to Redis will be successfully established.