Managing Cluster Configurations¶
The following HTTP methods allow you to view and edit the cassandra.yaml configuration and set the DSE node type for some or all of the nodes in a cluster.
Cluster Configuration Management Methods | URL |
---|---|
Read the cassandra.yaml contents for a single node. | GET /{cluster_id}/nodeconf/{node_ip}/ |
Set the cassandra.yaml contents for a single node. | POST /{cluster_id}/nodeconf/{node_ip}/ |
Read the cassandra.yaml contents for one or all DCs. | GET /{cluster_id}/clusterconf/{dc}/ |
Set the cassandra.yaml contents for one or all DCs. | POST /{cluster_id}/clusterconf/{dc}/ |
Get the DSE role for a node. | GET /{cluster_id}/dseconf/{node_ip}/nodetype |
Set the DSE role for a node. | POST /{cluster_id}/dseconf/{node_ip}/nodetype |
cassandra.yaml Configuration¶
- GET /{cluster_id}/nodeconf/{node_ip}/¶
Get the contents of the cassandra.yaml configuration file for a single node in the cluster.
Path arguments: - cluster_id – A Cluster Config ID.
- node_ip – IP address of the target Node.
Format: If the Accept header is text/yaml or is not specified, the configuration will be returned as YAML. If the Accept type is text/json, the configuration will be returned as JSON.
Example:
curl http://127.0.0.1:8888/Test_Cluster/nodeconf/192.168.1.1
Output:
index_interval: 128 rpc_timeout_in_ms: 10000 compaction_throughput_mb_per_sec: 16 authority: org.apache.cassandra.auth.AllowAllAuthority compaction_preheat_key_cache: true row_cache_size_in_mb: 0 thrift_max_message_length_in_mb: 16 flush_largest_memtables_at: 0.75 in_memory_compaction_limit_in_mb: 64 rpc_server_type: sync multithreaded_compaction: false trickle_fsync: false hinted_handoff_throttle_delay_in_ms: 1 row_cache_save_period: 0 hinted_handoff_enabled: true cluster_name: Test Cluster ssl_storage_port: 7001 populate_io_cache_on_flush: false seed_provider: - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: - {seeds: 192.168.1.1, 192.168.1.2} dynamic_snitch_reset_interval_in_ms: 600000 storage_port: 7000 request_scheduler: org.apache.cassandra.scheduler.NoScheduler rpc_port: 9160 row_cache_provider: SerializingCacheProvider reduce_cache_capacity_to: 0.6 saved_caches_directory: /var/lib/cassandra/saved_caches max_hint_window_in_ms: 3600000 commitlog_sync: periodic thrift_framed_transport_size_in_mb: 15 key_cache_save_period: 14400 authenticator: org.apache.cassandra.auth.AllowAllAuthenticator dynamic_snitch_badness_threshold: 0.1 commitlog_directory: /var/lib/cassandra/commitlog column_index_size_in_kb: 64 trickle_fsync_interval_in_kb: 10240 snapshot_before_compaction: false concurrent_reads: 32 endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch encryption_options: keystore: conf/.keystore protocol: TLS algorithm: SunX509 cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA] truststore_password: cassandra truststore: conf/.truststore internode_encryption: none keystore_password: cassandra store_type: JKS concurrent_writes: 32 data_file_directories: [/var/lib/cassandra/data] auto_snapshot: true partitioner: org.apache.cassandra.dht.RandomPartitioner dynamic_snitch_update_interval_in_ms: 100 commitlog_segment_size_in_mb: 32 rpc_keepalive: true reduce_cache_sizes_at: 0.85 incremental_backups: false commitlog_sync_period_in_ms: 10000 memtable_flush_queue_size: 4 rpc_address: 0.0.0.0 listen_address: 192.168.1.1 initial_token: null
JSON Format Example
curl -H 'Accept: text/json' http://127.0.0.1:8888/Test_Cluster/nodeconf/192.168.1.1
Output:
- Cassandra Config¶
This Cassandra Config object is just a JSON representation of a cassandra.yaml file. The actual attributes and values will vary depending on what version of Cassandra or DSE is being used.
{ "authenticator": "org.apache.cassandra.auth.AllowAllAuthenticator", "authority": "org.apache.cassandra.auth.AllowAllAuthority", "auto_snapshot": true, "cluster_name": "Test Cluster", "column_index_size_in_kb": 64, "commitlog_directory": "/var/lib/cassandra/commitlog", "commitlog_segment_size_in_mb": 32, "commitlog_sync": "periodic", "commitlog_sync_period_in_ms": 10000, "compaction_preheat_key_cache": true, "compaction_throughput_mb_per_sec": 16, "concurrent_reads": 32, "concurrent_writes": 32, "data_file_directories": [ "/var/lib/cassandra/data" ], "dynamic_snitch_badness_threshold": 0.1, "dynamic_snitch_reset_interval_in_ms": 600000, "dynamic_snitch_update_interval_in_ms": 100, "encryption_options": { "algorithm": "SunX509", "cipher_suites": [ "TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA" ], "internode_encryption": "none", "keystore": "conf/.keystore", "keystore_password": "cassandra", "protocol": "TLS", "store_type": "JKS", "truststore": "conf/.truststore", "truststore_password": "cassandra" }, "endpoint_snitch": "org.apache.cassandra.locator.SimpleSnitch", "flush_largest_memtables_at": 0.75, "hinted_handoff_enabled": true, "hinted_handoff_throttle_delay_in_ms": 1, "in_memory_compaction_limit_in_mb": 64, "incremental_backups": false, "index_interval": 128, "initial_token": null, "key_cache_save_period": 14400, "listen_address": "192.168.1.1", "max_hint_window_in_ms": 3600000, "memtable_flush_queue_size": 4, "multithreaded_compaction": false, "partitioner": "org.apache.cassandra.dht.RandomPartitioner", "populate_io_cache_on_flush": false, "reduce_cache_capacity_to": 0.6, "reduce_cache_sizes_at": 0.85, "request_scheduler": "org.apache.cassandra.scheduler.NoScheduler", "row_cache_provider": "SerializingCacheProvider", "row_cache_save_period": 0, "row_cache_size_in_mb": 0, "rpc_address": "0.0.0.0", "rpc_keepalive": true, "rpc_port": 9160, "rpc_server_type": "sync", "rpc_timeout_in_ms": 10000, "saved_caches_directory": "/var/lib/cassandra/saved_caches", "seed_provider": [ { "class_name": "org.apache.cassandra.locator.SimpleSeedProvider", "parameters": [ { "seeds": "192.168.1.1, 192.168.1.2" } ] } ], "snapshot_before_compaction": false, "ssl_storage_port": 7001, "storage_port": 7000, "thrift_framed_transport_size_in_mb": 15, "thrift_max_message_length_in_mb": 16, "trickle_fsync": false, "trickle_fsync_interval_in_kb": 10240 }
- POST /{cluster_id}/nodeconf/{node_ip}/¶
Set the contents of the cassandra.yaml configuration file for a single node in the cluster.
Path arguments: - cluster_id – A Cluster Config ID.
- node_ip – IP address of the target Node.
Body: A YAML or JSON representation of the cassandra.yaml configuration for the node. If a JSON format is used, the Accept header should be set to text/json.
Example:
curl -X POST http://127.0.0.1:8888/Test_Cluster/nodeconf/192.168.1.1 -d 'index_interval: 128 rpc_timeout_in_ms: 10000 compaction_throughput_mb_per_sec: 16 authority: org.apache.cassandra.auth.AllowAllAuthority compaction_preheat_key_cache: true row_cache_size_in_mb: 0 thrift_max_message_length_in_mb: 16 flush_largest_memtables_at: 0.75 in_memory_compaction_limit_in_mb: 64 rpc_server_type: sync multithreaded_compaction: false trickle_fsync: false hinted_handoff_throttle_delay_in_ms: 1 row_cache_save_period: 0 hinted_handoff_enabled: true cluster_name: Test Cluster ssl_storage_port: 7001 populate_io_cache_on_flush: false seed_provider: - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: - {seeds: 192.168.1.1, 192.168.1.2} dynamic_snitch_reset_interval_in_ms: 600000 storage_port: 7000 request_scheduler: org.apache.cassandra.scheduler.NoScheduler rpc_port: 9160 row_cache_provider: SerializingCacheProvider reduce_cache_capacity_to: 0.6 saved_caches_directory: /var/lib/cassandra/saved_caches max_hint_window_in_ms: 3600000 commitlog_sync: periodic thrift_framed_transport_size_in_mb: 15 key_cache_save_period: 14400 authenticator: org.apache.cassandra.auth.AllowAllAuthenticator dynamic_snitch_badness_threshold: 0.1 commitlog_directory: /var/lib/cassandra/commitlog column_index_size_in_kb: 64 trickle_fsync_interval_in_kb: 10240 snapshot_before_compaction: false concurrent_reads: 32 endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch encryption_options: keystore: conf/.keystore protocol: TLS algorithm: SunX509 cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA] truststore_password: cassandra truststore: conf/.truststore internode_encryption: none keystore_password: cassandra store_type: JKS concurrent_writes: 32 data_file_directories: [/var/lib/cassandra/data] auto_snapshot: true partitioner: org.apache.cassandra.dht.RandomPartitioner dynamic_snitch_update_interval_in_ms: 100 commitlog_segment_size_in_mb: 32 rpc_keepalive: true reduce_cache_sizes_at: 0.85 incremental_backups: false commitlog_sync_period_in_ms: 10000 memtable_flush_queue_size: 4 rpc_address: 0.0.0.0 listen_address: 192.168.1.1 initial_token: null'
- GET /{cluster_id}/nodeconf/{dc}/¶
Similar to
GET /{cluster_id}/nodeconf/{node_ip}/
, but collects the configuration for all nodes in one or all datacenters. Properties that are specific to a single node, such as listen_address, rpc_address, and broadcast_address will not be included in the returned config.An error message is returned if properties that are not specific to a single node differ from one node to another in a cluster.
Path arguments: - cluster_id – A Cluster Config ID.
- dc – The name of a datacenter to collect configs for. Use the special
value
all
to collect configs from all datacenters.
Query params: allow_down_nodes – “0” to require all specified nodes to be up. “1” to return the conf from only the nodes that are available. Defaults to “1”
Format: If the Accept header is text/yaml or is not specified, the configuration will be returned as YAML. If the Accept type is text/json, the configuration will be returned as JSON.
- POST /{cluster_id}/clusterconf/{dc}/¶
Similar to
POST /{cluster_id}/nodeconf/{node_ip}/
, but sets the configuration for all nodes in one or all datacenters. Properties that are specific to a single node, such as listen_address, rpc_address, and broadcast_address, will be ignored.Path arguments: - cluster_id – A Cluster Config ID.
- dc – The name of a datacenter to configure. Use the special
value
all
to set configs in all datacenters.
Body: A YAML or JSON representation of the cassandra.yaml configuration for the nodes. If a JSON format is used, the Accept header should be set to text/json.
DSE Node Types¶
- GET /{cluster_id}/dseconf/{node_ip}/nodetype¶
Gets the DSE role for a particular node, which indicates if the node is running Hadoop services, Solr services, or neither. Note that this method is currently only supported when DSE has been installed with debian or RPM packages.
Path arguments: - cluster_id – A Cluster Config ID.
- node_ip – IP address of the target Node.
Returns a JSON string containing either “cassandra”, “hadoop”, or “solr”.
Example
curl localhost:8888/Test_Cluster/dseconf/192.168.1.1/nodetype
Output:
"hadoop"
- POST /{cluster_id}/dseconf/{node_ip}/nodetype¶
Sets the DSE role for a particular node, which controls whether the node runs Hadoop services, Solr services, or neither. Note that this method is currently only supported when DSE has been installed with debian or RPM packages.
Changes to the node’s DSE role will only take effect after the node has been restarted, which this method does not do.
Path arguments: - cluster_id – A Cluster Config ID.
- node_ip – IP address of the target Node.
Body: A JSON string containing either cassandra, hadoop, or solr.
Example
curl -X POST localhost:8888/Test_Cluster/dseconf/192.168.1.1/nodetype -d '"hadoop"'