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"',)})