pravega / pravega-benchmark

Performance benchmark tool for Pravega
Apache License 2.0
8 stars 22 forks source link

Issue 105: Fix TLS connection config error #106

Closed ravisharda closed 4 years ago

ravisharda commented 4 years ago

Changelog description
Fix TLS connection config error.

When talking to TLS enabled server, while the client communicated with the Controller over TLS, it attempted to communicate with Segment Store services over plaintext channels, as opposed to the TLS channel it should have used. This led to Segment Store rejecting the connection and the exceptions shared in issue #105. This PR fixes that issue.

Purpose of the change
Resolves #105.

What the code does
The code in this PR does the following:

How to verify it
Here's how the verify it:

  1. Start the Pravega Standalone server with TLS and auth enabled. (Steps)

  2. Run Pravega benchmark with TLS and auth params specified.

    # Supply TLS and Auth Parameters via Environment Variables. 
    $ JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/path/to/client.truststore.jks"
    $ JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS} -Dpravega.client.auth.method=Basic"
    $ JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS} -Dpravega.client.auth.token=YWRtaW46MTExMV9hYWFh"
    $ export JAVA_TOOL_OPTIONS
    
    # Execute a command using the Pravega Benchmark tool. 
    $ ./run/pravega-benchmark/bin/pravega-benchmark -scope test-scope -producers 1 \
       -controller "tls://localhost:9090" \
       -events 1 -time 5 -segments 1 -size 10 -stream test-stream

    The output should indicate a successful run, and should have no security exceptions.

    .... INFO io.pravega.perf.PerfStats - 5 records Writing ...
  3. Try running another command that writes and reads, and check the output looks good.

    $ ./run/pravega-benchmark/bin/pravega-benchmark \
     -controller "tls://localhost:9090"  \
     -scope test-scope2 -stream test-stream2  \
     -segments 1  \
     -producers 1 -consumers 1  \
     -size 100 \
     -throughput -1 \
     -time 30