Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6546765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:44:55+00:00 2026-05-25T11:44:55+00:00

First, I read this this . I cannot get Cassandra up and running again.

  • 0

First, I read this this.

I cannot get Cassandra up and running again.
I am using Hector as my client to connect to an instance of Cassandra 0.8.2 & load my schema. Through Hector, I am using 2 different classes to create 2 different column families – Articles & TagsArticlesCF.

Through the main class, I create a column families named “Articles” and “TagsArticlesCF” like this:

public static void main(String[] args) {
    cluster = HFactory.getOrCreateCluster("test cluster", "xxx.xxx.xxx.xxx:9160");
    newKeyspaceDef = HFactory.createKeyspaceDefinition(keyspaceName);
    if( (cluster.describeKeyspace(keyspaceName)) == null){
        createSchema();
    }


    Keyspace ksp = HFactory.createKeyspace(keyspaceName, cluster);
    Articles art = new Articles(cluster, newKeyspaceDef,ksp);
TagsArticlesCF tags = new TagsArticlesCF(cluster,newKeyspaceDef,ksp);

Here is an example of what my column families look like/ how they are created:

public Articles(Cluster cluster, KeyspaceDefinition ksp, Keyspace ksp2)  {
BasicColumnFamilyDefinition bcfDef = new BasicColumnFamilyDefinition();
        bcfDef.setName("Articles");
        bcfDef.setKeyspaceName("test3");
        bcfDef.setDefaultValidationClass(ComparatorType.UTF8TYPE.getClassName());
        bcfDef.setKeyValidationClass(ComparatorType.UTF8TYPE.getClassName());
        bcfDef.setComparatorType(ComparatorType.UTF8TYPE);

        ColumnFamilyDefinition cfDef = new ThriftCfDef(bcfDef);
        BasicColumnDefinition columnDefinition = new BasicColumnDefinition();
        columnDefinition.setName(StringSerializer.get().toByteBuffer("title"));
        columnDefinition.setIndexType(ColumnIndexType.KEYS);
        columnDefinition.setValidationClass(ComparatorType.UTF8TYPE.getClassName());
        cfDef.addColumnDefinition(columnDefinition);
...

I am trying to add a full schema into Cassandra that will support queries that I plan to execute on the loaded data. I ran the main method a few times to load the new column families into the database. After running the main method several times and adjusting a few things (checking if the column family was already in the KeyspaceDefinition), the running instance of Cassandra went down.

I am curious about a few things using Hector/java:

  1. I plan to have 10 or so column families with different columns (to support different queries). Is it best practice to organize my classes so that I have a class for each column family?

  2. What exactly is the difference between a KeyspaceDefinition & a Keyspace? Why is the distinction made?

We tried to get a new instance of Cassandra & here is what we ran into. I am trying to better understand what’s going on so, any comments and help to avoid these types of errors would be greatly appreciated:

[root@appscluster1 bin]# ./cassandra -p cassandra.pid
[root@appscluster1 bin]#  INFO 10:52:36,437 Logging initialized
 INFO 10:52:36,484 JVM vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.6.0_25
 INFO 10:52:36,485 Heap size: 1046937600/1046937600
 INFO 10:52:36,490 JNA not found. Native methods will be disabled.
 INFO 10:52:36,526 Loading settings from file:/opt/cassandra/apache-cassandra-0.8.2/conf/cassandra.yaml

[root@appscluster1 bin]#  INFO 10:52:36,872 DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
 INFO 10:52:37,346 Global memtable threshold is enabled at 332MB
 INFO 10:52:37,348 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:37,497 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:37,617 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:37,984 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:38,252 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:38,259 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:38,545 Opening /opt/cassandra/persist8/data/system/IndexInfo-g-73
 INFO 10:52:38,661 Opening /opt/cassandra/persist8/data/system/Schema-g-169
 INFO 10:52:38,685 Opening /opt/cassandra/persist8/data/system/Schema-g-170
 INFO 10:52:38,730 Opening /opt/cassandra/persist8/data/system/Schema-g-171
 INFO 10:52:38,751 Opening /opt/cassandra/persist8/data/system/Migrations-g-171
 INFO 10:52:38,763 Opening /opt/cassandra/persist8/data/system/Migrations-g-170
 INFO 10:52:38,776 Opening /opt/cassandra/persist8/data/system/Migrations-g-169
 INFO 10:52:38,795 Opening /opt/cassandra/persist8/data/system/LocationInfo-g-2
 INFO 10:52:38,827 Opening /opt/cassandra/persist8/data/system/LocationInfo-g-1
 INFO 10:52:39,048 Loading schema version ec437ac0-d28a-11e0-0000-c4ffed3367ff
 INFO 10:52:39,645 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:39,663 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)

… (more of same)…

 INFO 10:52:40,463 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:41,390 Opening /opt/cassandra/persist8/data/test3/Articles-g-367
ERROR 10:52:41,392 Missing sstable component in /opt/cassandra/persist8/data/test3/Articles-g-367=[Index.db, Data.db]; skipped because of /opt/cassandra/persist8/data/test3/Articles-g-367-Index.db (No such file or directory)
 INFO 10:52:41,863 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
 INFO 10:52:41,865 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)

… (more of same) …

 INFO 10:52:41,892 Removing compacted SSTable files (see http://wiki.apache.org/cassandra/MemtableSSTable)
ERROR 10:52:41,898 Exception encountered during startup.
java.lang.RuntimeException: javax.management.InstanceAlreadyExistsException: org.apache.cassandra.db:type=ColumnFamilies,keyspace=test3,columnfamily=TagsArticlesCF
       at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:315)
       at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:466)
       at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:436)
       at org.apache.cassandra.db.Table.initCf(Table.java:369)
       at org.apache.cassandra.db.Table.<init>(Table.java:306)
       at org.apache.cassandra.db.Table.open(Table.java:111)
       at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:187)
       at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:341)
       at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:80)
Caused by: javax.management.InstanceAlreadyExistsException: org.apache.cassandra.db:type=ColumnFamilies,keyspace=test3,columnfamily=TagsArticlesCF
       at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
       at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
       at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:311)
       ... 8 more
Exception encountered during startup.
java.lang.RuntimeException: javax.management.InstanceAlreadyExistsException: org.apache.cassandra.db:type=ColumnFamilies,keyspace=test3,columnfamily=TagsArticlesCF
       at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:315)
       at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:466)
       at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:436)
       at org.apache.cassandra.db.Table.initCf(Table.java:369)
       at org.apache.cassandra.db.Table.<init>(Table.java:306)
       at org.apache.cassandra.db.Table.open(Table.java:111)
       at org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:187)
       at org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:341)
       at org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:80)
Caused by: javax.management.InstanceAlreadyExistsException: org.apache.cassandra.db:type=ColumnFamilies,keyspace=test3,columnfamily=TagsArticlesCF
       at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
       at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
       at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
       at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:311)
       ... 8 more

[root@appscluster1 bin]#

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:44:55+00:00Added an answer on May 25, 2026 at 11:44 am

    How are you sending the Keyspace definition to the cluster?

    Take a look at the methods following test case:
    https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/service/CassandraClusterTest.java#L115-189

    If a keyspace and or column family already exist, you should be able to catch an IllegalArgumentException.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me say I have read this useful article thoroughly and am using
This is my first time on StackOverflow though I read Coding Horror quite often.
I recall when I first read Pragmatic Programmer that they suggested using scripting languages
How can I read the first line from a text file using a Windows
I am trying to get Clojure to read a file, put the first line
I read many discussions about the inSampleSize OutOfMemory dilemma. Cannot get a good solution
First, I must say that I have read several post about this at StackOverflow
Alright, I've been working on this for a while and cannot get it. I'm
First I've read loads of posts and sites that recommend going to http://silverlight.net/GetStarted/ to
Having just read the first four chapters of Refactoring: Improving the Design of Existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.