apache / apache/cassandra-ccm

Cannot authenticate to basic cluster

Open
#765 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.2k
Forks
309
PR merge metrics
No merged PRs in 30d

Description

I have created a cluster using the following: `ccm create --pwd-auth test --version 4.1.4 --nodes 1 --debug --start`

When I try to connect in a Python integration test using the Cassandra default username and password (cassandra/cassandra), I receive the error:

> cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1:9042': AuthenticationFailed('Failed to authenticate to 127.0.0.1:9042: Error from server: code=0100 [Bad credentials] message="Provided username cassandra and/or password are incorrect"')})

My connection code is as follows:

```
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
from cassandra.policies import DCAwareRoundRobinPolicy

config = {'cassandra': {'hosts': ['127.0.0.1'], 'username': 'cassandra', 'password': 'cassandra', 'keyspace': 'myKeyspace'}}
cluster = Cluster(hosts, auth_provider=PlainTextAuthProvider(username=config['username'], password=config['password']),
load_balancing_policy=DCAwareRoundRobinPolicy())
session = cluster.connect(config['keyspace'])
```

What are the default credentials? How am I supposed to authenticate to the cluster?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.