<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dhanyashreekaranth on Medium]]></title>
        <description><![CDATA[Stories by Dhanyashreekaranth on Medium]]></description>
        <link>https://medium.com/@dhanyashreekaranth?source=rss-75766fc62196------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dKPrIBcC7R1k958O</url>
            <title>Stories by Dhanyashreekaranth on Medium</title>
            <link>https://medium.com/@dhanyashreekaranth?source=rss-75766fc62196------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 07:42:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dhanyashreekaranth/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fix SSL Issues in GKE by Resolving Certificate Chains]]></title>
            <link>https://medium.com/niveus-solutions/resolving-ssl-certificate-issues-due-to-missing-chain-certificates-549d2719081b?source=rss-75766fc62196------2</link>
            <guid isPermaLink="false">https://medium.com/p/549d2719081b</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Dhanyashreekaranth]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 05:54:15 GMT</pubDate>
            <atom:updated>2025-01-20T06:38:41.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VxyYGJfXo3DcA3O8tFvseg.png" /></figure><p>When setting SSL certificates in Google Kubernetes Engine (GKE) with Ingress or attaching it to load balancer, one typical problem that developers have is the inability to establish a secure HTTPS connection owing to missing or incorrectly configured certificate chains. This blog will explain what a certificate chain is, why it is necessary, and how to resolve certificate issues with missing chain certificates in GKE Ingress.</p><p><strong>What is a Certificate Chain?</strong></p><p>A certificate chain, also referred to as a certificate path, is a series of certificates that begins with the server’s SSL certificate and ends with a trusted root certificate that is trusted by clients. This chain ensures the validity of the SSL certificate by validating it against a trusted Certificate Authority (CA).</p><p>Here’s how the chain works:</p><ul><li>Server Certificate: This is the SSL certificate associated with your website or service.</li><li>Intermediate Certificates: These certificates link the server certificate to the root certificate, establishing a trust relationship.</li><li>Root Certificate: The root certificate is the highest-level certificate, issued by a trusted CA, and is commonly pre-installed in browsers and operating systems.</li></ul><p>The certificate chain in SSL/TLS is also called a chain of trust. This means when a browser receives the SSL certificate for your website, it needs to check if it’s valid. To do this, it starts with the server certificate and traces it back to the root certificate to establish trust. The browser uses the certificate’s public key to match the signature and then checks the intermediate certificate’s public key and signature in the same way. This process continues until the browser reaches the root certificate stored in its trust list. If any certificate in the chain cannot be verified, the chain breaks, and the browser will warn the user with messages like “not secure” or “Your connection is not private.” If the intermediate certificates are missing, browsers and clients might fail to verify the authenticity of the server certificate, leading to SSL errors or issues with the SSL handshake. When the certificate chain is valid, the browser establishes a secure connection with the server.</p><h3>The Issue: Missing Chain Certificate</h3><p>When configuring SSL for an Ingress resource in GKE (Google Kubernetes Engine), the certificate and key are often given in a Kubernetes Secret. However, if the certificate chain is incomplete (for example, missing intermediate certificates), the Ingress controller will be unable to display the entire chain to clients, resulting in SSL failures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/0*gfFyHpPE2IP_CyXf" /></figure><p>This problem typically occurs when:</p><ol><li>You receive an SSL certificate from a CA but only get the server certificate (not the full chain).</li><li>The certificate is not properly concatenated with the intermediate certificates before being uploaded to Kubernetes.</li></ol><p>Without the intermediate certificates, clients will not trust your server certificate, resulting in SSL validation errors.</p><h3>Identifying the Problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/0*iB7nZ8pg1ZaNAX2F" /></figure><p>If you are encountering SSL issues in your GKE Ingress setup or loadbalancer, you can check the server certificate chain using tools like using the openssl command:</p><p><strong>openssl s_client -connect &lt;yourdomain.com&gt;:443 -showcerts</strong></p><p>This will show you the entire certificate chain returned by the server. If the intermediate certificates are missing, it will be evident in the output, and you’ll need to fix it.</p><h3>Solution: Fixing the Missing Chain Certificates</h3><p>Here’s how to resolve the issue of missing chain certificates:</p><p>1. Obtain the Full Certificate Chain</p><p>First, ensure that you have the complete certificate chain. This should include:</p><ul><li>Your server certificate (provided by your CA)</li><li>The intermediate certificates (provided by your CA)</li><li>The root certificate (usually already trusted by browsers and operating systems)</li></ul><p>You can get the full chain from your CA, or in some cases, the CA will provide a “bundle” certificate that includes all intermediate certificates.</p><h4>2. Concatenate the Certificates</h4><p>You need to concatenate your server certificate with the intermediate certificates (in the correct order) into a single file. The order of concatenation is crucial:</p><ul><li><strong>Server Certificate</strong></li><li><strong>Intermediate Certificates</strong></li><li><strong>Root Certificate (optional)</strong></li></ul><p>You can concatenate the certificates using the following command:</p><p><strong>cat server.crt intermediate.crt &gt; fullchain.crt</strong></p><p>This will create a fullchain.crt file that includes the server certificate and the intermediate certificates.</p><p><strong>For loadbalancer :</strong></p><p>Update the cert with the full chain certificate and attach to the load balancer.</p><p><strong>For kubernetes:</strong></p><h4>3. Update the Kubernetes Secret</h4><p>Once you have the concatenated certificate, update the Kubernetes Secret that holds your SSL certificate and key. You can create or update the secret with the following kubectl command:</p><pre>kubectl create secret tls my-tls-secret - cert=fullchain.crt \<br>- key=server.key</pre><p>This command creates or updates the my-tls-secret with the new certificate and key.</p><h4>4. Update the Ingress Resource</h4><p>Ensure that your Ingress resource is using the updated secret. Here’s an example of how to configure the Ingress resource:</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>name: &lt;ingress-name&gt;<br>annotations:<br>kubernetes.io/ingress.class: &quot;gce&quot; # GKE Ingress controller<br>spec:<br>tls:<br>- hosts:<br>- yourdomain.com<br>secretName: my-tls-secret<br>rules:<br>- host: &lt;yourdomain.com&gt;<br>http:<br>paths:<br>- path: /<br>pathType: Prefix<br>backend:<br>service:<br>name: my-service<br>port:<br>number: 80</pre><p>Ensure that the secretName matches the updated secret name.</p><h4>5. Verify the Configuration</h4><p>Once you’ve updated the secret and the Ingress resource, verify that the certificate chain is correctly installed.</p><pre>echo | openssl s_client -showcerts -servername DOMAIN -connect IP_ADDRESS:443 -verify 99 -verify_return_error</pre><p>This command outputs the certificates that the load balancer presents to the client. Along with other detailed information, the output should include the certificate chain and Verify return code: 200 (ok)</p><h3><strong>Conclusion</strong></h3><p>Missing chain certificates in your GKE Ingress configuration can lead to SSL validation problems, blocking secure connections to your services. To resolve this, ensure you provide the complete certificate chain (including the server certificate and intermediate certificates) and update the Kubernetes Secret and Ingress resources correctly.</p><p>If issues persist, verify that your certificate is properly formatted and includes all necessary intermediate certificates. With the right setup, your GKE Ingress will handle SSL traffic securely and reliably, ensuring a smooth user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=549d2719081b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/resolving-ssl-certificate-issues-due-to-missing-chain-certificates-549d2719081b">Fix SSL Issues in GKE by Resolving Certificate Chains</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Cassandra Dump and Restore]]></title>
            <link>https://medium.com/niveus-solutions/cassandra-dump-and-restore-0c96f2515f3a?source=rss-75766fc62196------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c96f2515f3a</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[cassandra-setup]]></category>
            <category><![CDATA[infra-modernization]]></category>
            <category><![CDATA[cassandra-restore]]></category>
            <dc:creator><![CDATA[Dhanyashreekaranth]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 13:27:57 GMT</pubDate>
            <atom:updated>2025-01-06T11:00:53.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cassandra Dump and Restore</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yeuCzLIIuqQ7PqMPC-HQvA.png" /></figure><p><strong>Topics Covered:-</strong></p><ol><li>About Cassandra</li><li>Cassandra Architecture</li><li>Cassandra setup</li><li>Snapshot and restore</li><li>Incremental backup and restore</li></ol><p><strong>About Cassandra</strong></p><p>Apache Cassandra is an open source NoSQL distributed database . Cassandra is a highly scalable, distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.</p><p><strong>Key features and characteristics of Cassandra:</strong></p><ul><li><strong>Distributed Architecture: </strong>Cassandra is designed to run on a cluster of multiple nodes, where each node is responsible for storing a portion of the data. This distributed architecture provides fault tolerance and scalability.</li><li><strong>No Single Point of Failure: </strong>Data in Cassandra is replicated across multiple nodes in the cluster, ensuring that there is no single point of failure. If a node goes down, data remains accessible from other nodes in the cluster.</li><li><strong>Built-in Replication: </strong>Cassandra automatically replicates data across multiple nodes in the cluster, allowing it to provide fault tolerance and data redundancy. Replication strategies can be configured based on factors like consistency requirements and data center topology.</li></ul><h3>Architecture of Cassandra:</h3><p>The primary architecture of Cassandra is made up of a cluster of nodes. Every node in Cassandra is equal and carries the same level of importance, which is fundamental to the structure of Cassandra. Each node is the exact point where specific data is stored. A group of nodes that are related to each other makes up a data center. The complete set of data centers capable of storing data for processing is what makes up a cluster.</p><p>The directory structure of Cassandra data consists of different directories for keyspaces, and tables with the data files within the table directories. Directories backups and snapshots to store backups and snapshots respectively for a particular table are also stored within the table directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/0*w_VA8qoPWeYaUag3" /><figcaption>Data directory of Cassandra</figcaption></figure><p><strong>Keywords:</strong></p><p><strong>Cluster: </strong>A cluster in Cassandra refers to a group of nodes that collectively store and manage data for a logical database.</p><p><strong>Data center:</strong>In Cassandra, a datacenter is a logical grouping of nodes within a cluster that are geographically located in the physical location or region.</p><p><strong>Replication factor:</strong>determines how many copies of each piece of data are stored across the cluster.if you have a replication factor of 3, each piece of data will be stored on three different nodes in the cluster.</p><p><strong>Seed nodes:</strong> These are initial contact points for clients connecting to the cluster. Seed nodes are used during the bootstrapping process to discover the rest of the cluster.</p><p><strong>Keyspaces:</strong> keyspace is a namespace that defines data replication on nodes. It’s similar to a database in traditional relational databases. Keyspaces contain tables, which contain rows and columns of data.</p><h3>Prerequisites for Cassandra:</h3><p><strong>Source and target environments:</strong></p><ul><li>Both source (AWS) and target (GCP) environments should have 3 Cassandra nodes.</li><li>Ensure both environments have the same Cassandra version (ex: 4.1).</li><li>Ensure <strong>Cassandra nodes</strong> in both environments have the same cluster name, keyspace schema, and replication strategy.</li><li>Network connectivity between source and target environments is established.</li></ul><p><strong>Storage:</strong></p><ul><li>Sufficient storage space in both source and target environments to accommodate the dump and restore processes.</li><li>Consider using compressed backups to reduce storage requirements.</li></ul><p><strong>Backup tools: </strong>Choose a suitable backup tool <br><strong>sstableloader:</strong> Apache Cassandra’s built-in tool for loading SSTables.</p><h3>Cassandra setup :</h3><p>Provision the VMs with required specifications</p><p>Installing openjdk</p><ol><li>Update the repositories:<br>sudo apt-get update</li><li>Install OpenJDK:<br>sudo apt-get install openjdk-8-jdk<br>The latest JDK is installed.</li><li>Verify the version of the JDK:</li><li>java -version</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/0*X2uc9uihVZt6THw_" /></figure><p><strong>Installing cassandra :</strong></p><p>1.Set up the cluster in the GCP environment with the same configuration as on-premises/AWS.</p><p>2. Run the following to install and use Apache Cassandra in the instance:</p><pre>sudo apt install apt-transport-https<br><br>echo &quot;deb https://debian.cassandra.apache.org 40x main&quot; | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list<br><br>curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -<br><br>sudo apt-get update<br>sudo apt install cassandra<br><br>echo &quot;deb https://debian.cassandra.apache.org 311x main&quot; | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list<br>deb https://debian.cassandra.apache.org 311x main</pre><p>3. Check the status of Cassandra and enable the service to start after whenever Linux system restarts, using the following command</p><pre>sudo systemctl status cassandra<br>sudo systemctl enable cassandra</pre><p><strong>Configuration of cassandra.yaml file (GCP)</strong></p><ol><li>Check the status of Cassandra service by running :</li></ol><pre>sudo systemctl status cassandra</pre><p>2. Stop the service and check the status if it is inactive, using :</p><pre>sudo systemctl stop cassandra<br>sudo systemctl status cassandra</pre><p>3. Remove the default folder</p><pre>sudo rm -rf /var/lib/cassandra/*</pre><p>4. Open the cassandra.yaml file using:</p><pre>sudo nano /etc/cassandra/cassandra.yaml</pre><p>And do the following changes:</p><p><strong>cluster_name:</strong> ‘&lt;cluster name&gt;’ (Cluster name should be same on all the data centers)</p><p><strong>num_tokens</strong>: 256</p><p><strong>Initial_token:</strong> &lt;token value obtained from aws/onprem&gt;</p><p><strong>seed_provider:</strong></p><p><strong>seeds:</strong> &lt;seed ip address&gt; (Ensure the seed nodes involve nodes from GCP for future communication between the clusters)</p><p><strong>listen_address: </strong>&lt;ip address of the node&gt;</p><p><strong>rpc_address:</strong> &lt;ip address of the node&gt;</p><p><strong>endpoint_snitch:</strong> GossipingPropertyFileSnitch</p><ul><li><strong>cluster_name</strong> : In the cassandra.yaml file is a configuration setting that allows you to specify a name for your Cassandra cluster. This setting helps identify and differentiate one Cassandra cluster from another, especially in environments where you might have multiple clusters running.</li><li><strong>num_tokens :</strong> It is a configuration parameter that determines the number of tokens assigned to each node in the Cassandra cluster. Tokens are used in Cassandra’s partitioning strategy to distribute data evenly across the nodes in the cluster.The value specified for num_tokens represents the number of virtual tokens assigned to each node.</li><li><a href="https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__initial_token"><strong>initial_token</strong></a> : To recover the snapshot on the new cluster:</li></ul><p>From the old cluster, retrieve the list of tokens associated with each node’s IP:</p><pre>nodetool ring | grep -w ip_address_of_node | awk &#39;{print $NF &quot;,&quot;}&#39; | xargs</pre><p>copy those tokens and add them in gcp node in yaml file.</p><p>add the list of tokens you obtained in the previous step to the <a href="https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/configuration/configCassandra_yaml.html#configCassandra_yaml__initial_token"><strong>initial_token</strong></a> parameter using the same num_tokens setting as in the old cluster.</p><ul><li><strong>seed_provider</strong>: Seed nodes are initial contact points that a new or restarted node uses to discover the rest of the cluster. Seed nodes play a crucial role in the bootstrap process and the discovery of other nodes.</li><li><strong>listen_address </strong>: Specifies the IP address or hostname that the Cassandra node will use for its network interface to listen for connections from other nodes in the cluster. This parameter is essential for communication between nodes in a Cassandra cluster.</li><li><strong>rpc_address</strong> : Specifies the IP address or hostname on which the Cassandra node listens for client connections using the Thrift or native binary protocols. The Remote Procedure Call (RPC) address is relevant for communication between clients and Cassandra nodes.</li><li><strong>endpoint_snitch</strong> : This specifies the fully qualified class name of the endpoint snitch implementation to be used by the Cassandra node. Different types of endpoint snitches are available, and they can be chosen based on the requirements of your deployment.</li></ul><p>Check for the status and start Cassandra service</p><pre>sudo systemctl status cassandra<br>sudo systemctl start cassandra<br>sudo systemctl status cassandra</pre><p>Once all the above mentioned changes are completed, run cqlsh &lt;ip address of the node&gt; and see the cluster details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/0*r3V2aDvdi8RLxqtb" /></figure><h3>Types of Cassandra backup</h3><p>Cassandra provides two types of backup methods:</p><ul><li>Snapshot based backup</li><li>Incremental backup</li></ul><h3>Snapshot Based Backup:</h3><p>The nodetool snapshot command flushes memtables to disk and generates a snapshot by making a hard link to SSTables. It is possible to take a snapshot of all keyspaces in a cluster, or certain selected keyspaces, or a single table in a keyspace. Nodetool utility is a command-line interface for managing a cluster provided by cassandra. This utility gives useful commands for creating snapshots of the data.</p><p>Note: you must have enough free disk space on the node for taking the snapshot of your data files and Cassandra can only restore data from a snapshot when the table schema exists. It is recommended that you also backup the schema.</p><h3>Incremental backup method</h3><p>By default, incremental backup is disabled in Cassandra. This can be enabled by changing the value of <strong>“incremental_backups” to “true”</strong> in the cassandra.yaml file. Once enabled, Cassandra creates a hard link to each memtable flushed to SSTable to a backup’s directory under the keyspace data directory. In Cassandra, incremental backups contain only new SSTable files, as they are dependent on the last snapshot created. Also, incremental backup requires less disk space as it only contains links to new SSTable files generated in the last full snapshot.</p><h3>Restoring from Incremental Backups and Snapshots</h3><p>The two main tools/commands for restoring a table after it has been dropped are:</p><ul><li>sstableloader</li><li>nodetool import</li></ul><h3>Taking snapshots</h3><p>we will taking the snapshot of the keyspaces and restoring it in GCP.</p><ol><li>Login to the node in AWS/onprem for which the snapshot to be taken</li></ol><p>For eg, If you have 3 nodes in onprem/aws you need to take snapshot individually to restore the same in GCP</p><p>2. Before taking snapshots just check if any snapshots are taken already</p><pre>sudo find -name snapshots</pre><p>3. Taking snapshot of all tables in a keyspace</p><p><strong>nodetool snapshot — tag &lt;snapshotname&gt; &lt;keyspacename&gt;</strong></p><p>eg : nodetool snapshot — tag snapshotcar car</p><p><em>Where , Snapshotcar — snapshot name for all the tables ,Car — keyspacename </em>Then , your snapshot will be created in “snapshotcar” directory</p><p>Taking snapshot of particular tables in a keyspace</p><p><strong>nodetool snapshot — tag &lt;tag&gt; — table &lt;table&gt; — &lt;keyspace&gt;</strong></p><p>4. To find the snapshot taken</p><p><strong>nodetool listsnapshots</strong></p><p>5. Navigate to the data directory: Using the path obtained from the configuration file,</p><p>For example: cd /var/lib/cassandra/data/</p><p><em>To find the path to the Cassandra data directory containing the backups, you need to locate the data directory on your system. This directory is specified in the Cassandra configuration file (cassandra.yaml) under the data_file_directories.</em></p><p>6. List the contents of the data directory &gt;&gt;<strong> ls -la</strong></p><p>You need to navigate to the directory where the snapshot is been taken Once you’re in the data directory, list its contents to see the keyspaces stored in Cassandra.</p><p>Snapshot folder:</p><p>/var/lib/cassandra/data/&lt;keyspace&gt;/&lt;table-name&gt;/snapshots</p><p><em>A snapshot contains essentially the same set of SSTable files as an incremental backup does with a few additional files. A snapshot includes a schema.cql file for the schema DDL to create a table in CQL.</em></p><h3>Restoration of snapshot in GCP:</h3><ol><li>Copy the snapshot from AWS/Onprem to the GCP data directory:<br>Data directory: /var/lib/cassandra/data/</li><li>Go to the snapshot folder</li><li>Ensure the directory path structure follows the format /keyspace/table/ for using sstableloader. Create this new directory structure and set appropriate permissions:</li></ol><pre>sudo mkdir -p /keyspace/table/<br>sudo chmod -R 777 /keyspace/table/</pre><p>4. Before using sstableloader to load SSTables, ensure the table exists. You can create the table using the schema.cql file that is generated with each snapshot.</p><p>5. After creating the table, copy the SSTable files from the snapshots directory to the /keyspace/table/ directory:</p><p><strong>sudo cp ./&lt;cassandra-data-directory&gt;/&lt;keyspace&gt;/&lt;table-name-UUID&gt;/snapshots/* /keyspace/table/</strong></p><p>6. Finally, run the sstableloader command to restore the SSTables:</p><p><strong>sstableloader -d &lt;host-name&gt; /keyspace/table/</strong></p><p>If authentication is enabled run :</p><p><strong>sstableloader -d &lt;host-name&gt; /keyspace/table/ -u &lt;username&gt; -p &lt;password&gt;</strong></p><h3>Incremental backup:</h3><p>Configuring for Incremental Backups</p><p>To create incremental backups set incremental_backups to true in cassandra.yaml.</p><h3>Taking the incremental backup:</h3><ol><li>Flush the keyspace and table:</li></ol><p><strong>nodetool flush &lt;keyspace&gt; &lt;table-name&gt;</strong></p><p>Incremental backups are created within the Cassandra’s data directory within a table directory. Backups may be found with the following command.</p><p><strong>find -name backups</strong></p><p>Find the backups in data directory backup folder</p><p>Data directory: /var/lib/cassandra/data/&lt;keyspace&gt;/&lt;table-name-UUID&gt;/backups</p><h3>Restoration of backup in GCP:</h3><ul><li>Copy the backup from AWS/Onprem to the GCP data directory:<br>Data directory: /var/lib/cassandra/data/&lt;keyspace&gt;/</li><li>Ensure the directory path structure follows the format /keyspace/table/ for using sstableloader. Create this new directory structure and set appropriate permissions:</li></ul><pre>sudo mkdir -p /keyspace/table/<br>sudo chmod -R 777 /keyspace/table/</pre><ul><li>After creating the table, copy the SSTable files from the snapshots directory to the /keyspace/table/ directory:</li></ul><p><strong>sudo cp ./&lt;cassandra-data-directory&gt;/&lt;keyspace&gt;/&lt;table-name-UUID&gt;/snapshots/* /keyspace/table/</strong></p><ul><li>Finally, run the sstableloader command to restore the SSTables:</li></ul><p><strong>sstableloader -d &lt;host-name&gt; /keyspace/table/</strong></p><p>If authentication is enabled run :</p><p><strong>sstableloader -d &lt;host-name&gt; /keyspace/table/ -u &lt;username&gt; -p &lt;password&gt;</strong></p><p><strong>Password authentication</strong></p><ul><li>Stop the cassandra</li><li>Edit cassandra.yaml to change the authenticator option like so:</li></ul><p><strong>authenticator: PasswordAuthenticator</strong></p><p><strong>Authorizer : CassandraAuthorizer</strong></p><ul><li>Restart Cassandra</li><li>Start cqlsh using the default superuser name and password:</li></ul><pre>cqlsh -u cassandra -p cassandra<br>CREATE ROLE &lt;role-name&gt; WITH SUPERUSER = false AND LOGIN = true AND PASSWORD = &lt;type password&gt;;<br>GRANT SELECT, MODIFY ON KEYSPACE &lt;keyspace&gt;TO &lt;role&gt;;</pre><h3>Data Validation</h3><ol><li>To check the row count of tables</li></ol><p>Login to cassandra and run :</p><p><strong>select count (*) from &lt;table name&gt;;</strong></p><p>If below error occurs,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-q5tIbWh2I4SoXI9" /></figure><p>Change the value in cassandra.yaml to increase the timeout .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*-UmvBJXLFWUYaXII" /></figure><p>Other method for data validation is using dsbulk, It is highly optimized for handling large volumes of data efficiently</p><p><strong>2. Installing dsbulk</strong></p><pre>wget https://github.com/datastax/dsbulk/releases/download/1.11.0/dsbulk-1.11.0.tar.gz<br>tar -xvf dsbulk-1.11.0.tar.gz<br>sudo mv dsbulk-1.11.0 /opt/dsbulk<br>export PATH=&quot;/opt/dsbulk/bin:$PATH&quot;<br>source ~/.bashrc<br>dsbulk - version</pre><p>After installation run below command</p><p><strong>dsbulk count -k &lt;keyspace&gt; -t &lt;table_name&gt; -h &lt;node_ip&gt; — stats.modes global</strong></p><p>Dsbulk command doesnt work if authentication is enabled.</p><p><strong>3. Validation using copy command:</strong></p><ol><li>Cqlsh to the node</li></ol><p><strong>Use &lt;keyspaces&gt;;</strong></p><p>Run this command to get the row count</p><p><strong>COPY &lt;tablename&gt; TO ‘/dev/null’;</strong></p><h3>Issues:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*u6UaKDyDhpPhYlmh" /></figure><p>Use the command:</p><p><strong>MAX_HEAP_SIZE = “2G” sstableloader -d &lt;host-name&gt; /keyspace/table/ -f &lt;path to cassandra.yaml&gt;</strong></p><p>Change the heap size accordingly as required while running sstableloader command.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c96f2515f3a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/niveus-solutions/cassandra-dump-and-restore-0c96f2515f3a">Implementing Cassandra Dump and Restore</a> was originally published in <a href="https://medium.com/niveus-solutions">Niveus Solutions Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>