You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Jason Wee <pe...@gmail.com> on 2015/01/16 10:56:18 UTC

keyspace not exists?

$ cqlsh 192.168.0.2 9042
Connected to just4fun at 192.168.0.2:9042.
[cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> DESCRIBE KEYSPACES

<empty>

cqlsh> create keyspace foobar with replication = {'class':'SimpleStrategy',
'replication_factor':3};
errors={}, last_host=192.168.0.2
cqlsh> DESCRIBE KEYSPACES;

<empty>

cqlsh> use foobar;
cqlsh:foobar>  DESCRIBE TABLES;

Keyspace 'foobar' not found.


Just trying cassandra 2.1 and encounter the above erorr, can anyone explain
why is this and where to even begin troubleshooting?

Jason

Re: keyspace not exists?

Posted by Jason Wee <pe...@gmail.com>.
Thanks Rob, we keep this in mind for our learning journey.

Jason

On Wed, Jan 21, 2015 at 6:45 AM, Robert Coli <rc...@eventbrite.com> wrote:

> On Sun, Jan 18, 2015 at 8:55 PM, Jason Wee <pe...@gmail.com> wrote:
>
>> two nodes running cassandra 2.1.2 and one running cassandra 2.1.1
>>
>
> For the record, this is an unsupported persistent configuration. You are
> only supposed to have split minor versions during an upgrade.
>
> I have no idea if it is causing the problem you are having.
>
> =Rob
>
>

Re: keyspace not exists?

Posted by Robert Coli <rc...@eventbrite.com>.
On Sun, Jan 18, 2015 at 8:55 PM, Jason Wee <pe...@gmail.com> wrote:

> two nodes running cassandra 2.1.2 and one running cassandra 2.1.1
>

For the record, this is an unsupported persistent configuration. You are
only supposed to have split minor versions during an upgrade.

I have no idea if it is causing the problem you are having.

=Rob

Re: keyspace not exists?

Posted by Jason Wee <pe...@gmail.com>.
Hi,

Immediately after a repair, I execute cqlsh, still the schema mismatch?

[2015-01-19 13:50:49,979] Repair session
19c67350-9f9f-11e4-8b56-a322c40b8b81 for range
(-725731847063341791,-718486959589605925] finished
[2015-01-19 13:50:49,980] Repair session
1a612cb0-9f9f-11e4-8b56-a322c40b8b81 for range
(-5366440687164990017,-5357952536457207248] finished
[2015-01-19 13:50:49,980] Repair session
1afcd070-9f9f-11e4-8b56-a322c40b8b81 for range
(-2871651679602006497,-2860883420245139806] finished
[2015-01-19 13:50:49,980] Repair session
1b99acb0-9f9f-11e4-8b56-a322c40b8b81 for range
(-394095345040964045,-391878264832686281] finished
[2015-01-19 13:50:49,981] Repair session
1c352960-9f9f-11e4-8b56-a322c40b8b81 for range
(8830377476646048271,8848086816619852308] finished
[2015-01-19 13:50:49,981] Repair session
1cd1de90-9f9f-11e4-8b56-a322c40b8b81 for range
(4538653889569069241,4549572313549299652] finished
[2015-01-19 13:50:49,985] Repair session
1d6ebad0-9f9f-11e4-8b56-a322c40b8b81 for range
(6052068628404624993,6058413940102734921] finished
[2015-01-19 13:50:49,986] Repair command #1 finished
jason@localhost:~$ cqlsh 192.168.0.2 9042
Warning: schema version mismatch detected; check the schema versions of
your nodes in system.local and system.peers.
Connected to just4fun at 192.168.0.2:9042.
[cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>
cqlsh> desc keyspaces;

system_traces  jw_schema1  system

cqlsh> use jw_schema1;
cqlsh:jw_schema1> desc tables;

user_profiles

cqlsh:system>  select host_id,schema_version from system.peers;

 host_id                              | schema_version
--------------------------------------+--------------------------------------
 d21e3d11-5bfb-4888-97cd-62af90e83f56 | b5291c1d-6635-3627-928f-f5a0f0c27ec1
 d21e3d11-5bfb-4888-97cd-62af90e83f56 | c7a2ebda-89f7-36f0-a735-a0dffc400124
 69bd2306-c919-411b-83f3-341b4f7f54b4 | f6f3835e-ed12-34f4-9f4b-f2a72bb57c30
 e1444216-4412-45d5-9703-a463ee50aec2 | f6f3835e-ed12-34f4-9f4b-f2a72bb57c30

(4 rows)
cqlsh:system> select host_id,schema_version from system.local;

 host_id                              | schema_version
--------------------------------------+--------------------------------------
 d21e3d11-5bfb-4888-97cd-62af90e83f56 | f6f3835e-ed12-34f4-9f4b-f2a72bb57c30

(1 rows)


On Mon, Jan 19, 2015 at 12:55 PM, Jason Wee <pe...@gmail.com> wrote:

> log does not show anything fishy, because it is just for fun cluster, we
> can actually wipe our 3 nodes cluster casandra dir,
> data,saved_caches,commitlog and start it all over, we encounter the same
> problem.
>
> two nodes running cassandra 2.1.2 and one running cassandra 2.1.1
>
> I look a look at the issue given by Tyler link, and patch my cqlsh and
> given more information below and thank you it works. Actually doing this
> tutorial from this blog http://www.datastax.com/dev/blog/thrift-to-cql3
>
> $ cqlsh 192.168.0.2 9042
> Warning: schema version mismatch detected; check the schema versions of
> your nodes in system.local and system.peers.
> Connected to just4fun at 192.168.0.2:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
> Use HELP for help.
> cqlsh>  DESCRIBE KEYSPACES;
>
> system_traces  jw_schema1  system
>
> cqlsh> use jw_schema1;
> cqlsh:jw_schema1> desc tables;
>
> user_profiles
>
> cqlsh:jw_schema1> quit;
>
> $ cassandra-cli -h 192.168.0.2 -p 9160
> Connected to: "just4fun" on 192.168.0.2/9160
> Welcome to Cassandra CLI version 2.1.1
>
> The CLI is deprecated and will be removed in Cassandra 3.0.  Consider
> migrating to cqlsh.
> CQL is fully backwards compatible with Thrift data; see
> http://www.datastax.com/dev/blog/thrift-to-cql3
>
> Type 'help;' or '?' for help.
> Type 'quit;' or 'exit;' to quit.
>
> [default@unknown] show keyspaces;
>
> WARNING: CQL3 tables are intentionally omitted from 'show keyspaces'
> output.
> See https://issues.apache.org/jira/browse/CASSANDRA-4377 for details.
>
> Keyspace: jw_schema1:
>   Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
>   Durable Writes: true
>     Options: [replication_factor:3]
>   Column Families:
>     ColumnFamily: user_profiles
>       Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
>       Default column value validator:
> org.apache.cassandra.db.marshal.BytesType
>       Cells sorted by: org.apache.cassandra.db.marshal.UTF8Type
>       GC grace seconds: 864000
>       Compaction min/max thresholds: 4/32
>       Read repair chance: 0.0
>       DC Local Read repair chance: 0.1
>       Caching: KEYS_ONLY
>       Default time to live: 0
>       Bloom Filter FP chance: 0.01
>       Index interval: default
>       Speculative Retry: 99.0PERCENTILE
>       Built indexes: []
>       Column Metadata:
>         Column Name: first_name
>           Validation Class: org.apache.cassandra.db.marshal.UTF8Type
>         Column Name: year_of_birth
>           Validation Class: org.apache.cassandra.db.marshal.Int32Type
>         Column Name: last_name
>           Validation Class: org.apache.cassandra.db.marshal.UTF8Type
>       Compaction Strategy:
> org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
>       Compression Options:
>         sstable_compression: org.apache.cassandra.io.compress.LZ4Compressor
> Keyspace: system:
> ..
> ..
> ..
> Keyspace: system_traces:
>   Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
>   Durable Writes: true
>     Options: [replication_factor:2]
>   Column Families:
> [default@unknown] use jw_schema1;
> Authenticated to keyspace: jw_schema1
> [default@jw_schema1] list user_profiles;
> Using default limit of 100
> Using default cell limit of 100
>
> 0 Row Returned.
> Elapsed time: 728 msec(s).
> [default@jw_schema1]
>
> On Sat, Jan 17, 2015 at 6:41 AM, Tyler Hobbs <ty...@datastax.com> wrote:
>
>> This might be https://issues.apache.org/jira/browse/CASSANDRA-8512 if
>> your cluster has a schema disagreement.  You can apply the patch on that
>> ticket with "patch -p1 < 8512-2.1.txt" from the top-level cassandra
>> directory and see if it helps.
>>
>> On Fri, Jan 16, 2015 at 11:58 AM, Julien Anguenot <ju...@anguenot.org>
>> wrote:
>>
>>> Hey Jason,
>>>
>>> Your RF=3, do you have 3 nodes up and running in this DC? We have seen
>>> this issue with 2.1.x and cqlsh where schema changes would trigger the
>>> "keyspace not found" error in cqlsh if not all nodes were up and
>>> running when altering KS schema in a DC with NetworkTopologyStrategy
>>> and RF=3. For us, bringing all the nodes up to meet RF would then fix
>>> the problem.
>>>
>>> As well, you might want to restart the node and see if the "keyspace
>>> not found" still occurs: same here, since 2.1.x we've had cases where
>>> a restart was required for cqlsh and / or drivers to see the schema
>>> changes.
>>>
>>>    J.
>>>
>>> On Fri, Jan 16, 2015 at 3:56 AM, Jason Wee <pe...@gmail.com> wrote:
>>> > $ cqlsh 192.168.0.2 9042
>>> > Connected to just4fun at 192.168.0.2:9042.
>>> > [cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
>>> > Use HELP for help.
>>> > cqlsh> DESCRIBE KEYSPACES
>>> >
>>> > <empty>
>>> >
>>> > cqlsh> create keyspace foobar with replication =
>>> {'class':'SimpleStrategy',
>>> > 'replication_factor':3};
>>> > errors={}, last_host=192.168.0.2
>>> > cqlsh> DESCRIBE KEYSPACES;
>>> >
>>> > <empty>
>>> >
>>> > cqlsh> use foobar;
>>> > cqlsh:foobar>  DESCRIBE TABLES;
>>> >
>>> > Keyspace 'foobar' not found.
>>> >
>>> >
>>> > Just trying cassandra 2.1 and encounter the above erorr, can anyone
>>> explain
>>> > why is this and where to even begin troubleshooting?
>>> >
>>> > Jason
>>>
>>
>>
>>
>> --
>> Tyler Hobbs
>> DataStax <http://datastax.com/>
>>
>
>

Re: keyspace not exists?

Posted by Jason Wee <pe...@gmail.com>.
log does not show anything fishy, because it is just for fun cluster, we
can actually wipe our 3 nodes cluster casandra dir,
data,saved_caches,commitlog and start it all over, we encounter the same
problem.

two nodes running cassandra 2.1.2 and one running cassandra 2.1.1

I look a look at the issue given by Tyler link, and patch my cqlsh and
given more information below and thank you it works. Actually doing this
tutorial from this blog http://www.datastax.com/dev/blog/thrift-to-cql3

$ cqlsh 192.168.0.2 9042
Warning: schema version mismatch detected; check the schema versions of
your nodes in system.local and system.peers.
Connected to just4fun at 192.168.0.2:9042.
[cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>  DESCRIBE KEYSPACES;

system_traces  jw_schema1  system

cqlsh> use jw_schema1;
cqlsh:jw_schema1> desc tables;

user_profiles

cqlsh:jw_schema1> quit;

$ cassandra-cli -h 192.168.0.2 -p 9160
Connected to: "just4fun" on 192.168.0.2/9160
Welcome to Cassandra CLI version 2.1.1

The CLI is deprecated and will be removed in Cassandra 3.0.  Consider
migrating to cqlsh.
CQL is fully backwards compatible with Thrift data; see
http://www.datastax.com/dev/blog/thrift-to-cql3

Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.

[default@unknown] show keyspaces;

WARNING: CQL3 tables are intentionally omitted from 'show keyspaces' output.
See https://issues.apache.org/jira/browse/CASSANDRA-4377 for details.

Keyspace: jw_schema1:
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Durable Writes: true
    Options: [replication_factor:3]
  Column Families:
    ColumnFamily: user_profiles
      Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
      Default column value validator:
org.apache.cassandra.db.marshal.BytesType
      Cells sorted by: org.apache.cassandra.db.marshal.UTF8Type
      GC grace seconds: 864000
      Compaction min/max thresholds: 4/32
      Read repair chance: 0.0
      DC Local Read repair chance: 0.1
      Caching: KEYS_ONLY
      Default time to live: 0
      Bloom Filter FP chance: 0.01
      Index interval: default
      Speculative Retry: 99.0PERCENTILE
      Built indexes: []
      Column Metadata:
        Column Name: first_name
          Validation Class: org.apache.cassandra.db.marshal.UTF8Type
        Column Name: year_of_birth
          Validation Class: org.apache.cassandra.db.marshal.Int32Type
        Column Name: last_name
          Validation Class: org.apache.cassandra.db.marshal.UTF8Type
      Compaction Strategy:
org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
      Compression Options:
        sstable_compression: org.apache.cassandra.io.compress.LZ4Compressor
Keyspace: system:
..
..
..
Keyspace: system_traces:
  Replication Strategy: org.apache.cassandra.locator.SimpleStrategy
  Durable Writes: true
    Options: [replication_factor:2]
  Column Families:
[default@unknown] use jw_schema1;
Authenticated to keyspace: jw_schema1
[default@jw_schema1] list user_profiles;
Using default limit of 100
Using default cell limit of 100

0 Row Returned.
Elapsed time: 728 msec(s).
[default@jw_schema1]

On Sat, Jan 17, 2015 at 6:41 AM, Tyler Hobbs <ty...@datastax.com> wrote:

> This might be https://issues.apache.org/jira/browse/CASSANDRA-8512 if
> your cluster has a schema disagreement.  You can apply the patch on that
> ticket with "patch -p1 < 8512-2.1.txt" from the top-level cassandra
> directory and see if it helps.
>
> On Fri, Jan 16, 2015 at 11:58 AM, Julien Anguenot <ju...@anguenot.org>
> wrote:
>
>> Hey Jason,
>>
>> Your RF=3, do you have 3 nodes up and running in this DC? We have seen
>> this issue with 2.1.x and cqlsh where schema changes would trigger the
>> "keyspace not found" error in cqlsh if not all nodes were up and
>> running when altering KS schema in a DC with NetworkTopologyStrategy
>> and RF=3. For us, bringing all the nodes up to meet RF would then fix
>> the problem.
>>
>> As well, you might want to restart the node and see if the "keyspace
>> not found" still occurs: same here, since 2.1.x we've had cases where
>> a restart was required for cqlsh and / or drivers to see the schema
>> changes.
>>
>>    J.
>>
>> On Fri, Jan 16, 2015 at 3:56 AM, Jason Wee <pe...@gmail.com> wrote:
>> > $ cqlsh 192.168.0.2 9042
>> > Connected to just4fun at 192.168.0.2:9042.
>> > [cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
>> > Use HELP for help.
>> > cqlsh> DESCRIBE KEYSPACES
>> >
>> > <empty>
>> >
>> > cqlsh> create keyspace foobar with replication =
>> {'class':'SimpleStrategy',
>> > 'replication_factor':3};
>> > errors={}, last_host=192.168.0.2
>> > cqlsh> DESCRIBE KEYSPACES;
>> >
>> > <empty>
>> >
>> > cqlsh> use foobar;
>> > cqlsh:foobar>  DESCRIBE TABLES;
>> >
>> > Keyspace 'foobar' not found.
>> >
>> >
>> > Just trying cassandra 2.1 and encounter the above erorr, can anyone
>> explain
>> > why is this and where to even begin troubleshooting?
>> >
>> > Jason
>>
>
>
>
> --
> Tyler Hobbs
> DataStax <http://datastax.com/>
>

Re: keyspace not exists?

Posted by Tyler Hobbs <ty...@datastax.com>.
This might be https://issues.apache.org/jira/browse/CASSANDRA-8512 if your
cluster has a schema disagreement.  You can apply the patch on that ticket
with "patch -p1 < 8512-2.1.txt" from the top-level cassandra directory and
see if it helps.

On Fri, Jan 16, 2015 at 11:58 AM, Julien Anguenot <ju...@anguenot.org>
wrote:

> Hey Jason,
>
> Your RF=3, do you have 3 nodes up and running in this DC? We have seen
> this issue with 2.1.x and cqlsh where schema changes would trigger the
> "keyspace not found" error in cqlsh if not all nodes were up and
> running when altering KS schema in a DC with NetworkTopologyStrategy
> and RF=3. For us, bringing all the nodes up to meet RF would then fix
> the problem.
>
> As well, you might want to restart the node and see if the "keyspace
> not found" still occurs: same here, since 2.1.x we've had cases where
> a restart was required for cqlsh and / or drivers to see the schema
> changes.
>
>    J.
>
> On Fri, Jan 16, 2015 at 3:56 AM, Jason Wee <pe...@gmail.com> wrote:
> > $ cqlsh 192.168.0.2 9042
> > Connected to just4fun at 192.168.0.2:9042.
> > [cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
> > Use HELP for help.
> > cqlsh> DESCRIBE KEYSPACES
> >
> > <empty>
> >
> > cqlsh> create keyspace foobar with replication =
> {'class':'SimpleStrategy',
> > 'replication_factor':3};
> > errors={}, last_host=192.168.0.2
> > cqlsh> DESCRIBE KEYSPACES;
> >
> > <empty>
> >
> > cqlsh> use foobar;
> > cqlsh:foobar>  DESCRIBE TABLES;
> >
> > Keyspace 'foobar' not found.
> >
> >
> > Just trying cassandra 2.1 and encounter the above erorr, can anyone
> explain
> > why is this and where to even begin troubleshooting?
> >
> > Jason
>



-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Re: keyspace not exists?

Posted by Julien Anguenot <ju...@anguenot.org>.
Hey Jason,

Your RF=3, do you have 3 nodes up and running in this DC? We have seen
this issue with 2.1.x and cqlsh where schema changes would trigger the
"keyspace not found" error in cqlsh if not all nodes were up and
running when altering KS schema in a DC with NetworkTopologyStrategy
and RF=3. For us, bringing all the nodes up to meet RF would then fix
the problem.

As well, you might want to restart the node and see if the "keyspace
not found" still occurs: same here, since 2.1.x we've had cases where
a restart was required for cqlsh and / or drivers to see the schema
changes.

   J.

On Fri, Jan 16, 2015 at 3:56 AM, Jason Wee <pe...@gmail.com> wrote:
> $ cqlsh 192.168.0.2 9042
> Connected to just4fun at 192.168.0.2:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
> Use HELP for help.
> cqlsh> DESCRIBE KEYSPACES
>
> <empty>
>
> cqlsh> create keyspace foobar with replication = {'class':'SimpleStrategy',
> 'replication_factor':3};
> errors={}, last_host=192.168.0.2
> cqlsh> DESCRIBE KEYSPACES;
>
> <empty>
>
> cqlsh> use foobar;
> cqlsh:foobar>  DESCRIBE TABLES;
>
> Keyspace 'foobar' not found.
>
>
> Just trying cassandra 2.1 and encounter the above erorr, can anyone explain
> why is this and where to even begin troubleshooting?
>
> Jason

Re: keyspace not exists?

Posted by Jens Rantil <je...@tink.se>.
Hi Jason,

Have you checked the Cassandra log?

Cheers,
Jens

On Fri, Jan 16, 2015 at 10:59 AM, Jason Wee <pe...@gmail.com> wrote:

> $ cqlsh 192.168.0.2 9042
> Connected to just4fun at 192.168.0.2:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.1 | CQL spec 3.2.0 | Native protocol v3]
> Use HELP for help.
> cqlsh> DESCRIBE KEYSPACES
> <empty>
> cqlsh> create keyspace foobar with replication = {'class':'SimpleStrategy',
> 'replication_factor':3};
> errors={}, last_host=192.168.0.2
> cqlsh> DESCRIBE KEYSPACES;
> <empty>
> cqlsh> use foobar;
> cqlsh:foobar>  DESCRIBE TABLES;
> Keyspace 'foobar' not found.
> Just trying cassandra 2.1 and encounter the above erorr, can anyone explain
> why is this and where to even begin troubleshooting?
> Jason