{"id":2392,"date":"2018-06-19T01:08:34","date_gmt":"2018-06-19T07:08:34","guid":{"rendered":"https:\/\/www.supportpro.com\/blog\/?p=2392"},"modified":"2019-10-29T05:04:07","modified_gmt":"2019-10-29T11:04:07","slug":"apache-cassandra","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/apache-cassandra\/","title":{"rendered":"Apache Cassandra"},"content":{"rendered":"<p>Cassandra is a distributed database management system designed for handling a high volume of structured data across commodity servers. It provides high availability with no single point of failure.<\/p>\n<p><strong>Important points\u00a0<\/strong><\/p>\n<p>Apache Cassandra is an open-source, distributed and decentralized\/distributed storage system.<br \/>\nIt is a column-oriented database.<br \/>\nCassandra was developed at Facebook for an inbox search.<\/p>\n<p><!--more--><strong>FAULT TOLERANT:<\/strong><br \/>\nData is automatically replicated to multiple nodes for fault-tolerance. It supports replication across multiple data centers. This ensures the replacement of the failed nodes with no downtime.<\/p>\n<p><strong>DECENTRALIZED:<\/strong><br \/>\nThere are no single points of failure and network bottlenecks. Every node in the cluster is identical.<\/p>\n<p><strong>ELASTIC:<\/strong><br \/>\nAs new machines are added,\u00a0 both the read and write throughput increase linearly with no downtime or interruption to applications.<\/p>\n<p><strong>Key components of Cassandra<\/strong><\/p>\n<p>Node \u2212 It is the place where data is stored.<\/p>\n<p>Data center \u2212 It is a collection of related nodes.<\/p>\n<p>Cluster \u2212 A cluster is a component that contains one or more data centers.<\/p>\n<p>Commit log \u2212 The commit log is a crash-recovery mechanism in Cassandra. Every write operation is written to the commit log.<\/p>\n<p>Mem-table \u2212 A mem-table is a memory-resident data structure. After the commit log, the data will be written to the mem-table. Sometimes, for a single-column family, there will be multiple mem-tables.<\/p>\n<p>SSTable \u2212 It is a disk file to which the data is flushed from the mem-table when its contents reach a threshold value.<\/p>\n<p>Bloom filter \u2212 This is basically a data structure\u00a0designed to tell us rapidly and memory-efficiently, whether an element is present in a set. It is a special kind of cache. Bloom filters are accessed after every query.<\/p>\n<p><strong>Data Replication<\/strong><\/p>\n<p>A node in a cluster act as replicas for a given piece of data. If it is detected that some of the nodes responded with an out-of-date value, Cassandra will return the most recent value to the client. After returning the most recent value, Cassandra performs a read repair in the background to update the stale values.<\/p>\n<p><a class=\"lightbox\" href=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2018\/06\/cassandra.png\"><br \/>\n<img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-2393 aligncenter\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2018\/06\/cassandra.png\" alt=\"\" width=\"520\" height=\"545\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2018\/06\/cassandra.png 520w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2018\/06\/cassandra-286x300.png 286w\" sizes=\"(max-width: 520px) 100vw, 520px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Installation<\/strong><\/p>\n<p>Java is the main prerequisite for Cassandra.We need to verify the java version using the below command.<\/p>\n<p>============<br \/>\n#java &#8211;version<br \/>\n============<\/p>\n<p><strong>Installation from RPM packages<\/strong><\/p>\n<p>For the\u00a0&lt;release series&gt; specify the major version number without dot, and with an appended x.<br \/>\nThe latest\u00a0&lt;release series&gt; is 311x.<br \/>\nFor older releases, the &lt;release series&gt; can be one of 30x, 22x, or 21x.<br \/>\n(Not all versions of Apache Cassandra are available since building RPMs is a recent addition to the project.)<\/p>\n<p>Add the Apache repository of Cassandra to \/etc\/yum.repos.d\/cassandra.repo. For the latest 3.11 version, see the below example:<br \/>\n===========<br \/>\n[cassandra]<br \/>\nname=Apache Cassandra<br \/>\nbaseurl=https:\/\/www.apache.org\/dist\/cassandra\/redhat\/311x\/<br \/>\ngpgcheck=1<br \/>\nrepo_gpgcheck=1<br \/>\ngpgkey=https:\/\/www.apache.org\/dist\/cassandra\/KEYS<br \/>\n===========<\/p>\n<p>Install Cassandra, accepting the gpg key import prompts:<br \/>\nsudo yum install cassandra<br \/>\nStart Cassandra (will not start automatically):<\/p>\n<p>service cassandra start<\/p>\n<p><strong>Download Cassandra<\/strong><\/p>\n<p>Download URL: http:\/\/cassandra.apache.org\/download\/<\/p>\n<p><strong>Important things related to Cassandra<\/strong><\/p>\n<p>By default, Cassandra uses the port 7000 for cluster communication (7001 if SSL is enabled), 9042 for native protocol clients, and 7199 for JMX. The internode communication and native protocol ports are configurable in the Cassandra Configuration File. The JMX port is configurable in cassandra-env.sh (through JVM options). All ports are TCP.<br \/>\nWhen a new node joins a cluster, it will automatically contact the other nodes in the cluster and copy the right data to itself. On\u00a0RHEL nodes are unable to join the ring and the solution to this case is to check if SELinux is on; if it is, turn it off.<\/p>\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/www.supportpro.com\/freecheckup.php\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cassandra is a distributed database management system designed for handling a high volume of structured data across commodity servers. It provides high availability with no single point of failure. Important&hellip;<\/p>\n","protected":false},"author":4,"featured_media":2416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[67,5,1,3],"tags":[],"class_list":["post-2392","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-general-topics","category-miscellaneous","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/2392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=2392"}],"version-history":[{"count":31,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/2392\/revisions"}],"predecessor-version":[{"id":4364,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/2392\/revisions\/4364"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/2416"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=2392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=2392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=2392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}