Cassandra cannot create a table [schema disagreement errors]

Source: Internet
Author: User
Tags cassandra

Cassandra cannot create a table today. The following error message is displayed:

Connected to: "Sentiment Cluster" on localhost/9160Authenticated to keyspace: sentimentLine 2 => Cluster schema does not yet agreecreate DB error: 20120322

Frequent tracing and feedback:

Http://wiki.apache.org/cassandra/FAQ#schema_disagreement

Cassandra schema updates assume
That schema changes are done-at-a-time. if you make multiple changes at the same time, you can cause some nodes to end up with a different schema, than others. (before 0.7.6, this can also be caused by cluster system clocks being substantially out
Of sync with each other .)

To fix schema disagreements, You need to force the disagreeing nodes to rebuild their schema. Here's how:

Open the Cassandra-CLI and run: 'connect localhost/9160; ', then' describe cluster;'. You'll see something like this:

[default@unknown] describe cluster;Cluster Information:   Snitch: org.apache.cassandra.locator.SimpleSnitch   Partitioner: org.apache.cassandra.dht.RandomPartitioner   Schema versions:75eece10-bf48-11e0-0000-4d205df954a7: [192.168.1.9, 192.168.1.25]5a54ebd0-bd90-11e0-0000-9510c23fceff: [192.168.1.27]

Note which schemas are in the minority and mark down those IPS -- in the above example, 192.168.1.27. login to each of those machines and stop the Cassandra service/process by running 'sudo Service
Cassandra stop 'or 'Kill <pid> '. remove the schema * and migration * sstables inside of your system keyspace (/var/lib/Cassandra/data/system, if you're using the defaults ).

After starting Cassandra again, this node will notice the missing information and pull in the correct schema from one of the other nodes.

To confirm everything is on the same schema, verify that 'describe cluster; 'Only returns one schema version.

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.