Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EA62E101E9 for ; Mon, 19 Jan 2015 05:59:37 +0000 (UTC) Received: (qmail 90697 invoked by uid 500); 19 Jan 2015 05:59:37 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 90661 invoked by uid 500); 19 Jan 2015 05:59:37 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 90651 invoked by uid 99); 19 Jan 2015 05:59:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2015 05:59:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peichieh@gmail.com designates 209.85.213.182 as permitted sender) Received: from [209.85.213.182] (HELO mail-ig0-f182.google.com) (209.85.213.182) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jan 2015 05:59:33 +0000 Received: by mail-ig0-f182.google.com with SMTP id z20so2300360igj.3 for ; Sun, 18 Jan 2015 21:59:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MrYBwplk+Jy9xTNVcqUt14952gWjrn05c3pVcBa7F+Y=; b=F2xX9mB2oWN6lNX/oSjRTziss3VkuDSC+hwHtxFK25UFwGORlxlClzQgJKqyRreXit tnjk8nmCfGLlXrMJYACNvwuDEbRgFnvEBa23TGtyACUnvyDl2h8RZAlKNOVsQJ1ozeHz JQoyC7MwufBrEGT45AON4Ofky4O+hijb97yXtbayrHKJR07tu9cd50NG5XCt50tyLyS9 fCPCYUjeBgkPl7YhVOljZ4MLmACUUrDuEvdfeIxLN26/QZ/yrlsWjHSQ2DFSDDFzALqJ McLD+dgeH61N/i/50eGMeGQM8CHBW2ZOLkqBzxMSsChTMrHcxQ6yVU+IebWCo6uC/Cl7 DwQw== MIME-Version: 1.0 X-Received: by 10.50.171.201 with SMTP id aw9mr17516662igc.2.1421647152280; Sun, 18 Jan 2015 21:59:12 -0800 (PST) Received: by 10.64.171.17 with HTTP; Sun, 18 Jan 2015 21:59:11 -0800 (PST) In-Reply-To: References: Date: Mon, 19 Jan 2015 13:59:11 +0800 Message-ID: Subject: Re: keyspace not exists? From: Jason Wee To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e0111d42481fb0d050cfb050f X-Virus-Checked: Checked by ClamAV on apache.org --089e0111d42481fb0d050cfb050f Content-Type: text/plain; charset=UTF-8 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 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 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 >> 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 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 >>> > >>> > >>> > >>> > cqlsh> create keyspace foobar with replication = >>> {'class':'SimpleStrategy', >>> > 'replication_factor':3}; >>> > errors={}, last_host=192.168.0.2 >>> > cqlsh> DESCRIBE KEYSPACES; >>> > >>> > >>> > >>> > 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 >> > > --089e0111d42481fb0d050cfb050f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

Immediately after a repair, I execu= te cqlsh, still the schema mismatch?

[2015-01= -19 13:50:49,979] Repair session 19c67350-9f9f-11e4-8b56-a322c40b8b81 for r= ange (-725731847063341791,-718486959589605925] finished
[2015-01-= 19 13:50:49,980] Repair session 1a612cb0-9f9f-11e4-8b56-a322c40b8b81 for ra= nge (-5366440687164990017,-5357952536457207248] finished
[2015-01= -19 13:50:49,980] Repair session 1afcd070-9f9f-11e4-8b56-a322c40b8b81 for r= ange (-2871651679602006497,-2860883420245139806] finished
[2015-0= 1-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 r= ange (8830377476646048271,8848086816619852308] finished
[2015-01-= 19 13:50:49,981] Repair session 1cd1de90-9f9f-11e4-8b56-a322c40b8b81 for ra= nge (4538653889569069241,4549572313549299652] finished
[2015-01-1= 9 13:50:49,985] Repair session 1d6ebad0-9f9f-11e4-8b56-a322c40b8b81 for ran= ge (6052068628404624993,6058413940102734921] finished
[2015-01-19= 13:50:49,986] Repair command #1 finished
jason@localhost:~$ cqls= h 192.168.0.2 9042
Warning: schema version mismatch detected; che= ck 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 | N= ative protocol v3]
Use HELP for help.
cqlsh>=C2=A0
cqlsh> desc keyspaces;

system_traces = =C2=A0jw_schema1 =C2=A0system

cqlsh> use jw_sch= ema1;
cqlsh:jw_schema1> desc tables;

= user_profiles

cqlsh:system> =C2=A0select host_i= d,schema_version from system.peers;

=C2=A0host_id = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| schema_version
-----------------= ---------------------+--------------------------------------
=C2= =A0d21e3d11-5bfb-4888-97cd-62af90e83f56 | b5291c1d-6635-3627-928f-f5a0f0c27= ec1
=C2=A0d21e3d11-5bfb-4888-97cd-62af90e83f56 | c7a2ebda-89f7-36= f0-a735-a0dffc400124
=C2=A069bd2306-c919-411b-83f3-341b4f7f54b4 |= f6f3835e-ed12-34f4-9f4b-f2a72bb57c30
=C2=A0e1444216-4412-45d5-97= 03-a463ee50aec2 | f6f3835e-ed12-34f4-9f4b-f2a72bb57c30

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

=C2=A0host_id =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| schema_version
--------------------------------------= +--------------------------------------
=C2=A0d21e3d11-5bfb-4888-= 97cd-62af90e83f56 | f6f3835e-ed12-34f4-9f4b-f2a72bb57c30

(1 rows)

=
On Mon, Jan 19, 2015 at 12:55 PM, Jason Wee = <peichieh@gmail.com> wrote:
log does not show anything fishy, because it is just fo= r 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 cass= andra 2.1.1

I look a look at the issue given by Ty= ler link, and patch my cqlsh and given more information below and thank you= it works. Actually doing this tutorial from this blog=C2=A0http://www.d= atastax.com/dev/blog/thrift-to-cql3

$ cqlsh 192.168.0.2 904= 2
Warning: schema version mismatch detected; check the schema ver= sions 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> =C2=A0DESCRIBE KEYSPACES;

syst= em_traces =C2=A0jw_schema1 =C2=A0system

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

<= /div>
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 ve= rsion 2.1.1

The CLI is deprecated and will be remo= ved in Cassandra 3.0.=C2=A0 Consider migrating to cqlsh.
CQL is f= ully backwards compatible with Thrift data; see http://www.datastax.com/= dev/blog/thrift-to-cql3

Type 'help;' o= r '?' for help.
Type 'quit;' or 'exit;' t= o quit.

[default@unknown] show keyspaces;

WARNING: CQL3 tables are intentionally omitted from 's= how keyspaces' output.

Keyspa= ce: jw_schema1:
=C2=A0 Replication Strategy: org.apache.cassandra= .locator.SimpleStrategy
=C2=A0 Durable Writes: true
=C2= =A0 =C2=A0 Options: [replication_factor:3]
=C2=A0 Column Families= :
=C2=A0 =C2=A0 ColumnFamily: user_profiles
=C2=A0 =C2= =A0 =C2=A0 Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
=C2=A0 =C2=A0 =C2=A0 Default column value validator: org.apache.ca= ssandra.db.marshal.BytesType
=C2=A0 =C2=A0 =C2=A0 Cells sorted by= : org.apache.cassandra.db.marshal.UTF8Type
=C2=A0 =C2=A0 =C2=A0 G= C grace seconds: 864000
=C2=A0 =C2=A0 =C2=A0 Compaction min/max t= hresholds: 4/32
=C2=A0 =C2=A0 =C2=A0 Read repair chance: 0.0
=C2=A0 =C2=A0 =C2=A0 DC Local Read repair chance: 0.1
=C2= =A0 =C2=A0 =C2=A0 Caching: KEYS_ONLY
=C2=A0 =C2=A0 =C2=A0 Default= time to live: 0
=C2=A0 =C2=A0 =C2=A0 Bloom Filter FP chance: 0.0= 1
=C2=A0 =C2=A0 =C2=A0 Index interval: default
=C2=A0 = =C2=A0 =C2=A0 Speculative Retry: 99.0PERCENTILE
=C2=A0 =C2=A0 =C2= =A0 Built indexes: []
=C2=A0 =C2=A0 =C2=A0 Column Metadata:
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Column Name: first_name
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 Validation Class: org.apache.cassandra.db.marsh= al.UTF8Type
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Column Name: year_of_birt= h
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Validation Class: org.apache= .cassandra.db.marshal.Int32Type
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Colum= n Name: last_name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Validation C= lass: org.apache.cassandra.db.marshal.UTF8Type
=C2=A0 =C2=A0 =C2= =A0 Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompa= ctionStrategy
=C2=A0 =C2=A0 =C2=A0 Compression Options:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 sstable_compression: org.apache.cassandra.io.c= ompress.LZ4Compressor
Keyspace: system:
..
..=
..
Keyspace: system_traces:
=C2=A0 Replicati= on Strategy: org.apache.cassandra.locator.SimpleStrategy
=C2=A0 D= urable Writes: true
=C2=A0 =C2=A0 Options: [replication_factor:2]=
=C2=A0 Column Families:
[default@unknown] use jw_schem= a1;
Authenticated to keyspace: jw_schema1
[default@jw_s= chema1] 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]=C2=A0

On Sat, Jan 17, 2015 at 6:41 AM, Tyler= Hobbs <tyler@datastax.com> wrote:
This might be https://issues.apache.= org/jira/browse/CASSANDRA-8512 if your cluster has a schema disagreemen= t.=C2=A0 You can apply the patch on that ticket with "patch -p1 < 8= 512-2.1.txt" from the top-level cassandra directory and see if it help= s.

On Fri, Jan 16, 2015 at 11:58 AM, Julien Anguenot &l= t;julien@anguenot.= org> wrote:
Hey Jason,

Your RF=3D3, 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<= br> running when altering KS schema in a DC with NetworkTopologyStrategy
and RF=3D3. 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 wh= ere
a restart was required for cqlsh and / or drivers to see the schema
changes.

=C2=A0 =C2=A0J.

On Fri, Jan 16, 2015 at 3:56 AM, Jason Wee <peichieh@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]<= br> > Use HELP for help.
> cqlsh> DESCRIBE KEYSPACES
>
> <empty>
>
> cqlsh> create keyspace foobar with replication =3D {'class'= :'SimpleStrategy',
> 'replication_factor':3};
> errors=3D{}, last_host=3D192.168.0.2
> cqlsh> DESCRIBE KEYSPACES;
>
> <empty>
>
> cqlsh> use foobar;
> cqlsh:foobar>=C2=A0 DESCRIBE TABLES;
>
> Keyspace 'foobar' not found.
>
>
> Just trying cassandra 2.1 and encounter the above erorr, can anyone ex= plain
> why is this and where to even begin troubleshooting?
>
> Jason



= --
Tyler Hobbs
DataStax
<= /div>


--089e0111d42481fb0d050cfb050f--