Hello! I’m doing a local test and I would like to connect to my cassandra db that is in azure, specifically a cosmosdb with cassandra api. The correct way to connect from the command line is:
SET SSL_VERSION=TLSv1_2
SET export SSL_VALIDATE=false
cqlsh myhost 10350 -u myuser -p mypassword --connect-timeout 20 --ssl --cqlversion=3.4.4
However, I was reviewing the master image and the connection to cassandra would be something like this:
wait_for_cassandra() {
server=`echo $CASSANDRA_SEEDS | awk -F ',' '{print $1}'`
until cqlsh --cqlversion=3.4.4 $server < /dev/null; do
echo 'waiting for cassandra to start up'
sleep 1
done
echo 'cassandra started'
}
Which does not allow me to execute by parameter all the values environment in my docker-compose:
- "SSL_VERSION=TLSv1_2"
- "SSL_VALIDATE=false"
- "CASSANDRA_SEEDS=cqlsh myhost 10350 -u myuser -p mypassword --connect-timeout 20 --ssl --cqlversion=3.4.4"
Apparently I advance a little more, but I receive the following error:
cassandra schema version compatibility check failed: unable to create CQL Client: gocql: unable to create session: failed to resolve any of the provided hostnames
I wanted to check first, if it is possible to connect to a cassandra raised in this way (cosmos db with cassandra api) and if it is, if there are configurable parameters
EDIT
I did a test with go and gocql and everything works fine, but since cadence no.
cluster := gocql.NewCluster("myuser.myhost")
cluster.Port = 10350
var sslOptions = new(gocql.SslOptions)
sslOptions.EnableHostVerification = false
EDIT
Add the env LOG_LEVEL = debug
and I can see that cassandra can receive User and Password, but I don’t know what variable I can add in the docker-compose to take the values. Try CASSANDRA_USER
and CASSANDRA_PASSWORD
but nothing.