|
| 1 | +# Endpoint Management |
| 2 | + |
| 3 | +The endpoint commands provide access to Redis Enterprise database endpoint statistics and availability monitoring. |
| 4 | + |
| 5 | +> **Note**: Redis Enterprise manages most endpoint configurations through database commands. These commands provide monitoring and statistics capabilities. |
| 6 | +
|
| 7 | +## Available Commands |
| 8 | + |
| 9 | +### Get Endpoint Statistics |
| 10 | + |
| 11 | +Get aggregate statistics for all database endpoints in the cluster: |
| 12 | + |
| 13 | +```bash |
| 14 | +# Get all endpoint statistics |
| 15 | +redisctl enterprise endpoint stats |
| 16 | + |
| 17 | +# Get statistics as YAML |
| 18 | +redisctl enterprise endpoint stats -o yaml |
| 19 | + |
| 20 | +# Filter to specific metrics |
| 21 | +redisctl enterprise endpoint stats -q '[].{name: endpoint_name, connections: current_connections}' |
| 22 | + |
| 23 | +# Get statistics for endpoints with high connection counts |
| 24 | +redisctl enterprise endpoint stats -q "[?current_connections > `100`]" |
| 25 | +``` |
| 26 | + |
| 27 | +The statistics include: |
| 28 | +- Connection metrics (current, total, failed) |
| 29 | +- Request/response rates |
| 30 | +- Latency information |
| 31 | +- Error counts |
| 32 | +- Bandwidth usage |
| 33 | + |
| 34 | +### Check Endpoint Availability |
| 35 | + |
| 36 | +Check the availability status of a specific database endpoint: |
| 37 | + |
| 38 | +```bash |
| 39 | +# Check endpoint availability for database 1 |
| 40 | +redisctl enterprise endpoint availability 1 |
| 41 | + |
| 42 | +# Get availability as table |
| 43 | +redisctl enterprise endpoint availability 1 -o table |
| 44 | + |
| 45 | +# Extract specific availability information |
| 46 | +redisctl enterprise endpoint availability 1 -q 'available' |
| 47 | +``` |
| 48 | + |
| 49 | +Availability information includes: |
| 50 | +- Current availability status |
| 51 | +- Node availability |
| 52 | +- Shard distribution |
| 53 | +- Failover status |
| 54 | +- Connection health |
| 55 | + |
| 56 | +## Output Examples |
| 57 | + |
| 58 | +### Endpoint Statistics |
| 59 | +```json |
| 60 | +[ |
| 61 | + { |
| 62 | + "endpoint_name": "redis-12345.cluster.local:16379", |
| 63 | + "bdb_uid": 1, |
| 64 | + "current_connections": 45, |
| 65 | + "total_connections": 12543, |
| 66 | + "failed_connections": 2, |
| 67 | + "requests_per_sec": 5432, |
| 68 | + "responses_per_sec": 5430, |
| 69 | + "avg_latency_ms": 0.8, |
| 70 | + "bandwidth_in_mbps": 12.5, |
| 71 | + "bandwidth_out_mbps": 8.3, |
| 72 | + "errors_per_sec": 0.1 |
| 73 | + } |
| 74 | +] |
| 75 | +``` |
| 76 | + |
| 77 | +### Endpoint Availability |
| 78 | +```json |
| 79 | +{ |
| 80 | + "bdb_uid": 1, |
| 81 | + "available": true, |
| 82 | + "endpoints": [ |
| 83 | + { |
| 84 | + "addr": "redis-12345.cluster.local:16379", |
| 85 | + "node": 1, |
| 86 | + "role": "master", |
| 87 | + "status": "active" |
| 88 | + } |
| 89 | + ], |
| 90 | + "shards_placement": "optimal", |
| 91 | + "last_failover": null |
| 92 | +} |
| 93 | +``` |
| 94 | + |
| 95 | +## Common Use Cases |
| 96 | + |
| 97 | +### Monitoring Endpoint Health |
| 98 | + |
| 99 | +Monitor endpoint statistics and set up alerts: |
| 100 | + |
| 101 | +```bash |
| 102 | +# Check endpoints with high error rates |
| 103 | +redisctl enterprise endpoint stats -q "[?errors_per_sec > `10`]" |
| 104 | + |
| 105 | +# Monitor endpoints with connection issues |
| 106 | +redisctl enterprise endpoint stats -q "[?failed_connections > `0`].{name: endpoint_name, failed: failed_connections}" |
| 107 | + |
| 108 | +# Check latency across all endpoints |
| 109 | +redisctl enterprise endpoint stats -q "[].{endpoint: endpoint_name, latency: avg_latency_ms}" -o table |
| 110 | +``` |
| 111 | + |
| 112 | +### Availability Monitoring |
| 113 | + |
| 114 | +Check database endpoint availability during maintenance: |
| 115 | + |
| 116 | +```bash |
| 117 | +# Check availability for critical databases |
| 118 | +for db in 1 2 3; do |
| 119 | + echo "Database $db:" |
| 120 | + redisctl enterprise endpoint availability $db -q 'available' |
| 121 | +done |
| 122 | + |
| 123 | +# Get detailed availability for troubleshooting |
| 124 | +redisctl enterprise endpoint availability 1 -o yaml |
| 125 | +``` |
| 126 | + |
| 127 | +### Performance Analysis |
| 128 | + |
| 129 | +Analyze endpoint performance metrics: |
| 130 | + |
| 131 | +```bash |
| 132 | +# Get top endpoints by connection count |
| 133 | +redisctl enterprise endpoint stats -q "reverse(sort_by([],¤t_connections))[:5]" -o table |
| 134 | + |
| 135 | +# Find endpoints with bandwidth issues |
| 136 | +redisctl enterprise endpoint stats -q "[?bandwidth_in_mbps > `100` || bandwidth_out_mbps > `100`]" |
| 137 | + |
| 138 | +# Compare request/response rates |
| 139 | +redisctl enterprise endpoint stats -q "[].{endpoint: endpoint_name, req_rate: requests_per_sec, resp_rate: responses_per_sec, diff: requests_per_sec - responses_per_sec}" |
| 140 | +``` |
| 141 | + |
| 142 | +## Integration with Monitoring |
| 143 | + |
| 144 | +Export endpoint metrics for monitoring systems: |
| 145 | + |
| 146 | +```bash |
| 147 | +# Export to monitoring format |
| 148 | +redisctl enterprise endpoint stats -o json > endpoint_metrics.json |
| 149 | + |
| 150 | +# Create CSV for analysis |
| 151 | +redisctl enterprise endpoint stats -q "[].{endpoint: endpoint_name, connections: current_connections, latency: avg_latency_ms, errors: errors_per_sec}" | jq -r '["endpoint","connections","latency","errors"], (.[] | [.endpoint, .connections, .latency, .errors]) | @csv' |
| 152 | + |
| 153 | +# Stream to monitoring pipeline |
| 154 | +while true; do |
| 155 | + redisctl enterprise endpoint stats -q '[].{timestamp: now(), metrics: @}' | \ |
| 156 | + curl -X POST http://metrics-collector/ingest -d @- |
| 157 | + sleep 60 |
| 158 | +done |
| 159 | +``` |
| 160 | + |
| 161 | +## Troubleshooting |
| 162 | + |
| 163 | +### High Connection Counts |
| 164 | + |
| 165 | +If endpoints show high connection counts: |
| 166 | + |
| 167 | +```bash |
| 168 | +# Identify affected endpoints |
| 169 | +redisctl enterprise endpoint stats -q "[?current_connections > `1000`]" |
| 170 | + |
| 171 | +# Check database configuration |
| 172 | +redisctl enterprise database get <bdb_uid> -q '{max_connections: max_connections, current: @ | current_connections}' |
| 173 | + |
| 174 | +# Monitor connection trends |
| 175 | +for i in {1..10}; do |
| 176 | + redisctl enterprise endpoint stats -q "[].{endpoint: endpoint_name, connections: current_connections}" -o table |
| 177 | + sleep 30 |
| 178 | +done |
| 179 | +``` |
| 180 | + |
| 181 | +### Availability Issues |
| 182 | + |
| 183 | +When endpoints report availability problems: |
| 184 | + |
| 185 | +```bash |
| 186 | +# Check specific database endpoint |
| 187 | +redisctl enterprise endpoint availability <bdb_uid> |
| 188 | + |
| 189 | +# Verify node status |
| 190 | +redisctl enterprise node list -q "[?status != 'active']" |
| 191 | + |
| 192 | +# Check shard distribution |
| 193 | +redisctl enterprise database get <bdb_uid> -q 'shards_placement' |
| 194 | +``` |
| 195 | + |
| 196 | +## Best Practices |
| 197 | + |
| 198 | +1. **Regular Monitoring**: Set up regular checks of endpoint statistics to catch issues early |
| 199 | +2. **Baseline Metrics**: Establish baseline performance metrics for comparison |
| 200 | +3. **Alert Thresholds**: Configure alerts based on your specific workload patterns |
| 201 | +4. **Correlation**: Correlate endpoint metrics with database and node statistics |
| 202 | +5. **Capacity Planning**: Use connection and bandwidth metrics for capacity planning |
| 203 | + |
| 204 | +## Related Commands |
| 205 | + |
| 206 | +- `redisctl enterprise database` - Manage databases and their endpoints |
| 207 | +- `redisctl enterprise stats` - View detailed statistics |
| 208 | +- `redisctl enterprise node` - Check node status affecting endpoints |
| 209 | +- `redisctl enterprise cluster` - View cluster-wide endpoint configuration |
0 commit comments