Skip to content

Commit

Permalink
Configure cqlsh for TLS for schema setup (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbtcollins authored and yurishkuro committed Nov 26, 2017
1 parent c7b76d4 commit ecb6609
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
24 changes: 24 additions & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,30 @@ docker run \
jaegertracing/jaeger-collector
```

The schema tool also supports TLS. You need to make a custom cqlshrc file like
so:

```
# Creating schema in a cassandra cluster requiring client TLS certificates.
#
# Create a volume for the schema docker container containing four files:
# cqlshrc: this file
# ca-cert: the cert authority for your keys
# client-key: the keyfile for your client
# client-cert: the cert file matching client-key
#
# if there is any sort of DNS mismatch and you want to ignore server validation
# issues, then uncomment validate = false below.
#
# When running the container, map this volume to /root/.cassandra and set the
# environment variable CQLSH_SSL=--ssl
[ssl]
certfile = ~/.cassandra/ca-cert
userkey = ~/.cassandra/client-key
usercert = ~/.cassandra/client-cert
# validate = false
```

### ElasticSearch

ElasticSearch does not require initialization other than
Expand Down
5 changes: 3 additions & 2 deletions plugin/storage/cassandra/schema/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

CQLSH=${CQLSH:-"/usr/bin/cqlsh"}
CQLSH_HOST=${CQLSH_HOST:-"cassandra"}
CQLSH_SSL=${CQLSH_SSL:-""}
CASSANDRA_WAIT_TIMEOUT=${CASSANDRA_WAIT_TIMEOUT:-"60"}
DATACENTER=${DATACENTER:-"dc1"}
KEYSPACE=${KEYSPACE:-"jaeger_v1_${DATACENTER}"}
Expand All @@ -13,7 +14,7 @@ MODE=${MODE:-"test"}
total_wait=0
while true
do
${CQLSH} -e "describe keyspaces"
${CQLSH} ${CQLSH_SSL} -e "describe keyspaces"
if (( $? == 0 )); then
break
else
Expand All @@ -29,4 +30,4 @@ done

echo "Generating the schema for the keyspace ${KEYSPACE} and datacenter ${DATACENTER}"

MODE="${MODE}" DATACENTER="${DATACENTER}" KEYSPACE="${KEYSPACE}" /cassandra-schema/create.sh | ${CQLSH}
MODE="${MODE}" DATACENTER="${DATACENTER}" KEYSPACE="${KEYSPACE}" /cassandra-schema/create.sh | ${CQLSH} ${CQLSH_SSL}

0 comments on commit ecb6609

Please sign in to comment.