brianfrankcooper / YCSB

Yahoo! Cloud Serving Benchmark
Apache License 2.0
4.86k stars 2.22k forks source link

[redis] Adding SSL/TLS support for all Redis environments and password authentication for Redis clusters #1685

Open zjavaperf opened 9 months ago

zjavaperf commented 9 months ago

Hi,

this is Marc from IBM. Not sure where the right place to say "Hello" is, so I will try here. Since I haven't contributed to YCSB yet, let me quickly introduce myself. I am a Java Performance Analyst and work in the IBM Lab in Boeblingen, Germany. Nowadays, I spend most of my time improving the performance of IBM products, but I also have a long history of analyzing and optimizing the performance of customer Java applications. The team that I am currently part of makes heavy use of YCSB for all kinds of benchmarking purposes.

When trying to benchmark Redis on various different server platforms, I noticed that the current version of the Redis binding in YCSB (a) doesn't support passwords for Redis clusters and that (b) SSL/TLS support is missing for both clustered and non-clustered Redis environments. The patch that I am proposing fixes both (a) and (b).

Please note that I haven't touched the client's data access logic at all. What I mean by this is that all calls into the underlying Jedis library like hmget(), hmset(), etc. are completely unchanged. I "only" added support for the above mentioned functionality (a) and (b) when initializing the existing JedisCommands object called jedis, which is used to talk to both clustered and standalone Redis installations.

Since the version numbering of the Redis database and the Jedis client library have diverged quite substantially, I've reflected this in the corresponding .pom files: I changed redis.version to jedis.version in order to make it clear that it's really the Jedis version that is used for building the Redis binding inside of YCSB.

Last but not least, in order to actually connect to an SSL/TLS-enabled Redis cluster, you have to set up a Java keystore and add the following command line arguments to your YCSB command line: -jvm-args "-Djavax.net.ssl.trustStore=/path/to/your/redis-keystore -Djavax.net.ssl.trustStorePassword=..."

That's it - looking forward to your comments on this patch!

Cheers, Marc