Skip to content

Redislabs-Solution-Architects/redconn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RedConn

A simple application to test re-connection or failover with Redis, when using Java Jedis or Lettuce.

Build

git clone https://github.com/Redislabs-Solution-Architects/redconn.git
cd redconn
mvn clean install

Run

Without SSL

java -jar target/redconn-1.0.jar --host=redis-12000.demo.redislabs.com --port=12000 --password=<password> --timeout=500

Without SSL, with Lettuce

java -Dlogging.level.com.redis.redconn=DEBUG -jar target/redconn-1.0.jar --port=6379 --driver=lettuce-----

With SSL

java -Djavax.net.ssl.trustStore=/path/to/truststore.jks -Djavax.net.ssl.trustStoreType=jks -Djavax.net.ssl.trustStorePassword=<password> -Djavax.net.ssl.keyStore=/path/to/keystore.p12 -Djavax.net.ssl.keyStoreType=pkcs12 -Djavax.net.ssl.keyStorePassword=<password> -jar target/redconn-1.0.jar --host=redis-12000.demo.redislabs.com --port=12000 --password=<password> --ssl=true --timeout=500

Configuration

Property Description Default

driver

Driver to use (jedis or lettuce)

jedis

host

Redis database host name

localhost

port

Redis database port

6379

ssl

Enable SSL support

false

password

Redis database password

none

timeout

Redis connection timeout

2000 milliseconds

socketTimeout

Redis socket timeout

2000 milliseconds

tcpKeepIdle

Lettuce only. Redis connection tcp_keepalive_time

10 seconds

tcpKeepIntvl

Lettuce only. Redis connection tcp_keepalive_intvl

1

tcpKeepCnt

Lettuce only. Redis connection tcp_keepalive_probes.

2

tcpUserTimeout

Lettuce/Linux only. Redis connection TCP_USER_TIMEOUT

10 seconds

client-name

Jedis client name

redconn

dns-ttl

Number of seconds to cache a successful name service lookup used for jedis

0

dns-negative-ttl

Number of seconds to cache a unsuccessful name service lookup used for jedis

0

failoverHost

Redis database host name of the failover for an active/active configuration

null (no active/active failover)

failoverPort

Redis database port of the failover for an active/active configuration

6380

You can also use -Dlogging.level.com.redis.redconn=DEBUG to have slightly more information.

Run with Jedis failover with Redis active/active

Here is an example running a failover test with a Redis active/active deployment

java -jar target/redconn-1.0.jar --host=redis-12000.demo.redislabs.com --port=12000 --password=<password> --timeout=500 \
    --failoverHost=redis-13000.demo.redislabs.com --failoverPort=13000

About

Connectivity and failover tester for Redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages