|
| 1 | +--- |
| 2 | +title: "Deploy Apache Cassandra Cluster through the Linode Marketplace" |
| 3 | +description: "Apache Cassandra is an open-source, distributed NoSQL database management system designed for handling large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters with asynchronous masterless replication allowing low-latency operations for all clients. " |
| 4 | +published: 2024-08-05 |
| 5 | +keywords: ['nosql','database', 'marketplace', 'cassandra'] |
| 6 | +tags: ["ubuntu","marketplace", "database", "linode platform", "cloud manager", "ssl", "cloud storage", "high availability", "compute storage"] |
| 7 | +external_resources: |
| 8 | +- '[About Apache Cassandra](https://cassandra.apache.org/)' |
| 9 | +- '[Apache Cassandra Documentation](https://cassandra.apache.org/doc/latest/cassandra/architecture/overview.html)' |
| 10 | +--- |
| 11 | + |
| 12 | +## Cluster Deployment Architecture |
| 13 | + |
| 14 | +Create a highly available Apache Cassandra cluster through the Linode Marketplace. Apache Cassandra is an open-source, distributed NoSQL database management system designed for handling large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters with asynchronous masterless replication, allowing low-latency operations for all clients. |
| 15 | + |
| 16 | +## Deploying a Marketplace App |
| 17 | + |
| 18 | +{{% content "deploy-marketplace-apps-shortguide" %}} |
| 19 | + |
| 20 | +{{% content "marketplace-verify-standard-shortguide" %}} |
| 21 | + |
| 22 | +{{< note >}} |
| 23 | +**Estimated deployment time:** Your Apache Cassandra cluster should be fully installed within 10-15 minutes after the Compute Instance has finished provisioning. |
| 24 | +{{< /note >}} |
| 25 | + |
| 26 | +## Configuration Options |
| 27 | + |
| 28 | +- **Supported distributions:** Ubuntu 22.04 LTS |
| 29 | +- **Suggested minimum plan:** All plan types and sizes can be used. For best results, a minimum of 8GB Dedicated CPU or Shared Compute Instance is recommended. |
| 30 | + |
| 31 | +### Apache Cassandra Options |
| 32 | + |
| 33 | +- **[Linode API Token](/docs/products/tools/api/guides/manage-api-tokens/#create-an-api-token):** The provisioner node uses an authenticated API token to create the additional components to the cluster. This is required to fully create the Apache Cassandra cluster. |
| 34 | + |
| 35 | +{{% content "marketplace-required-limited-user-fields-shortguide" %}} |
| 36 | + |
| 37 | +{{% content "marketplace-special-character-limitations-shortguide" %}} |
| 38 | + |
| 39 | +- **Cassandra Database User:** Enter your database super username for the Cassandra cluster. |
| 40 | + |
| 41 | +- **Number of clients connecting to Cassandra:** The number of clients that will be connecting to the cluster. The application will create SSL certificates for your clients that need to connect to the cluster. The number of clients should be an integer equal or greater than 1. |
| 42 | + |
| 43 | +- **Cassandra cluster size:** The size of the Cassandra cluster |
| 44 | + |
| 45 | +- **Country or Region:** Enter the country or region for you or your organization. |
| 46 | + |
| 47 | +- **State or Province:** Enter the state or province for you or your organization. |
| 48 | + |
| 49 | +- **Locality:** Enter the town or other locality for you or your organization. |
| 50 | + |
| 51 | +- **Organization:** Enter the name of your organization. |
| 52 | + |
| 53 | +- **Email Address:** Enter the email address you wish to use for your certificate file. |
| 54 | + |
| 55 | +## Getting Started After Deployment |
| 56 | + |
| 57 | +This Marketplace App creates a 3-5 node cluster using Apache Cassandra. Authentication to the cluster is secured via a user-supplied username. The default `cassandra` database role is removed and superseded by the new user role provided by the client. In addition, cluster communication is secured via SSL/TLS with self-signed keystores. |
| 58 | + |
| 59 | +Both certificates and keystores can be found on every node in the `/etc/cassandra/ssl` directory. Only the first Cassandra server will have client certificates. This playbook also creates *_n_* amount of client certificates so that applications can connect to the Cassandra cluster. |
| 60 | + |
| 61 | +### Connecting to Cassandra |
| 62 | + |
| 63 | +Connect to Cassandra using `cqlsh` using client or server certificates. You will need 4 components to connect to the cluster: |
| 64 | + |
| 65 | +- Username and password created by the playbook. You can find the credentials in `/home/$SUDO_USER/.credentials`, where `$SUDO_USER` is your sudo user created during deployment. |
| 66 | +- Client certificate |
| 67 | +- Client key |
| 68 | +- CA certificate |
| 69 | + |
| 70 | +1. On the client node, create the `/home/$SUDO_USER/cassandra_ssl` directory, where `$SUDO_USER` is your sudo user created during deployment. |
| 71 | + |
| 72 | +2. From the first Cassandra node, securely transfer the following files and directories: `/etc/cassandra/ssl/cert/client1.crt`, `/etc/cassandra/ssl/key/client1.key`, and `/etc/cassandra/ssl/ca/ca.crt` to the `/home/$SUDO_USER/cassandra_ssl` directory on the client node. |
| 73 | + |
| 74 | +3. Create a Cassandra resource file to use our client certificate. Create the `/home/$SUDO_USER/.cassandra` directory. In the `.cassandra` directory, create a `cqlshrc` file with the following content: |
| 75 | + |
| 76 | + ``` |
| 77 | + [connection] |
| 78 | + ssl = true |
| 79 | + factory = cqlshlib.ssl.ssl_transport_factory |
| 80 | + [ssl] |
| 81 | + certfile = /home/$SUDO_USER/cassandra_ssl/ca.crt |
| 82 | + userkey = /home/$SUDO_USER/cassandra_ssl/client1.key |
| 83 | + usercert = /home/$SUDO_USER/cassandra_ssl/client1.crt |
| 84 | + validate = true |
| 85 | + ``` |
| 86 | +
|
| 87 | +4. Connect to one of the Cassandra servers using `cqlsh`: |
| 88 | +
|
| 89 | + ```command |
| 90 | + cqlsh 192.168.139.160 -u superuser --ssl |
| 91 | + ``` |
| 92 | +
|
| 93 | +Replace `192.168.139.160` with the private IP address of one of the Cassandra nodes and `superuser` with the Cassandra database user you provided when deploying the cluster. Once you are connected, enter the password from `/home/$SUDO_USER/.credentials` at the prompt to authenticate to the cluster. |
| 94 | +
|
| 95 | +```output |
| 96 | +Connected to Cassandra Cluster at 192.168.139.160:9042 |
| 97 | +[cqlsh 6.1.0 | Cassandra 4.1.5 | CQL spec 3.4.6 | Native protocol v5] |
| 98 | +Use HELP for help. |
| 99 | +superadmin@cqlsh> |
| 100 | +``` |
| 101 | + |
| 102 | +You can distribute the remainder of client certificates to the rest of the nodes. |
| 103 | + |
| 104 | +## Software Included |
| 105 | + |
| 106 | +The Apache Cassandra Marketplace App installs the following software on your Linode: |
| 107 | + |
| 108 | +| **Software** | **Description** | |
| 109 | +|:--------------|:------------| |
| 110 | +| [**Apache Cassandra**](https://cassandra.apache.org/) | Open Source NoSQL Database. | |
| 111 | +| [**UFW**](https://help.ubuntu.com/community/UFW) | Uncomplicated Firewall | |
| 112 | + |
| 113 | +{{% content "marketplace-update-note-shortguide" %}} |
0 commit comments