Init elastic_admin keyspace with RF=1
@@ -1110,22 +1110,12 @@ public class ClusterService extends BaseClusterService {
return clusterName;
}
- public int getLocalDataCenterSize() {
- int count = 1;
- for (UntypedResultSet.Row row : executeInternal("SELECT data_center, rpc_address FROM system." + SystemKeyspace.PEERS))
- if (row.has("rpc_address") && row.has("data_center") && DatabaseDescriptor.getLocalDataCenter().equals(row.getString("data_center")))
- count++;
- logger.info(" datacenter=[{}] size={} from peers", DatabaseDescriptor.getLocalDataCenter(), count);
- return count;
- }
-
-
Void createElasticAdminKeyspace() {
try {
Map<String, String> replication = new HashMap<String, String>();
replication.put("class", NetworkTopologyStrategy.class.getName());
- replication.put(DatabaseDescriptor.getLocalDataCenter(), Integer.toString(getLocalDataCenterSize()));
+ replication.put(DatabaseDescriptor.getLocalDataCenter(), "1");
String createKeyspace = String.format(Locale.ROOT, "CREATE KEYSPACE IF NOT EXISTS \"%s\" WITH replication = %s;",
elasticAdminKeyspaceName, FBUtilities.json(replication).replaceAll("\"", "'"));
