Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

alwayslearning3456_191423 avatar image
alwayslearning3456_191423 asked Erick Ramirez answered

Unable to access cqlsh, getting "Name or service not known"

i have created one OS level user and casssandra DB user 'ABC' and tried to access the CQLSH which is ssl enabled.

But when i try to access the same i can see the below error,

$ ./cqlsh -u ABC --ssl /cert.pem
...
Traceback (most recent call last):
File "/dse-6.7.5/resources/cassandra/bin/dsecqlsh.py", line 510, in <module>
cqlsh.main(*cqlsh.read_options(sys.argv[1:], os.environ))
File "/dse-6.7.5/resources/cassandra/bin/cqlsh.py", line 2460, in main
encoding=options.encoding)
File "/dse-6.7.5/resources/cassandra/bin/dsecqlsh.py", line 342, in __init__
execution_profile = ExecutionProfile(load_balancing_policy=WhiteListRoundRobinPolicy([hostname]),
File "/dse-6.7.5/resources/cassandra/bin/../lib/dse-driver-internal-only-2.5.0-48ba59d8.zip/dse-driver-2.5.0-48ba59d8/dse/policies.py", line 420, in __init__
socket.gaierror: [Errno -2] Name or service not known
cqlsh
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

smadhavan avatar image
smadhavan answered

@alwayslearning3456_191423, were you able to login with the default (or any other DB) user role? i.e. ./cqlsh `hostname` -u cassandra -p cassandra --ssl --debug (notice I'm using the proper hostname, passing in an additional --debug argument and also not using the /cert.pem path in my example here). I am also assuming that ~/.cqlshrc file is properly configured.

2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thank you so much for the response , got it fixed configured .cqlshrc

1 Like 1 ·
smadhavan avatar image smadhavan ♦ alwayslearning3456_191423 ·

Great, thanks for reporting back!

0 Likes 0 ·
Erick Ramirez avatar image
Erick Ramirez answered

Noting here for future reference, there was a configuration issue in the cqlshrc file with the hostname leading to:

socket.gaierror: [Errno -2] Name or service not known

This error is a result of the driver unable to resolve the hostname. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.