Cloud Insight now supports monitoring Cassandra!

Source: Internet
Author: User
Tags cassandra disk usage

What is Cassandra?

Apache Cassandra is known for its scalability and fault-tolerant distributed database systems. Cassandra originated from a project that Facebook originally created in Amazon Dynamo and Google BigTable, and has since grown into an open-source system that has been used extensively by companies like Apple and Netflix. The following are some of the key properties of Cassandra:

    • High scalability and high availability (Cassandra clusters are decentralized, so there is no single point of failure)
    • can be approximately linear (the cluster expands by one times and the throughput expands by twice times)
    • Very high write throughput and good read throughput
    • Adjustable consistency and support for replication
    • Natural accommodates (for example, time series data)

Cassandra, who has the above attributes, did not go very well before China, and a few years ago it was a new product, with no good convincing in terms of stability and best practices, and Facebook and Twitter, for their own architecture, to abandon the use of Cassandra, instead HBase and other databases, as well as in China about the Cassandra article is less, do not know its people will not try, a variety of reasons so that before the domestic use of Cassandra not present the trend of fire.

But in recent years, with its version upgrade, application practice increased, has Instagram migrated to Cassandra,facebook part of the project on Cassandra, Cassandra 2015 meeting participants more than 6000 people, such as events, Austrian consulting firm Solid IT compiled data shows that 2015 Cassandra is the most popular NoSQL database in addition to MongoDB, and is the third fastest growing database system in the world.

On the homepage of Apache Cassandra's official website, there are now more than 1500 companies in use in the world:

Cassandra is on use at Constant Contact,cern, Comcast, EBay, GitHub, Godaddy,hulu, Instagram, Intuit, Netflix, Reddit, the Weather Channel, and over-over-companies that has large, active data sets.

In addition, DataStax, a Cassandra-focused start-up company, gained $45 million in D-round financing in 13, and its success represents a huge market space for Cassandra, proving that it can handle large-scale online applications and ensure performance stability.

All of these have prompted many software developers to start using Cassandra, as well as support for Cassandra performance monitoring software services, such as the domestic Cloud Insight, support monitoring Cassandra, display and other indicators.

Cloud Insight Section Indicator description

With cloud insight, there are a number of indicators that you can crawl and analyze, and this article only covers some of the more metrics seen in cloud insight Cassandra:

    • Throughput, especially read-write requests
    • Latency, especially read-write latency
    • Disk usage, especially disk space on each node
    • Abnormal error and exceeding, especially abnormal error

With Cloud Insight, you can monitor the above metrics, customize the dashboards according to your preferences, and configure alerts to see the flow of events they generate, and it's also a good click.

Throughput
    • Cassandra.db.write_count
    • Cassandra.db.write_operations
    • Cassandra.db.read_operations

Monitors the query rate at any given time, providing a diagram of how users interact with Cassandra. And, since Cassandra is good at handling large volumes of writes, you'll definitely want to keep a close eye on the read rate and be wary of potential problems or significant changes in user query patterns.

Cassandra is very good at handling a large number of write operations, focusing on monitoring Cassandra write indicators, can track the overall level of activity of the cluster, to pay attention to any abnormal spikes or dips, and further investigation.

Delay
    • Cassandra.db.recentReadLatency_micros
    • Cassandra.db.recentWriteLatency_micros
    • Cassandra.db.totalRangeLatency_micros
    • Cassandra.db.totalReadLatency_micros
    • Cassandra.db.totalWriteLatency_micros

Cassandra read operations are usually much slower than write operations because reads involve more I/O. If updated frequently, it can span several sstables, increasing the waiting time for reads. Therefore, read latency is a very important indicator, especially if the Cassandra query is a data service for user applications. Slow reads can indicate problems with a hardware or data model, or parameters that need to be adjusted, such as a compression strategy.

Cassandra writes are usually much faster than read operations, because write requests are only recorded in memory before they are known, and are appended to a persistent commit log, even if they succeed. The specific delay level will depend on your usage. Long-term slow writes are a systemic problem, and it may be necessary to upgrade the disk to a faster SSD or check for consistency settings (for example, setting consistency EACH_QUORUM requires communication between geographically distant datacenters). Any sudden change in write operations metrics can be problematic, such as network problems or changes in usage patterns (for example, a significant increase in the size of database insertions).

Disk
    • Cassandra.db.load
    • Cassandra.db.totalDiskspace_used

Monitoring the disks used by each node can alert cluster imbalances or resource constraints. Depending on the use of your Cassandra cluster and the compression strategy you choose, you can monitor disk utilization to determine when more node clusters should be added to ensure that Cassandra always has enough space to run compaction.

Abnormal error and exceeding
    • Cassandra.db.exception_count
    • cassandra.internal.currentlyblockedtasks
    • Cassandra.internal.totalblockedtasks

Whatever the reason, when the cluster is unable to process the incoming request flow, you need to know the situation immediately. A window to a potential problem increases the number of Cassandra throws, such as a timeout exception, which reflects the number of requests that are incomplete (but not failed) to handle Cassandra.

Another way to detect potential problems is to monitor the Cassandra's task status as it requests processing. Cassandra each type of task (for example, the Readstage task) has an incoming task queue, and a certain number of threads are assigned to perform these tasks. If all threads are in use, the task waits for the available threads in the queue. The number of queues for any time task is shown by the pending tasks indicator. Once the suspended task queue is full, Cassandra will take the current block as a currently blocked, and of course these tasks may eventually be accepted or executed.

How to monitor Cassandra

To monitor Cassandra, first you need to install the Cloud Insight probe, register your account, copy it with one click:

CI_LICENSE_KEY= bash -c "$(curl -L https://download.oneapm.com/oneapm_ci_agent/install_agent.sh)"  

After successful installation, there will be an application on the web, followed by the configuration of Cassandra monitoring, Cloud Insight monitoring Cassandra is through JMX to obtain the indicator, the details of JMX remote monitoring, that is, the first to turn on JMX monitoring, after configuring the JMX to find The directory in which the configuration file resides, such as a Linux system, a configuration file, /etc/oneapm-ci-agent/conf.d a copy cassandra.yaml , the configuration file needs to modify the host and port (JMX monitoring ports), so that the Cloud Insight Agent can communicate with Cassandra:

Instances:-host:localhost port:7199 user:username Password:password name:cassandra_instance #trus T_store_path:/path/to/truststore.jks # Optional, should BES set if SSL is enabled #trust_store_password: Password #j Ava_bin_path:/path/to/java #Optional, should be set if the agent cannot find your Java executable# List of metrics to be          Collected by the integrationinit_config:conf:-include:domain:org.apache.cassandra.db attribute: -Bloomfilterdiskspaceused-bloomfilterfalsepositives-bloomfilterfalseratio-capaci Ty-compressionratio-completedtasks-exceptioncount-hits-recenthitrat E-rowcacherecenthitrate-keycacherecenthitrate-livediskspaceused-livesstablecou Nt-load-maxrowsize-meanrowsize-memtablecolumnscount-memtabledatasiz E-memtableswiTchcount-minrowsize-readcount-requests-size-totaldiskspaceused          -Totalreadlatencymicros-totalwritelatencymicros-updateinterval-writecount -Pendingtasks Exclude:keyspace:system attribute:-Minimumcompactionthreshold-ma Ximumcompactionthreshold-rowcachekeystosave-keycachesaveperiodinseconds-rowcachesaveperio Dinseconds-pendingtasks-scores-rpctimeout-include:domain:org.apache.cassand  Ra.internal attribute:-Activecount-completedtasks-currentlyblockedtasks- Totalblockedtasks-include:domain:org.apache.cassandra.net attribute:-totaltimeouts

Restart Cloud Insight for the configuration to take effect. You can also Info verify that the configuration was successful by executing the command:

sudo /etc/init.d/oneapm-ci-agent  restart  sudo /etc/init.d/oneapm-ci-agent  info  

When the following information appears, the installation succeeds:

Checks  ======[...]cassandra  ---------  - instance #0 [OK]  - Collected 8 metrics & 0 events

After the installation is successful, you can see the Cassandra metrics data in 2 minutes, and you can monitor each of the Cassandra key metrics by setting the data you care about with a custom dashboard. By setting tabs, you can group all the hosts and see them from the cool extension map. You can also set an alarm policy, once the indicator data is abnormal, you can quickly let the team members know, such as request throughput in a short period of time down to a certain value can be an alarm policy.

Summarize

If you're using Cassandra (use it now if you're not using it), want to visualize key metrics, be able to customize the dashboard, put together the metrics you want to see, set alarms, and notify team members if any of the data has any exceptions, so be sure to choose the Cloud Insight. In addition, any internal event using it will have an event stream recorded, such as the setting of the alarm policy to modify, close, open, probe startup and so on. Is it so powerful that you don't want to experience it?

Cloud Insight now supports monitoring Cassandra!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.