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

nagasree963_193876 avatar image
nagasree963_193876 asked ·

Why can't I login with cqlsh to DC2 of my cass-operator cluster?

I created 2 datacenters in one cluster. Below is datacenter1 yaml file

# Sized to work on 3 k8s workers nodes with 2 cores / 8 GB RAM
apiVersion: cassandra.datastax.com/v1beta1
kind: CassandraDatacenter
metadata:
name: dc1
spec:
clusterName: cluster1
serverType: cassandra
serverVersion: "3.11.6"
managementApiAuth:
insecure: {}
size: 3
racks:
- name: rack1
- name: rack2
- name: rack3
resources:
requests:
memory: 4Gi
cpu: 1000m
storageConfig:
cassandraDataVolumeClaimSpec:
storageClassName: server-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
config:
cassandra-yaml:
num_tokens: 8
authenticator: org.apache.cassandra.auth.PasswordAuthenticator
authorizer: org.apache.cassandra.auth.CassandraAuthorizer
role_manager: org.apache.cassandra.auth.CassandraRoleManager
jvm-options:
initial_heap_size: "2G"
max_heap_size: "2G"
additional-jvm-opts:
- "-Dcassandra.system_distributed_replication_dc_names=dc1"
- "-Dcassandra.system_distributed_replication_per_dc=3"

same yaml file I maintained for dc2, I just changed the datacenter name as dc2. Remaining was unchanged.Secret file will created by default. I can connect to cqlsh for 1st datacenter by using the default credentials. But, I was unable to connect to cqlsh for 2nd datacenter by using those default credentials. How can I connect to cqlsh for 2nd datacenter. I am getting the error as below:

Defaulting container name to cassandra.
Use 'kubectl describe pod/cluster1-dc2-rack1-sts-0 -n cass' to see all of the containers in this pod.
Connection error: ('Unable to connect to any servers', {'127.0.0.1': AuthenticationFailed('Failed to authenticate to 127.0.0.1: Error from server: code=0100 [Bad credentials] message="Unable to perform authentication: Cannot achieve consistency level LOCAL_ONE"',)})
cass-operator
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.

1 Answer

saravanan.chinnachamy_185977 avatar image
saravanan.chinnachamy_185977 answered ·

Hi @nagasree963_193876 Please try the following steps and let us know if that resolves the issue.

  1. Login to dc1 <cqlsh> shell.
  2. Alter the following key spaces.
    • alter keyspace system_auth with replication= {'class' : 'NetworkTopologyStrategy','dc1' : 3,'dc2' : 3};
    • alter keyspace dse_security with replication= {'class' : 'NetworkTopologyStrategy','dc1' : 3,'dc2' : 3};
  3. Login to each pod (in both dc1 and dc2) and run the following commands.
    • nodetool flush
    • nodetool repair
  4. Now try to connect to dc2 <cqlsh> shell.
1 comment 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 @sravanan.chinnachamy


It worked for me. Now, I am able to connect dc2<cq1sh> shell

1 Like 1 · ·