New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cassandra is not configured to take rack placement into account during replication #97
Comments
Also, to add to the context, keyspaces created in Cassandra (config and analytics) use SimpleStrategy instead of NetworkTopologyStrategy and some have replication_factor set to 1 or 2, not 3. system_auth keyspace specifically has replication_factor set to 1 while the recommended one would be 3 for HA deployments. https://docs.datastax.com/en/security/6.0/security/secSystemKeyspace.html
|
In the 5.1 branch this appears to be set in _cassandra_ensure_keyspace for one of the Cassandra instances based on the total number of nodes in a cluster:
For contrail-analytics the replication factor is hard-coded to be set to 2 for just one keyspace (ContrailAnalyticsCql): https://github.com/Juniper/contrail-analytics/blob/082493863e99b0656f1f7a589b37f94b45bcf33d/contrail-collector/viz.sandesh#L12
https://github.com/Juniper/contrail-analytics/blob/3b23f1cde29893b7a147962def275284ebc36d54/contrail-collector/db_handler.cc#L513-L524 |
Cassandra instances in docker containers use a default configuration taken from upstream packaging (/etc/cassandra/cassandra-rackdc.properties) which means that they do not override
rack=
settings used during replication with NetworkTopologyStrategy.https://github.com/apache/cassandra/blob/cassandra-3.11.3/conf/cassandra-rackdc.properties#L17-L20 (upstream config)
Configuring this parameter is essential for handling rack failure scenarios.
Juju exposes availability zones configured for nodes in MAAS via JUJU_AVAILABILITY_ZONE environment variable available during hook execution which can be retrieved and used to render a proper config file for Cassandra:
https://docs.jujucharms.com/juju-environment-variables#heading--juju_availability_zone
Cassandra config in all containers:
Cassandra status sample:
The text was updated successfully, but these errors were encountered: