Best practices for database clusters
DataStax recommends that you create your clusters using Mission Control, which provides both simple and advanced configuration options.
Follow these best practices to create and deploy an HCD cluster that is secure, efficient, and scalable.
The guidance covers both simple and advanced configurations with expert mode, focusing on key areas such as node configuration, resource management, and Kubernetes deployment. These guidelines will help you optimize your cluster for performance and security.
Create a database cluster using simple mode
When creating a database cluster, you can use the default settings provided by Mission Control to quickly deploy a cluster.
You can use these settings for most use cases, and they provide a good starting point for your deployment.
Cluster information settings
When creating a database cluster, you must provide the following information:
-
Cluster Name: A unique name for the cluster.
-
Type: The type of database cluster you want to create.
-
Version: The server version to use.
It’s always best practice to use the latest patch release version for improved security and stability. Using the latest patch release ensures that you receive the latest features, security updates, and bug fixes.
-
Image: Optional override for the default server image. DataStax recommends using the default settings for the image unless you have specific requirements.
Topology settings
These are the essential topology settings to configure when setting up your cluster:
-
Datacenter Name: The name of the datacenter where the cluster will be deployed. Use a descriptive name that reflects the location or purpose of the datacenter.
-
Stop this DC: Whether to stop the datacenter after the cluster is created.
You can override configuration settings in your cassandra.yaml
and dse.yaml
files to customize the configuration of your database cluster.
If you override YAML configuration settings, be sure to understand the implications of each change.
DataStax recommends that you use expert mode for your advanced configuration settings.
You can use the expert editor to modify YAML configuration files directly with fine-grained control over the settings.
Rack configuration
When you define your racks, you can pin specific racks to particular cloud providers or regions. Use the node affinity labels and values to ensure that your nodes are deployed in the desired locations. You can define multiple node affinity labels to provide more granular control over workload placement for database nodes. Most deployments will include both a zone identifier and a role identifier for each node, for example:
-
Zone identifier:
topology.kubernetes.io/zone: us-west1-a
-
Role identifier:
mission-control.datastax.com/role: database
Resource requests and limits settings
When you create a database cluster, you must specify the resource requests for your nodes. DataStax recommends that you set the resource requests to a value lower than the actual capacity of the node to guarantee availability.
Configuring nodes effectively is critical for the success of your deployment. Improperly configured nodes can cause inefficiencies or resource contention.
Here are some key considerations to keep in mind when configuring nodes:
-
Resource requests vs. limits: Requests are used for scheduling resources, while limits are enforced at runtime. Ensure that resource requests are set to a value lower than the actual capacity of the node to guarantee availability. You can adjust limits in in the expert editor, if necessary. You cannot adjust limits in the simple editor. Some environments might require you to set resource limits for your nodes.
-
RAM availability: Understand the available RAM on your nodes to avoid overloading them, which can negatively affect cluster performance.
-
Security: Set strong passwords to secure your nodes. Managing passwords effectively is crucial to protecting your cluster.
Security settings
When creating a database cluster, DataStax recommends that you configure security settings to protect your data and prevent unauthorized access.
Ensure that you set a Superuser Password for your database cluster. If you don’t set a Superuser Password, DataStax generates a random password for you, and you must run a kubectl command to retrieve it. |
Advanced configuration with expert mode
After you create or update a cluster in expert mode, you cannot edit it in simple mode. |
Expert mode is for users who need to handle high-availability settings, custom networking policies, or resource management at a granular level.
When you use expert mode to configure your database cluster, you can set configuration options at different levels to customize the cluster to your requirements.
DataStax recommends that you make a copy of your configuration settings and store them in a version control system. |
Resource requests and limits
When you use expert mode to configure your database cluster, you can set resource limits for your nodes. You can set limits to define the maximum amount of resources a container can consume, while requests help schedule resources. Ensure that you set resource requests to a value lower than the actual capacity of the node to guarantee availability.
YAML configuration best practices
DataStax recommends that you use expert mode for your advanced configuration settings. You can use the expert editor to modify YAML configuration files directly with fine-grained control over the settings. When you modify the YAML configuration files, be sure to understand the implications of each change.
Here are some best practices for modifying YAML configuration files:
-
Use comments: Add comments to explain the purpose of each setting.
-
Use descriptive names: Use descriptive names for settings to make it easier to understand their purpose.
-
Use consistent formatting: Use consistent formatting to make the configuration file easier to read and maintain.
-
Use version control: Store your configuration files in a version control system to track changes and manage configurations effectively.
Configuration levels
Depending on your deployment scale, you might need to configure settings at different levels to ensure consistency and control across your cluster
When you create a database cluster, you can configure settings at different levels to customize the cluster to your requirements. You can set configuration options at the datacenter and global levels to control the behavior of your database cluster.
In simple mode, when you set configuration options at the datacenter level under Topology, they apply to all nodes in the datacenter. When you set configuration options at the global level under Advanced Settings, they apply to all nodes in the cluster.
With expert mode, you can set configuration options at the datacenter and global levels in the YAML file to control the behavior of your database cluster.
DataStax recommends that you use expert mode to configure advanced settings at the datacenter and global levels.