public interface CassandraDatacenter extends DynamicCluster, DatastoreMixins.HasDatastoreUrl, DatastoreMixins.CanExecuteScript
CassandraNode
s -- based on Brooklyn's DynamicCluster
(though it is a "Datacenter" in Cassandra terms, where Cassandra's "cluster" corresponds
to a Brooklyn Fabric, cf CassandraFabric
).
The Datacenter can be resized, manually or by policy if required.
Tokens are selected intelligently.
Note that due to how Cassandra assumes ports are the same across a cluster, it is NOT possible to deploy a cluster of size larger than 1 to localhost. (Some exploratory work has been done to use different 127.0.0.x IP's for localhost, and there is evidence this could be made to work.)
DynamicCluster.NodePlacementStrategy, DynamicCluster.ZoneFailureDetector
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
Startable.RestartEffectorBody, Startable.StartEffectorBody, Startable.StopEffectorBody
Modifier and Type | Field and Description |
---|---|
static AttributeSensor<java.util.List<java.lang.String>> |
CASSANDRA_CLUSTER_NODES |
static BasicAttributeSensorAndConfigKey<java.lang.String> |
CLUSTER_NAME |
static AttributeSensor<java.util.Set<Entity>> |
CURRENT_SEEDS |
static AttributeSensor<com.google.common.collect.Multimap<java.lang.String,Entity>> |
DATACENTER_USAGE |
static AttributeSensor<java.util.Set<java.lang.String>> |
DATACENTERS |
static int |
DEFAULT_SEED_QUORUM
Sets the number of nodes used to seed the cluster.
|
static Duration |
DELAY_AFTER_FIRST
Can insert a delay after the first node comes up.
|
static ConfigKey<Duration> |
DELAY_BEFORE_ADVERTISING_CLUSTER
Additional time after the nodes in the cluster are up when starting
before announcing the cluster as up.
|
static Duration |
DELAY_BETWEEN_STARTS
If set (ie non-null), this waits the indicated time after a successful launch of one node
before starting the next.
|
static ConfigKey<java.lang.String> |
ENDPOINT_SNITCH_NAME |
static Effector<java.lang.String> |
EXECUTE_SCRIPT |
static AttributeSensor<java.lang.Long> |
FIRST_NODE_STARTED_TIME_UTC |
static AttributeSensor<java.lang.Boolean> |
HAS_PUBLISHED_SEEDS |
static AttributeSensor<java.lang.String> |
HOSTNAME |
static ConfigKey<java.lang.Integer> |
NUM_TOKENS_PER_NODE
num_tokens will automatically be reset to 1 for each node if
USE_VNODES is false. |
static AttributeSensor<java.lang.Double> |
PROCESS_CPU_TIME_FRACTION_IN_WINDOW_PER_NODE |
static AttributeSensor<java.lang.Double> |
PROCESS_CPU_TIME_FRACTION_LAST_PER_NODE |
static AttributeSensor<java.util.List<Entity>> |
QUEUED_START_NODES |
static AttributeSensor<java.lang.Integer> |
READ_ACTIVE |
static AttributeSensor<java.lang.Long> |
READ_PENDING |
static AttributeSensor<java.lang.Double> |
READS_PER_SECOND_IN_WINDOW_PER_NODE |
static AttributeSensor<java.lang.Double> |
READS_PER_SECOND_LAST_PER_NODE |
static AttributeSensor<java.lang.Integer> |
SCHEMA_VERSION_COUNT |
static ConfigKey<com.google.common.base.Supplier<java.util.Set<Entity>>> |
SEED_SUPPLIER |
static AttributeSensor<java.lang.Integer> |
THRIFT_PORT |
static AttributeSensor<java.lang.Double> |
THRIFT_PORT_LATENCY_IN_WINDOW_PER_NODE |
static AttributeSensor<java.lang.Long> |
THRIFT_PORT_LATENCY_PER_NODE |
static ConfigKey<java.lang.Class<? extends TokenGenerator>> |
TOKEN_GENERATOR_CLASS |
static ConfigKey<java.math.BigInteger> |
TOKEN_SHIFT |
static MethodEffector<java.lang.Void> |
UPDATE |
static ConfigKey<java.lang.Boolean> |
USE_VNODES |
static boolean |
WAIT_FOR_FIRST
Whether to wait for the first node to start up
|
static AttributeSensor<java.lang.Integer> |
WRITE_ACTIVE |
static AttributeSensor<java.lang.Long> |
WRITE_PENDING |
static AttributeSensor<java.lang.Double> |
WRITES_PER_SECOND_IN_WINDOW_PER_NODE |
static AttributeSensor<java.lang.Double> |
WRITES_PER_SECOND_LAST_PER_NODE |
AVAILABILITY_ZONE_NAMES, CLUSTER, CLUSTER_MEMBER, CUSTOM_CHILD_FLAGS, ENABLE_AVAILABILITY_ZONES, ENTITY_QUARANTINED, FACTORY, FAILED_SUB_LOCATIONS, FIRST_MEMBER_SPEC, INITIAL_QUORUM_SIZE, MEMBER_SPEC, NUM_AVAILABILITY_ZONES, QUARANTINE_FAILED_ENTITIES, QUARANTINE_GROUP, REMOVAL_STRATEGY, RESIZE_BY_DELTA, SERVICE_STATE_ACTUAL, SUB_LOCATIONS, ZONE_FAILURE_DETECTOR, ZONE_PLACEMENT_STRATEGY
FIRST, FIRST_MEMBER, GROUP_MEMBERS, MEMBER_DELEGATE_CHILDREN, MEMBER_DELEGATE_NAME_FORMAT, RUNNING_QUORUM_CHECK, UP_QUORUM_CHECK
GROUP_SIZE, MEMBER_ADDED, MEMBER_REMOVED
INITIAL_SIZE
RESTART, SERVICE_UP, START, STOP
REPLACE_MEMBER
DATASTORE_URL
Modifier and Type | Method and Description |
---|---|
java.lang.String |
executeScript(java.lang.String commands) |
java.util.Set<Entity> |
gatherPotentialRunningSeeds() |
java.util.Set<Entity> |
gatherPotentialSeeds() |
java.lang.String |
getClusterName()
The name of the cluster.
|
void |
update() |
addNode, resizeByDelta, setFactory, setMemberSpec, setRemovalStrategy, setZoneFailureDetector, setZonePlacementStrategy
setMembers, setMembers
addChild, addChild, addMember, addMemberChild, addMemberChild, getCurrentSize, getMembers, hasMember, removeMember
addEnricher, addEnricher, addFeed, addGroup, addPolicy, addPolicy, addTag, clearParent, containsTag, getApplication, getApplicationId, getAttribute, getChildren, getConfig, getConfig, getConfigRaw, getConfigRaw, getCreationTime, getDisplayName, getEnrichers, getEntityType, getGroups, getIconUrl, getId, getLocations, getParent, getPolicies, getTags, invoke, removeChild, removeEnricher, removeGroup, removePolicy, removeTag, setParent
getCatalogItemId, getTagSupport, tags
config, setConfig
getCurrentSize, resize
replaceMember
static final BasicAttributeSensorAndConfigKey<java.lang.String> CLUSTER_NAME
static final ConfigKey<java.lang.String> ENDPOINT_SNITCH_NAME
static final ConfigKey<com.google.common.base.Supplier<java.util.Set<Entity>>> SEED_SUPPLIER
static final ConfigKey<java.lang.Class<? extends TokenGenerator>> TOKEN_GENERATOR_CLASS
static final ConfigKey<java.math.BigInteger> TOKEN_SHIFT
static final ConfigKey<java.lang.Boolean> USE_VNODES
static final ConfigKey<java.lang.Integer> NUM_TOKENS_PER_NODE
USE_VNODES
is false.static final ConfigKey<Duration> DELAY_BEFORE_ADVERTISING_CLUSTER
Useful to ensure nodes have synchronized.
On 1.2.2 this could be as much as 120s when using 2 seed nodes, or just a few seconds with 1 seed node. On 1.2.9 it seems a few seconds is sufficient even with 2 seed nodes
static final AttributeSensor<com.google.common.collect.Multimap<java.lang.String,Entity>> DATACENTER_USAGE
static final AttributeSensor<java.util.Set<java.lang.String>> DATACENTERS
static final AttributeSensor<java.lang.Boolean> HAS_PUBLISHED_SEEDS
static final AttributeSensor<java.util.Set<Entity>> CURRENT_SEEDS
static final AttributeSensor<java.lang.String> HOSTNAME
static final AttributeSensor<java.util.List<java.lang.String>> CASSANDRA_CLUSTER_NODES
static final AttributeSensor<java.lang.Integer> THRIFT_PORT
static final AttributeSensor<java.lang.Long> FIRST_NODE_STARTED_TIME_UTC
static final AttributeSensor<java.util.List<Entity>> QUEUED_START_NODES
static final AttributeSensor<java.lang.Integer> SCHEMA_VERSION_COUNT
static final AttributeSensor<java.lang.Long> READ_PENDING
static final AttributeSensor<java.lang.Integer> READ_ACTIVE
static final AttributeSensor<java.lang.Long> WRITE_PENDING
static final AttributeSensor<java.lang.Integer> WRITE_ACTIVE
static final AttributeSensor<java.lang.Long> THRIFT_PORT_LATENCY_PER_NODE
static final AttributeSensor<java.lang.Double> READS_PER_SECOND_LAST_PER_NODE
static final AttributeSensor<java.lang.Double> WRITES_PER_SECOND_LAST_PER_NODE
static final AttributeSensor<java.lang.Double> PROCESS_CPU_TIME_FRACTION_LAST_PER_NODE
static final AttributeSensor<java.lang.Double> READS_PER_SECOND_IN_WINDOW_PER_NODE
static final AttributeSensor<java.lang.Double> WRITES_PER_SECOND_IN_WINDOW_PER_NODE
static final AttributeSensor<java.lang.Double> THRIFT_PORT_LATENCY_IN_WINDOW_PER_NODE
static final AttributeSensor<java.lang.Double> PROCESS_CPU_TIME_FRACTION_IN_WINDOW_PER_NODE
static final MethodEffector<java.lang.Void> UPDATE
static final Effector<java.lang.String> EXECUTE_SCRIPT
static final int DEFAULT_SEED_QUORUM
Version 1.2.2 is buggy and requires a big delay for 2 nodes both seeds to reconcile, with 1.2.9 this seems fine, with just a few seconds' delay after starting.
static final Duration DELAY_AFTER_FIRST
Reportedly not needed with 1.2.9, but we are still seeing some seed failures so re-introducing it. (This does not seem to help with the bug in 1.2.2.)
static final Duration DELAY_BETWEEN_STARTS
When subsequent nodes start simultaneously, we occasionally see schema disagreement problems; if nodes start sequentially, we occasionally get "no sources for (tokenRange]" problems. Either way the node stops. Ideally this can be solved at the Cassandra level, but if not, we will have to introduce some restarts at the Cassandra nodes (which does seem to resolve the problems.)
static final boolean WAIT_FOR_FIRST
not sure whether this is needed or not. Need to test in env where not all nodes are seed nodes, what happens if non-seed nodes start before the seed nodes?
void update()
java.lang.String getClusterName()
java.util.Set<Entity> gatherPotentialSeeds()
java.util.Set<Entity> gatherPotentialRunningSeeds()
java.lang.String executeScript(java.lang.String commands)