is localhost/127.0.0.1 actual connection string or just a print

174 views
Skip to first unread message

Manu Chadha

unread,
Jun 1, 2020, 1:12:02 AM6/1/20
to DataStax Java Driver for Apache Cassandra User Mailing List
My `docker` container is not able to connect with `Cassandra`. In the logs, I see the following error

[trace] CassandraRepositoryComponents - database will connect using parameters uri: cassandra://localhost:9042/, cluster name: Test Cluster
[trace] s.d.c.CassandraConnectionUri - created logger Logger[services.db.cassandra.CassandraConnectionUri]
[trace] s.d.c.CassandraConnectionManagementService - creating session with uri CassandraConnectionUri(cassandra://localhost:9042/) and cluster name Test Cluster
[trace] s.d.c.CassandraConnectionManagementService - exception in connecting with database com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9042 (com.datastax.driver.core.exceptions.TransportException: [localhost/127.0.0.1:9042] Cannot connect), localhost/0:0:0:0:0:0:0:1:9042 (com.datastax.driver.core.exceptions.TransportException: [localhost/0:0:0:0:0:0:0:1:9042] Cannot connect))
Oops, cannot start the server.
play.api.libs.json.JsResult$Exception: {"obj":[{"msg":["Unable to connect with database"],"args":[]}]}

Is `localhost/127.0.0.1` actual connection string which is failing the connection or is it just a print? Should it be either only localhost:9042 or only 127.0.0.1/9042?


Alex Ott

unread,
Jun 1, 2020, 6:28:52 AM6/1/20
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi

This is print representation used by InetAddress

scala> java.net.InetAddress.getByName("localhost").toString
res0: String = localhost/127.0.0.1

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.
To view this discussion on the web visit https://groups.google.com/a/lists.datastax.com/d/msgid/java-driver-user/c63bc4db-7cb2-4732-b1be-9c35d30fc806%40lists.datastax.com.


--
With best wishes,                    Alex Ott
http://alexott.net/
Twitter: alexott_en (English), alexott (Russian)
Reply all
Reply to author
Forward
0 new messages