Re: Re: ask for help about exmples of Data Types the document shows
Jeff and Jon, thanks for your outstanding work, and expect for the two update. ^^ zha...@easemob.com From: Jeff Jirsa Date: 2016-09-28 13:01 To: user@cassandra.apache.org Subject: Re: ask for help about exmples of Data Types the document shows Jon Haddad opened a ticket (presumably based off this email) - https://issues.apache.org/jira/browse/CASSANDRA-12718 Will get it corrected shortly. From: "zha...@easemob.com" Reply-To: "user@cassandra.apache.org" Date: Tuesday, September 27, 2016 at 9:57 PM To: user Subject: Re: Re: ask for help about exmples of Data Types the document shows hi, Ben, you are right, I copy the statement from document but not check it carefully. It's very helpful and thank a lot ! By the way, is there any way to report to the document author and update the document? I think it may be confused for a green hand just like me. zha...@easemob.com From: Ben Slater Date: 2016-09-28 12:50 To: user Subject: Re: Re: ask for help about exmples of Data Types the document shows My best guess it that you need to remove the quotes from around the zip values (ie change if to zip: 20500 rather than zip: ‘20500’ ) as zip is defined as an int. Cheers Ben On Wed, 28 Sep 2016 at 14:38 zha...@easemob.com wrote: Hi, Ben Slater, thank you very much for your replay! my cassandra version is 3.7, so I think there must be some thing I misunderstand ahout frozen type. I add a comma between } and ‘work’, the result is like below. Is there some special form about " type frozen"? cqlsh:counterks> INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', {'home' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'cell' : { country_code: 1, number: '202 456-' },'landline' : { country_code: 1, number: '...' } }},'work' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'fax' : { country_code: 1, number: '...' } }}}); InvalidRequest: code=2200 [Invalid query] message="Invalid map literal for addresses: value {city: 'Washington', zip: '20500', street: '1600 Pennsylvania Ave NW', phones: {'cell': {number: '202 456-', country_code: 1}, 'landline': {number: '...', country_code: 1}}} is not of type frozen" my create statements about table and type are: cqlsh:counterks> CREATE TYPE phone ( country_code int, number text, ); cqlsh:counterks> CREATE TYPE address ( street text, city text, zip int, phones map> ); cqlsh:counterks> CREATE TABLE user ( ... name text PRIMARY KEY, ... addresses map> ... ); zha...@easemob.com From: Ben Slater Date: 2016-09-28 11:29 To: user Subject: Re: ask for help about exmples of Data Types the document shows Hi, I think you are right about the typo in (1). For (2), I think you’re missing a comma between } and ‘work’ so the JSON is invalid. I think reading this JIRA https://issues.apache.org/jira/browse/CASSANDRA-7423 that the change requiring a UDT as part of a collection to be explicitly marked as frozen is relatively recent (3.6) so the doco may be out date there. Cheers Ben On Wed, 28 Sep 2016 at 13:12 zha...@easemob.com wrote: hi, everyone, I'm learning Cassandra now , and have some problems about the document of "Data Types" . I don't know where to report or ask for help, so I'm very sorry if this mail bother you. In the chapter The Cassandra Query Language (CQL)/Data Types (http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused with two examples the document showing below. My enviroment is: CentOS release 6.8 (Final) java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Python 2.7.11 Cassandra version: 3.7 CQL version: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing type set, the giving example is: CREATE TABLE images (name text PRIMARY KEY,owner text,tags set // A set of text values);INSERT INTO images (name, owner, tags) VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' });// Replace the existing set entirelyUPDATE images SET tags = { 'kitten', 'cat', 'lol' } WHERE id = 'jsmith'; the update cql statement uses "WHERE id = 'jsmith'" while the table images did not define key "id". I think it's just a slip of the pen. 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing “User-Defined Types”, the giving example is: CREATE TYPE phone ( country_code int,number text,)CREATE TYPE address (street text, city text,zip int,phones map)CREATE TABLE user (name text PRIMARY KEY,addresses map>) and when I try to create type address, one error occur: cqlsh:counterks> CREATE TYPE address ( ... street text, ... city text, ... zip int,
Re: ask for help about exmples of Data Types the document shows
Jon Haddad opened a ticket (presumably based off this email) - https://issues.apache.org/jira/browse/CASSANDRA-12718 Will get it corrected shortly. From: "zha...@easemob.com" Reply-To: "user@cassandra.apache.org" Date: Tuesday, September 27, 2016 at 9:57 PM To: user Subject: Re: Re: ask for help about exmples of Data Types the document shows hi, Ben, you are right, I copy the statement from document but not check it carefully. It's very helpful and thank a lot ! By the way, is there any way to report to the document author and update the document? I think it may be confused for a green hand just like me. zha...@easemob.com From: Ben Slater Date: 2016-09-28 12:50 To: user Subject: Re: Re: ask for help about exmples of Data Types the document shows My best guess it that you need to remove the quotes from around the zip values (ie change if to zip: 20500 rather than zip: ‘20500’ ) as zip is defined as an int. Cheers Ben On Wed, 28 Sep 2016 at 14:38 zha...@easemob.com wrote: Hi, Ben Slater, thank you very much for your replay! my cassandra version is 3.7, so I think there must be some thing I misunderstand ahout frozen type. I add a comma between } and ‘work’, the result is like below. Is there some special form about " type frozen"? cqlsh:counterks> INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', {'home' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'cell' : { country_code: 1, number: '202 456-' },'landline' : { country_code: 1, number: '...' } }},'work' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'fax' : { country_code: 1, number: '...' } }}}); InvalidRequest: code=2200 [Invalid query] message="Invalid map literal for addresses: value {city: 'Washington', zip: '20500', street: '1600 Pennsylvania Ave NW', phones: {'cell': {number: '202 456-', country_code: 1}, 'landline': {number: '...', country_code: 1}}} is not of type frozen" my create statements about table and type are: cqlsh:counterks> CREATE TYPE phone ( country_code int, number text, ); cqlsh:counterks> CREATE TYPE address ( street text, city text, zip int, phones map> ); cqlsh:counterks> CREATE TABLE user ( ... name text PRIMARY KEY, ... addresses map> ... ); zha...@easemob.com From: Ben Slater Date: 2016-09-28 11:29 To: user Subject: Re: ask for help about exmples of Data Types the document shows Hi, I think you are right about the typo in (1). For (2), I think you’re missing a comma between } and ‘work’ so the JSON is invalid. I think reading this JIRA https://issues.apache.org/jira/browse/CASSANDRA-7423 that the change requiring a UDT as part of a collection to be explicitly marked as frozen is relatively recent (3.6) so the doco may be out date there. Cheers Ben On Wed, 28 Sep 2016 at 13:12 zha...@easemob.com wrote: hi, everyone, I'm learning Cassandra now , and have some problems about the document of "Data Types" . I don't know where to report or ask for help, so I'm very sorry if this mail bother you. In the chapter The Cassandra Query Language (CQL)/Data Types (http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused with two examples the document showing below. My enviroment is: CentOS release 6.8 (Final) java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Python 2.7.11 Cassandra version: 3.7 CQL version: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing type set, the giving example is: CREATE TABLE images ( name text PRIMARY KEY, owner text, tags set // A set of text values ); INSERT INTO images (name, owner, tags) VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' }); // Replace the existing set entirely UPDATE images SET tags = { 'kitten', 'cat', 'lol' } WHERE id = 'jsmith'; the update cql statement uses "WHERE id = 'jsmith'" while the table images did not define key "id". I think it's just a slip of the pen. 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing “User-Defined Types”, the giving example is: CREATE TYPE phone ( country_code int, number text, ) CREATE TYPE address ( street text, city text, zip int, phones map ) CREATE TABLE user ( name text PRIMARY KEY, addresses map> ) and when I try to create type address, one error occur: cqlsh:counterks> CREATE TYPE address ( ... street text, ... city text, ... zip int, ... phones map ... ); InvalidRequest: code=2200 [Invalid query] message="Non-frozen UDTs are not allowed inside collections: map" I chan
Re: Re: ask for help about exmples of Data Types the document shows
hi, Ben, you are right, I copy the statement from document but not check it carefully. It's very helpful and thank a lot ! By the way, is there any way to report to the document author and update the document? I think it may be confused for a green hand just like me. zha...@easemob.com From: Ben Slater Date: 2016-09-28 12:50 To: user Subject: Re: Re: ask for help about exmples of Data Types the document shows My best guess it that you need to remove the quotes from around the zip values (ie change if to zip: 20500 rather than zip: ‘20500’ ) as zip is defined as an int. Cheers Ben On Wed, 28 Sep 2016 at 14:38 zha...@easemob.com wrote: Hi, Ben Slater, thank you very much for your replay! my cassandra version is 3.7, so I think there must be some thing I misunderstand ahout frozen type. I add a comma between } and ‘work’, the result is like below. Is there some special form about " type frozen"? cqlsh:counterks> INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', {'home' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'cell' : { country_code: 1, number: '202 456-' },'landline' : { country_code: 1, number: '...' } }},'work' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'fax' : { country_code: 1, number: '...' } }}}); InvalidRequest: code=2200 [Invalid query] message="Invalid map literal for addresses: value {city: 'Washington', zip: '20500', street: '1600 Pennsylvania Ave NW', phones: {'cell': {number: '202 456-', country_code: 1}, 'landline': {number: '...', country_code: 1}}} is not of type frozen" my create statements about table and type are: cqlsh:counterks> CREATE TYPE phone ( country_code int, number text, ); cqlsh:counterks> CREATE TYPE address ( street text, city text, zip int, phones map> ); cqlsh:counterks> CREATE TABLE user ( ... name text PRIMARY KEY, ... addresses map> ... ); zha...@easemob.com From: Ben Slater Date: 2016-09-28 11:29 To: user Subject: Re: ask for help about exmples of Data Types the document shows Hi, I think you are right about the typo in (1). For (2), I think you’re missing a comma between } and ‘work’ so the JSON is invalid. I think reading this JIRA https://issues.apache.org/jira/browse/CASSANDRA-7423 that the change requiring a UDT as part of a collection to be explicitly marked as frozen is relatively recent (3.6) so the doco may be out date there. Cheers Ben On Wed, 28 Sep 2016 at 13:12 zha...@easemob.com wrote: hi, everyone, I'm learning Cassandra now , and have some problems about the document of "Data Types" . I don't know where to report or ask for help, so I'm very sorry if this mail bother you. In the chapter The Cassandra Query Language (CQL)/Data Types (http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused with two examples the document showing below. My enviroment is: CentOS release 6.8 (Final) java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Python 2.7.11 Cassandra version: 3.7 CQL version: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing type set, the giving example is: CREATE TABLE images ( name text PRIMARY KEY, owner text, tags set // A set of text values ); INSERT INTO images (name, owner, tags) VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' }); // Replace the existing set entirely UPDATE images SET tags = { 'kitten', 'cat', 'lol' } WHERE id = 'jsmith'; the update cql statement uses "WHERE id = 'jsmith'" while the table images did not define key "id". I think it's just a slip of the pen. 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing “User-Defined Types”, the giving example is: CREATE TYPE phone ( country_code int, number text, ) CREATE TYPE address ( street text, city text, zip int, phones map ) CREATE TABLE user ( name text PRIMARY KEY, addresses map> ) and when I try to create type address, one error occur: cqlsh:counterks> CREATE TYPE address ( ... street text, ... city text, ... zip int, ... phones map ... ); InvalidRequest: code=2200 [Invalid query] message="Non-frozen UDTs are not allowed inside collections: map" I change the create statement, like: CREATE TYPE address ( street text, city text, zip int, phones map> ); it works, and the create table user statement works well. Unfortunately, when running the insert statement below, error occur: INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', { 'home' : { street: '1600 Pennsylvania Ave NW', city: 'Washington', zip:
Re: Re: ask for help about exmples of Data Types the document shows
My best guess it that you need to remove the quotes from around the zip values (ie change if to zip: 20500 rather than zip: ‘20500’ ) as zip is defined as an int. Cheers Ben On Wed, 28 Sep 2016 at 14:38 zha...@easemob.com wrote: > Hi, Ben Slater, thank you very much for your replay! > > my cassandra version is 3.7, so I think there must be some thing I > misunderstand ahout frozen type. I add a comma between } and ‘work’, the > result is like below. Is there some special form about " type frozen"? > > > cqlsh:counterks> INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', > {'home' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: > '20500',phones: { 'cell' : { country_code: 1, number: '202 456-' > },'landline' : { country_code: 1, number: '...' } }},'work' : {street: '1600 > Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'fax' : { > country_code: 1, number: '...' } }}}); > > InvalidRequest: code=2200 [Invalid query] message="Invalid map literal for > addresses: value {city: 'Washington', zip: '20500', street: '1600 > Pennsylvania Ave NW', phones: {'cell': {number: '202 456-', country_code: > 1}, 'landline': {number: '...', country_code: 1}}} is not of type > frozen" > > > my create statements about table and type are: > > > cqlsh:counterks> CREATE TYPE phone ( country_code int, number text, ); > > cqlsh:counterks> CREATE TYPE address ( street text, city text, > zip int, phones map> ); > cqlsh:counterks> CREATE TABLE user ( > ... name text PRIMARY KEY, > ... addresses map> > ... ); > > > > -- > zha...@easemob.com > > > *From:* Ben Slater > *Date:* 2016-09-28 11:29 > *To:* user > *Subject:* Re: ask for help about exmples of Data Types the document shows > > Hi, > > I think you are right about the typo in (1). For (2), I think you’re > missing a comma between } and ‘work’ so the JSON is invalid. > > I think reading this JIRA > https://issues.apache.org/jira/browse/CASSANDRA-7423 that the change > requiring a UDT as part of a collection to be explicitly marked as frozen > is relatively recent (3.6) so the doco may be out date there. > > Cheers > Ben > > On Wed, 28 Sep 2016 at 13:12 zha...@easemob.com > wrote: > >> hi, everyone, I'm learning Cassandra now , and have some problems about >> the document of "Data Types" . I don't know where to report or ask for >> help, so I'm very sorry if this mail bother you. >> >> In the chapter The Cassandra Query Language (CQL)/Data Types ( >> http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused >> with two examples the document showing below. My enviroment is: >> >> CentOS release 6.8 (Final) >> >> java version "1.8.0_91" >> Java(TM) SE Runtime Environment (build 1.8.0_91-b14) >> Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) >> >> Python 2.7.11 >> >> Cassandra version: 3.7 >> CQL version: >> [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] >> >> >> 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when >> describing type set, the giving example is: >> >> CREATE TABLE images ( >> name text PRIMARY KEY, >> owner text, >> tags set // A set of text values);INSERT INTO images (name, owner, >> tags) >> VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' });// Replace the >> existing set entirelyUPDATE images SET tags = { 'kitten', 'cat', 'lol' } >> WHERE id = 'jsmith'; >> >> the update cql statement uses "WHERE id = 'jsmith'" while the table >> images did not define key "id". I think it's just a slip of the pen. >> >> 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when >> describing “User-Defined Types”, the giving example is: >> CREATE TYPE phone ( >> >> country_code int, >> number text,)CREATE TYPE address ( >> street text, >> city text, >> zip int, >> phones map)CREATE TABLE user ( >> name text PRIMARY KEY, >> addresses map>) >> >> and when I try to create type address, one error occur: >> >> cqlsh:counterks> CREATE TYPE address ( >> ... street text, >> ... city text, >> ... zip int, >> ... phones map >> ... ); >> >> InvalidRequest: code=2200 [Invalid query] message="Non-frozen UDTs are not >> allowed inside collections: map" >> >> I change the create statement, like: >> >> CREATE TYPE address ( >> street text, >> city text, >> zip int, >> phones map> >> ); >> >> it works, and the create table user statement works well. Unfortunately, >> when running the insert statement below, error occur: >> >> INSERT INTO user (name, addresses) >> VALUES ('z3 Pr3z1den7', { >> 'home' : { >> street: '1600 Pennsylvania Ave NW', >> city: 'Washington', >> zip: '20500', >> phones: { 'cell' : { country_code: 1, n
Re: Re: ask for help about exmples of Data Types the document shows
Hi, Ben Slater, thank you very much for your replay! my cassandra version is 3.7, so I think there must be some thing I misunderstand ahout frozen type. I add a comma between } and ‘work’, the result is like below. Is there some special form about " type frozen"? cqlsh:counterks> INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', {'home' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'cell' : { country_code: 1, number: '202 456-' },'landline' : { country_code: 1, number: '...' } }},'work' : {street: '1600 Pennsylvania Ave NW',city: 'Washington',zip: '20500',phones: { 'fax' : { country_code: 1, number: '...' } }}}); InvalidRequest: code=2200 [Invalid query] message="Invalid map literal for addresses: value {city: 'Washington', zip: '20500', street: '1600 Pennsylvania Ave NW', phones: {'cell': {number: '202 456-', country_code: 1}, 'landline': {number: '...', country_code: 1}}} is not of type frozen" my create statements about table and type are: cqlsh:counterks> CREATE TYPE phone ( country_code int, number text, ); cqlsh:counterks> CREATE TYPE address ( street text, city text, zip int, phones map> ); cqlsh:counterks> CREATE TABLE user ( ... name text PRIMARY KEY, ... addresses map> ... ); zha...@easemob.com From: Ben Slater Date: 2016-09-28 11:29 To: user Subject: Re: ask for help about exmples of Data Types the document shows Hi, I think you are right about the typo in (1). For (2), I think you’re missing a comma between } and ‘work’ so the JSON is invalid. I think reading this JIRA https://issues.apache.org/jira/browse/CASSANDRA-7423 that the change requiring a UDT as part of a collection to be explicitly marked as frozen is relatively recent (3.6) so the doco may be out date there. Cheers Ben On Wed, 28 Sep 2016 at 13:12 zha...@easemob.com wrote: hi, everyone, I'm learning Cassandra now , and have some problems about the document of "Data Types" . I don't know where to report or ask for help, so I'm very sorry if this mail bother you. In the chapter The Cassandra Query Language (CQL)/Data Types (http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused with two examples the document showing below. My enviroment is: CentOS release 6.8 (Final) java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Python 2.7.11 Cassandra version: 3.7 CQL version: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing type set, the giving example is: CREATE TABLE images ( name text PRIMARY KEY, owner text, tags set // A set of text values ); INSERT INTO images (name, owner, tags) VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' }); // Replace the existing set entirely UPDATE images SET tags = { 'kitten', 'cat', 'lol' } WHERE id = 'jsmith'; the update cql statement uses "WHERE id = 'jsmith'" while the table images did not define key "id". I think it's just a slip of the pen. 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing “User-Defined Types”, the giving example is: CREATE TYPE phone ( country_code int, number text, ) CREATE TYPE address ( street text, city text, zip int, phones map ) CREATE TABLE user ( name text PRIMARY KEY, addresses map> ) and when I try to create type address, one error occur: cqlsh:counterks> CREATE TYPE address ( ... street text, ... city text, ... zip int, ... phones map ... ); InvalidRequest: code=2200 [Invalid query] message="Non-frozen UDTs are not allowed inside collections: map" I change the create statement, like: CREATE TYPE address ( street text, city text, zip int, phones map> ); it works, and the create table user statement works well. Unfortunately, when running the insert statement below, error occur: INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', { 'home' : { street: '1600 Pennsylvania Ave NW', city: 'Washington', zip: '20500', phones: { 'cell' : { country_code: 1, number: '202 456-' }, 'landline' : { country_code: 1, number: '...' } } } 'work' : { street: '1600 Pennsylvania Ave NW', city: 'Washington', zip: '20500', phones: { 'fax' : { country_code: 1, number: '...' } } } }) error: SyntaxException: Is the any suggestion about the problem 2? Best wishes for everyone, thank you for your watching ! zha...@easemob.com -- Ben Slater Chief Product Officer Instaclustr: Cassandra +
Re: ask for help about exmples of Data Types the document shows
Hi, I think you are right about the typo in (1). For (2), I think you’re missing a comma between } and ‘work’ so the JSON is invalid. I think reading this JIRA https://issues.apache.org/jira/browse/CASSANDRA-7423 that the change requiring a UDT as part of a collection to be explicitly marked as frozen is relatively recent (3.6) so the doco may be out date there. Cheers Ben On Wed, 28 Sep 2016 at 13:12 zha...@easemob.com wrote: > hi, everyone, I'm learning Cassandra now , and have some problems about > the document of "Data Types" . I don't know where to report or ask for > help, so I'm very sorry if this mail bother you. > > In the chapter The Cassandra Query Language (CQL)/Data Types ( > http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused with > two examples the document showing below. My enviroment is: > > CentOS release 6.8 (Final) > > java version "1.8.0_91" > Java(TM) SE Runtime Environment (build 1.8.0_91-b14) > Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) > > Python 2.7.11 > > Cassandra version: 3.7 > CQL version: > [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] > > > 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when > describing type set, the giving example is: > > CREATE TABLE images ( > name text PRIMARY KEY, > owner text, > tags set // A set of text values);INSERT INTO images (name, owner, > tags) > VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' });// Replace the > existing set entirelyUPDATE images SET tags = { 'kitten', 'cat', 'lol' } > WHERE id = 'jsmith'; > > the update cql statement uses "WHERE id = 'jsmith'" while the table > images did not define key "id". I think it's just a slip of the pen. > > 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when > describing “User-Defined Types”, the giving example is: > CREATE TYPE phone ( > > country_code int, > number text,)CREATE TYPE address ( > street text, > city text, > zip int, > phones map)CREATE TABLE user ( > name text PRIMARY KEY, > addresses map>) > > and when I try to create type address, one error occur: > > cqlsh:counterks> CREATE TYPE address ( > ... street text, > ... city text, > ... zip int, > ... phones map > ... ); > > InvalidRequest: code=2200 [Invalid query] message="Non-frozen UDTs are not > allowed inside collections: map" > > I change the create statement, like: > > CREATE TYPE address ( > street text, > city text, > zip int, > phones map> > ); > > it works, and the create table user statement works well. Unfortunately, > when running the insert statement below, error occur: > > INSERT INTO user (name, addresses) > VALUES ('z3 Pr3z1den7', { > 'home' : { > street: '1600 Pennsylvania Ave NW', > city: 'Washington', > zip: '20500', > phones: { 'cell' : { country_code: 1, number: '202 > 456-' }, > 'landline' : { country_code: 1, number: '...' } } > } > 'work' : { > street: '1600 Pennsylvania Ave NW', > city: 'Washington', > zip: '20500', > phones: { 'fax' : { country_code: 1, number: '...' } } > } > }) > > error: > > SyntaxException: message="line 10:14 mismatched input 'work' expecting '}' (...: '...' } } > } ['wor]k' :...)"> > > Is the any suggestion about the problem 2? > > Best wishes for everyone, thank you for your watching ! > > -- > zha...@easemob.com > -- Ben Slater Chief Product Officer Instaclustr: Cassandra + Spark - Managed | Consulting | Support +61 437 929 798
ask for help about exmples of Data Types the document shows
hi, everyone, I'm learning Cassandra now , and have some problems about the document of "Data Types" . I don't know where to report or ask for help, so I'm very sorry if this mail bother you. In the chapter The Cassandra Query Language (CQL)/Data Types (http://cassandra.apache.org/doc/latest/cql/types.html), I'm confused with two examples the document showing below. My enviroment is: CentOS release 6.8 (Final) java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Python 2.7.11 Cassandra version: 3.7 CQL version: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native protocol v4] 1、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing type set, the giving example is: CREATE TABLE images ( name text PRIMARY KEY, owner text, tags set // A set of text values ); INSERT INTO images (name, owner, tags) VALUES ('cat.jpg', 'jsmith', { 'pet', 'cute' }); // Replace the existing set entirely UPDATE images SET tags = { 'kitten', 'cat', 'lol' } WHERE id = 'jsmith'; the update cql statement uses "WHERE id = 'jsmith'" while the table images did not define key "id". I think it's just a slip of the pen. 2、 in http://cassandra.apache.org/doc/latest/cql/types.html, when describing “User-Defined Types”, the giving example is: CREATE TYPE phone ( country_code int, number text, ) CREATE TYPE address ( street text, city text, zip int, phones map ) CREATE TABLE user ( name text PRIMARY KEY, addresses map> ) and when I try to create type address, one error occur: cqlsh:counterks> CREATE TYPE address ( ... street text, ... city text, ... zip int, ... phones map ... ); InvalidRequest: code=2200 [Invalid query] message="Non-frozen UDTs are not allowed inside collections: map" I change the create statement, like: CREATE TYPE address ( street text, city text, zip int, phones map> ); it works, and the create table user statement works well. Unfortunately, when running the insert statement below, error occur: INSERT INTO user (name, addresses) VALUES ('z3 Pr3z1den7', { 'home' : { street: '1600 Pennsylvania Ave NW', city: 'Washington', zip: '20500', phones: { 'cell' : { country_code: 1, number: '202 456-' }, 'landline' : { country_code: 1, number: '...' } } } 'work' : { street: '1600 Pennsylvania Ave NW', city: 'Washington', zip: '20500', phones: { 'fax' : { country_code: 1, number: '...' } } } }) error: SyntaxException: Is the any suggestion about the problem 2? Best wishes for everyone, thank you for your watching ! zha...@easemob.com
Re: New node block in autobootstrap
Ok... Thanks for the reply... I'm going to retry nodetool rebuild with following changes as you said net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_probes=3 net.ipv4.tcp_keepalive_intvl=10 Hope this changes would be enough on the new node where I'm running 'nodetool rebuild' and hope NOT required on all existing nodes from which data is going to get streamed..Am I right? On Sep 28, 2016 1:04 AM, "Paulo Motta" wrote: > Yeah this is likely to be caused by idle connections being shut down, so > you may need to update your tcp_keepalive* and/or network/firewall settings. > > 2016-09-27 15:29 GMT-03:00 laxmikanth sadula : > >> Hi paul, >> >> Thanks for the reply... >> >> I'm getting following streaming exceptions during nodetool rebuild in >> c*-2.0.17 >> >> *04:24:49,759 StreamSession.java (line 461) [Stream >> #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* >> *java.io.IOException: Connection timed out* >> *at sun.nio.ch.FileDispatcherImpl.write0(Native Method)* >> *at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)* >> *at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)* >> *at sun.nio.ch.IOUtil.write(IOUtil.java:65)* >> *at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)* >> *at >> org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44)* >> *at >> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339)* >> *at >> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:311)* >> *at java.lang.Thread.run(Thread.java:745)* >> *DEBUG [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 >> ConnectionHandler.java (line 104) [Stream >> #5e1b7f40-8496-11e6-8847-1b88665e430d] Closing stream connection handler on >> /xxx.xxx.98.168* >> * INFO [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 >> StreamResultFuture.java (line 186) [Stream >> #5e1b7f40-8496-11e6-8847-1b88665e430d] Session with /xxx.xxx.98.168 is >> complete* >> *ERROR [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 >> StreamSession.java (line 461) [Stream >> #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* >> *java.io.IOException: Broken pipe* >> *at sun.nio.ch.FileDispatcherImpl.write0(Native Method)* >> *at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)* >> *at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)* >> *at sun.nio.ch.IOUtil.write(IOUtil.java:65)* >> *at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)* >> *at >> org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44)* >> *at >> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339)* >> *at >> org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:319)* >> *at java.lang.Thread.run(Thread.java:745)* >> *DEBUG [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,909 >> ConnectionHandler.java (line 244) [Stream >> #5e1b7f40-8496-11e6-8847-1b88665e430d] Received File (Header (cfId: >> 68af9ee0-96f8-3b1d-a418-e5ae844f2cc2, #3, version: jb, estimated keys: >> 4736, transfer size: 2306880, compressed?: true), file: >> /home/cassandra/data_directories/data/keyspace_name1/archiving_metadata/keyspace_name1-archiving_metadata-tmp-jb-27-Data.db)* >> *ERROR [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,909 >> StreamSession.java (line 461) [Stream >> #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* >> *java.lang.RuntimeException: Outgoing stream handler has been closed* >> *at >> org.apache.cassandra.streaming.ConnectionHandler.sendMessage(ConnectionHandler.java:126)* >> *at >> org.apache.cassandra.streaming.StreamSession.receive(StreamSession.java:524)* >> *at >> org.apache.cassandra.streaming.StreamSession.messageReceived(StreamSession.java:413)* >> *at >> org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:245)* >> *at java.lang.Thread.run(Thread.java:745)* >> >> On Sep 27, 2016 11:48 PM, "Paulo Motta" wrote: >> >>> What type of streaming timeout are you getting? Do you have a stack >>> trace? What version are you in? >>> >>> See more information about tuning tcp_keepalive* here: >>> https://docs.datastax.com/en/cassandra/2.0/cassandra/trouble >>> shooting/trblshootIdleFirewall.html >>> >>> 2016-09-27 14:07 GMT-03:00 laxmikanth sadula : >>> @Paulo Motta Even we are facing Streaming timeout exceptions during 'nodetool rebuild' , I set streaming_socket_timeout_in_ms to 8640 (24 hours) as suggested in datastax blog - https://support.datastax.com/h c/en-us/articles/206502913-FAQ-How-to-reduce-the-impact-of-s treaming-errors-or-failures , but still we are getting streaming exceptions. And what is the suggestible settings/value
Re: New node block in autobootstrap
Yeah this is likely to be caused by idle connections being shut down, so you may need to update your tcp_keepalive* and/or network/firewall settings. 2016-09-27 15:29 GMT-03:00 laxmikanth sadula : > Hi paul, > > Thanks for the reply... > > I'm getting following streaming exceptions during nodetool rebuild in > c*-2.0.17 > > *04:24:49,759 StreamSession.java (line 461) [Stream > #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* > *java.io.IOException: Connection timed out* > *at sun.nio.ch.FileDispatcherImpl.write0(Native Method)* > *at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)* > *at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)* > *at sun.nio.ch.IOUtil.write(IOUtil.java:65)* > *at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)* > *at > org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44)* > *at > org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339)* > *at > org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:311)* > *at java.lang.Thread.run(Thread.java:745)* > *DEBUG [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 > ConnectionHandler.java (line 104) [Stream > #5e1b7f40-8496-11e6-8847-1b88665e430d] Closing stream connection handler on > /xxx.xxx.98.168* > * INFO [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 > StreamResultFuture.java (line 186) [Stream > #5e1b7f40-8496-11e6-8847-1b88665e430d] Session with /xxx.xxx.98.168 is > complete* > *ERROR [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 > StreamSession.java (line 461) [Stream > #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* > *java.io.IOException: Broken pipe* > *at sun.nio.ch.FileDispatcherImpl.write0(Native Method)* > *at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)* > *at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)* > *at sun.nio.ch.IOUtil.write(IOUtil.java:65)* > *at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)* > *at > org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44)* > *at > org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339)* > *at > org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:319)* > *at java.lang.Thread.run(Thread.java:745)* > *DEBUG [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,909 > ConnectionHandler.java (line 244) [Stream > #5e1b7f40-8496-11e6-8847-1b88665e430d] Received File (Header (cfId: > 68af9ee0-96f8-3b1d-a418-e5ae844f2cc2, #3, version: jb, estimated keys: > 4736, transfer size: 2306880, compressed?: true), file: > /home/cassandra/data_directories/data/keyspace_name1/archiving_metadata/keyspace_name1-archiving_metadata-tmp-jb-27-Data.db)* > *ERROR [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,909 > StreamSession.java (line 461) [Stream > #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* > *java.lang.RuntimeException: Outgoing stream handler has been closed* > *at > org.apache.cassandra.streaming.ConnectionHandler.sendMessage(ConnectionHandler.java:126)* > *at > org.apache.cassandra.streaming.StreamSession.receive(StreamSession.java:524)* > *at > org.apache.cassandra.streaming.StreamSession.messageReceived(StreamSession.java:413)* > *at > org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:245)* > *at java.lang.Thread.run(Thread.java:745)* > > On Sep 27, 2016 11:48 PM, "Paulo Motta" wrote: > >> What type of streaming timeout are you getting? Do you have a stack >> trace? What version are you in? >> >> See more information about tuning tcp_keepalive* here: >> https://docs.datastax.com/en/cassandra/2.0/cassandra/trouble >> shooting/trblshootIdleFirewall.html >> >> 2016-09-27 14:07 GMT-03:00 laxmikanth sadula : >> >>> @Paulo Motta >>> >>> Even we are facing Streaming timeout exceptions during 'nodetool >>> rebuild' , I set streaming_socket_timeout_in_ms to 8640 (24 hours) as >>> suggested in datastax blog - https://support.datastax.com/h >>> c/en-us/articles/206502913-FAQ-How-to-reduce-the-impact-of-s >>> treaming-errors-or-failures , but still we are getting streaming >>> exceptions. >>> >>> And what is the suggestible settings/values for kernel tcp_keepalive >>> which would help streaming succeed ? >>> >>> Thank you >>> >>> On Tue, Aug 16, 2016 at 12:21 AM, Paulo Motta >>> wrote: >>> What version are you in? This seems like a typical case were there was a problem with streaming (hanging, etc), do you have access to the logs? Maybe look for streaming errors? Typically streaming errors are related to timeouts, so you should review your cassandra streaming_socket_timeout_in_ms and kernel tcp_keepalive settings. If yo
Re: New node block in autobootstrap
Hi paul, Thanks for the reply... I'm getting following streaming exceptions during nodetool rebuild in c*-2.0.17 *04:24:49,759 StreamSession.java (line 461) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* *java.io.IOException: Connection timed out* *at sun.nio.ch.FileDispatcherImpl.write0(Native Method)* *at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)* *at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)* *at sun.nio.ch.IOUtil.write(IOUtil.java:65)* *at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)* *at org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44)* *at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339)* *at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:311)* *at java.lang.Thread.run(Thread.java:745)* *DEBUG [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 ConnectionHandler.java (line 104) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Closing stream connection handler on /xxx.xxx.98.168* * INFO [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 StreamResultFuture.java (line 186) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Session with /xxx.xxx.98.168 is complete* *ERROR [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 StreamSession.java (line 461) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* *java.io.IOException: Broken pipe* *at sun.nio.ch.FileDispatcherImpl.write0(Native Method)* *at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)* *at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)* *at sun.nio.ch.IOUtil.write(IOUtil.java:65)* *at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)* *at org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44)* *at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339)* *at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:319)* *at java.lang.Thread.run(Thread.java:745)* *DEBUG [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,909 ConnectionHandler.java (line 244) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Received File (Header (cfId: 68af9ee0-96f8-3b1d-a418-e5ae844f2cc2, #3, version: jb, estimated keys: 4736, transfer size: 2306880, compressed?: true), file: /home/cassandra/data_directories/data/keyspace_name1/archiving_metadata/keyspace_name1-archiving_metadata-tmp-jb-27-Data.db)* *ERROR [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,909 StreamSession.java (line 461) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurred* *java.lang.RuntimeException: Outgoing stream handler has been closed* *at org.apache.cassandra.streaming.ConnectionHandler.sendMessage(ConnectionHandler.java:126)* *at org.apache.cassandra.streaming.StreamSession.receive(StreamSession.java:524)* *at org.apache.cassandra.streaming.StreamSession.messageReceived(StreamSession.java:413)* *at org.apache.cassandra.streaming.ConnectionHandler$IncomingMessageHandler.run(ConnectionHandler.java:245)* *at java.lang.Thread.run(Thread.java:745)* On Sep 27, 2016 11:48 PM, "Paulo Motta" wrote: > What type of streaming timeout are you getting? Do you have a stack trace? > What version are you in? > > See more information about tuning tcp_keepalive* here: > https://docs.datastax.com/en/cassandra/2.0/cassandra/troubleshooting/ > trblshootIdleFirewall.html > > 2016-09-27 14:07 GMT-03:00 laxmikanth sadula : > >> @Paulo Motta >> >> Even we are facing Streaming timeout exceptions during 'nodetool rebuild' >> , I set streaming_socket_timeout_in_ms to 8640 (24 hours) as suggested >> in datastax blog - https://support.datastax.com/h >> c/en-us/articles/206502913-FAQ-How-to-reduce-the-impact-of-s >> treaming-errors-or-failures , but still we are getting streaming >> exceptions. >> >> And what is the suggestible settings/values for kernel tcp_keepalive >> which would help streaming succeed ? >> >> Thank you >> >> On Tue, Aug 16, 2016 at 12:21 AM, Paulo Motta >> wrote: >> >>> What version are you in? This seems like a typical case were there was a >>> problem with streaming (hanging, etc), do you have access to the logs? >>> Maybe look for streaming errors? Typically streaming errors are related to >>> timeouts, so you should review your cassandra >>> streaming_socket_timeout_in_ms and kernel tcp_keepalive settings. >>> >>> If you're on 2.2+ you can resume a failed bootstrap with nodetool >>> bootstrap resume. There were also some streaming hanging problems fixed >>> recently, so I'd advise you to upgrade to the latest version of your >>> particular series for a more robust version. >>> >>> Is there any reason why you didn't use the replace procedure >>> (-Dreplace_address) to replace
Re: New node block in autobootstrap
What type of streaming timeout are you getting? Do you have a stack trace? What version are you in? See more information about tuning tcp_keepalive* here: https://docs.datastax.com/en/cassandra/2.0/cassandra/troubleshooting/trblshootIdleFirewall.html 2016-09-27 14:07 GMT-03:00 laxmikanth sadula : > @Paulo Motta > > Even we are facing Streaming timeout exceptions during 'nodetool rebuild' > , I set streaming_socket_timeout_in_ms to 8640 (24 hours) as suggested > in datastax blog - https://support.datastax.com/h > c/en-us/articles/206502913-FAQ-How-to-reduce-the-impact-of- > streaming-errors-or-failures , but still we are getting streaming > exceptions. > > And what is the suggestible settings/values for kernel tcp_keepalive which > would help streaming succeed ? > > Thank you > > On Tue, Aug 16, 2016 at 12:21 AM, Paulo Motta > wrote: > >> What version are you in? This seems like a typical case were there was a >> problem with streaming (hanging, etc), do you have access to the logs? >> Maybe look for streaming errors? Typically streaming errors are related to >> timeouts, so you should review your cassandra >> streaming_socket_timeout_in_ms and kernel tcp_keepalive settings. >> >> If you're on 2.2+ you can resume a failed bootstrap with nodetool >> bootstrap resume. There were also some streaming hanging problems fixed >> recently, so I'd advise you to upgrade to the latest version of your >> particular series for a more robust version. >> >> Is there any reason why you didn't use the replace procedure >> (-Dreplace_address) to replace the node with the same tokens? This would be >> a bit faster than remove + bootstrap procedure. >> >> 2016-08-15 15:37 GMT-03:00 Jérôme Mainaud : >> >>> Hello, >>> >>> A client of mime have problems when adding a node in the cluster. >>> After 4 days, the node is still in joining mode, it doesn't have the >>> same level of load than the other and there seems to be no streaming from >>> and to the new node. >>> >>> This node has a history. >>> >>>1. At the begin, it was in a seed in the cluster. >>>2. Ops detected that client had problems with it. >>>3. They tried to reset it but failed. In their process they launched >>>several repair and rebuild process on the node. >>>4. Then they asked me to help them. >>>5. We stopped the node, >>>6. removed it from the list of seeds (more precisely it was replaced >>>by another node), >>>7. removed it from the cluster (I choose not to use decommission >>>since node data was compromised) >>>8. deleted all files from data, commitlog and savedcache >>>directories. >>>9. after the leaving process ended, it was started as a fresh new >>>node and began autobootstrap. >>> >>> >>> As I don’t have direct access to the cluster I don't have a lot of >>> information, but I will have tomorrow (logs and results of some commands). >>> And I can ask for people any required information. >>> >>> Does someone have any idea of what could have happened and what I should >>> investigate first ? >>> What would you do to unlock the situation ? >>> >>> Context: The cluster consists of two DC, each with 15 nodes. Average >>> load is around 3 TB per node. The joining node froze a little after 2 TB. >>> >>> Thank you for your help. >>> Cheers, >>> >>> >>> -- >>> Jérôme Mainaud >>> jer...@mainaud.com >>> >> >> > > > -- > Regards, > Laxmikanth > 99621 38051 > >
Re: New node block in autobootstrap
@Paulo Motta Even we are facing Streaming timeout exceptions during 'nodetool rebuild' , I set streaming_socket_timeout_in_ms to 8640 (24 hours) as suggested in datastax blog - https://support.datastax.com/hc/en-us/articles/206502913- FAQ-How-to-reduce-the-impact-of-streaming-errors-or-failures , but still we are getting streaming exceptions. And what is the suggestible settings/values for kernel tcp_keepalive which would help streaming succeed ? Thank you On Tue, Aug 16, 2016 at 12:21 AM, Paulo Motta wrote: > What version are you in? This seems like a typical case were there was a > problem with streaming (hanging, etc), do you have access to the logs? > Maybe look for streaming errors? Typically streaming errors are related to > timeouts, so you should review your cassandra > streaming_socket_timeout_in_ms and kernel tcp_keepalive settings. > > If you're on 2.2+ you can resume a failed bootstrap with nodetool > bootstrap resume. There were also some streaming hanging problems fixed > recently, so I'd advise you to upgrade to the latest version of your > particular series for a more robust version. > > Is there any reason why you didn't use the replace procedure > (-Dreplace_address) to replace the node with the same tokens? This would be > a bit faster than remove + bootstrap procedure. > > 2016-08-15 15:37 GMT-03:00 Jérôme Mainaud : > >> Hello, >> >> A client of mime have problems when adding a node in the cluster. >> After 4 days, the node is still in joining mode, it doesn't have the same >> level of load than the other and there seems to be no streaming from and to >> the new node. >> >> This node has a history. >> >>1. At the begin, it was in a seed in the cluster. >>2. Ops detected that client had problems with it. >>3. They tried to reset it but failed. In their process they launched >>several repair and rebuild process on the node. >>4. Then they asked me to help them. >>5. We stopped the node, >>6. removed it from the list of seeds (more precisely it was replaced >>by another node), >>7. removed it from the cluster (I choose not to use decommission >>since node data was compromised) >>8. deleted all files from data, commitlog and savedcache directories. >>9. after the leaving process ended, it was started as a fresh new >>node and began autobootstrap. >> >> >> As I don’t have direct access to the cluster I don't have a lot of >> information, but I will have tomorrow (logs and results of some commands). >> And I can ask for people any required information. >> >> Does someone have any idea of what could have happened and what I should >> investigate first ? >> What would you do to unlock the situation ? >> >> Context: The cluster consists of two DC, each with 15 nodes. Average load >> is around 3 TB per node. The joining node froze a little after 2 TB. >> >> Thank you for your help. >> Cheers, >> >> >> -- >> Jérôme Mainaud >> jer...@mainaud.com >> > > -- Regards, Laxmikanth 99621 38051
nodetool rebuild streaming exception
Hi, I'm trying to add new data center - DC3 to existing c*-2.0.17 cluster with 2 data centers DC1, DC2 with replication DC1:3 , DC2:3 , DC3:3. I'm getting following exception repeatedly on new nodes after I run 'nodetool rebuild'. *DEBUG [ScheduledTasks:1] 2016-09-27 04:24:00,416 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9837479688 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:03,417 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9871193904 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:06,418 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9950298136 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:09,419 GCInspector.java (line 118) GC for ParNew: 19 ms for 1 collections, 9941119568 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:12,421 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9864185024 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:15,422 GCInspector.java (line 118) GC for ParNew: 60 ms for 2 collections, 9730374352 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:18,423 GCInspector.java (line 118) GC for ParNew: 18 ms for 1 collections, 9775448168 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:21,424 GCInspector.java (line 118) GC for ParNew: 22 ms for 1 collections, 9850794272 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:24,425 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9729992448 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:27,426 GCInspector.java (line 118) GC for ParNew: 22 ms for 1 collections, 9699783920 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:30,427 GCInspector.java (line 118) GC for ParNew: 21 ms for 1 collections, 9696523920 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:33,429 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9560497904 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:36,430 GCInspector.java (line 118) GC for ParNew: 19 ms for 1 collections, 9568718352 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:39,431 GCInspector.java (line 118) GC for ParNew: 22 ms for 1 collections, 9496991384 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:42,432 GCInspector.java (line 118) GC for ParNew: 19 ms for 1 collections, 9486433840 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:45,434 GCInspector.java (line 118) GC for ParNew: 19 ms for 1 collections, 9442642688 used; max is 16760438784DEBUG [ScheduledTasks:1] 2016-09-27 04:24:48,435 GCInspector.java (line 118) GC for ParNew: 20 ms for 1 collections, 9548532008 used; max is 16760438784DEBUG [STREAM-IN-/xxx.xxx.98.168] 2016-09-27 04:24:49,756 ConnectionHandler.java (line 244) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Received File (Header (cfId: bf446a90-71c5-3552-a2e5-b1b94dbf86e3, #0, version: jb, estimated keys: 252928, transfer size: 5496759656, compressed?: true), file: /home/cassandra/data_directories/data/keyspace_name1/columnfamily_1/keyspace_name1-columnfamily_1-tmp-jb-54-Data.db)DEBUG [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,757 ConnectionHandler.java (line 310) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Sending Received (bf446a90-71c5-3552-a2e5-b1b94dbf86e3, #0)ERROR [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,759 StreamSession.java (line 461) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurredjava.io.IOException: Connection timed outat sun.nio.ch.FileDispatcherImpl.write0(Native Method)at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)at sun.nio.ch.IOUtil.write(IOUtil.java:65)at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)at org.apache.cassandra.streaming.messages.StreamMessage.serialize(StreamMessage.java:44) at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.sendMessage(ConnectionHandler.java:339) at org.apache.cassandra.streaming.ConnectionHandler$OutgoingMessageHandler.run(ConnectionHandler.java:311) at java.lang.Thread.run(Thread.java:745)DEBUG [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 ConnectionHandler.java (line 104) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Closing stream connection handler on /xxx.xxx.98.168 INFO [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 StreamResultFuture.java (line 186) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Session with /xxx.xxx.98.168 is completeERROR [STREAM-OUT-/xxx.xxx.98.168] 2016-09-27 04:24:49,764 StreamSession.java (line 461) [Stream #5e1b7f40-8496-11e6-8847-1b88665e430d] Streaming error occurredjava.io.IOException: Broken pipeat sun.nio.ch.FileDispatcherImpl.write0(Native Method)at sun.nio.ch.SocketDispatch
Re: Repairing without -pr shows unexpected out-of-sync ranges
Didn't know about (2), and I actually have a time drift between the nodes. Thanks a lot Paulo! Regards, Stefano On Thu, Sep 22, 2016 at 6:36 PM, Paulo Motta wrote: > There are a couple of things that could be happening here: > - There will be time differences between when nodes participating repair > flush, so in write-heavy tables there will always be minor differences > during validation, and those could be accentuated by low resolution merkle > trees, which will affect mostly larger tables. > - SSTables compacted during incremental repair will not be marked as > repaired, so nodes with different compaction cadences will have different > data in their unrepaired set, what will cause mismatches in the subsequent > incremental repairs. CASSANDRA-9143 will hopefully fix that limitation. > > 2016-09-22 7:10 GMT-03:00 Stefano Ortolani : > >> Hi, >> >> I am seeing something weird while running repairs. >> I am testing 3.0.9 so I am running the repairs manually, node after node, >> on a cluster with RF=3. I am using a standard repair command (incremental, >> parallel, full range), and I just noticed that the third node detected some >> ranges out of sync with one of the nodes that just finished repairing. >> >> Since there was no dropped mutation, that sounds weird to me considering >> that the repairs are supposed to operate on the whole range. >> >> Any idea why? >> Maybe I am missing something? >> >> Cheers, >> Stefano >> >> >
Re: crash with OOM
That is a very large heap size for C* - most installations I’ve seen are running in the 8-12MB heap range. Apparently G1GC is better for larger heaps so that may help. However, you are probably better off digging a bit deeper into what is using all that heap? Massive IN clause lists? Massive multi-partition batches? Massive partitions? Especially given it hit two nodes simultaneously I would be looking for rogue query as my first point of investigation. Cheers Ben On Tue, 27 Sep 2016 at 17:49 xutom wrote: > > Hi, all > I have a C* cluster with 12 nodes. My cassandra version is 2.1.14; Just > now two nodes crashed and client fails to export data with read consistency > QUORUM. The following are logs of failed nodes: > > ERROR [SharedPool-Worker-159] 2016-09-26 20:51:14,124 Message.java:538 - > Unexpected exception during request; channel = [id: 0xce43a388, / > 13.13.13.80:55536 :> /13.13.13.149:9042] > java.lang.AssertionError: null > at > org.apache.cassandra.transport.ServerConnection.applyStateTransition(ServerConnection.java:100) > ~[apache-cassandra-2.1.14.jar:2.1.14] > at > org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:442) > [apache-cassandra-2.1.14.jar:2.1.14] > at > org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:335) > [apache-cassandra-2.1.14.jar:2.1.14] > at > io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) > [netty-all-4.0.23.Final.jar:4.0.23.Final] > at > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) > [netty-all-4.0.23.Final.jar:4.0.23.Final] > at > io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32) > [netty-all-4.0.23.Final.jar:4.0.23.Final] > at > io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324) > [netty-all-4.0.23.Final.jar:4.0.23.Final] > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > [na:1.7.0_65] > at > org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164) > [apache-cassandra-2.1.14.jar:2.1.14] > at > org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) > [apache-cassandra-2.1.14.jar:2.1.14] > at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65] > ERROR [SharedPool-Worker-116] 2016-09-26 20:51:14,125 > JVMStabilityInspector.java:117 - JVM state determined to be unstable. > Exiting forcefully due to: > java.lang.OutOfMemoryError: Java heap space > ERROR [SharedPool-Worker-121] 2016-09-26 20:51:14,125 > JVMStabilityInspector.java:117 - JVM state determined to be unstable. > Exiting forcefully due to: > java.lang.OutOfMemoryError: Java heap space > ERROR [SharedPool-Worker-157] 2016-09-26 20:51:14,124 Message.java:538 - > Unexpected exception during request; channel = [id: 0xce43a388, / > 13.13.13.80:55536 :> /13.13.13.149:9042] > > My server has total 256G memory so I set the MAX_HEAP_SIZE 60G, the config > in cassandra-env.sh: > MAX_HEAP_SIZE="60G" > HEAP_NEWSIZE="20G" > How to solve such OOM? > > > > > -- Ben Slater Chief Product Officer Instaclustr: Cassandra + Spark - Managed | Consulting | Support +61 437 929 798
crash with OOM
Hi, all I have a C* cluster with 12 nodes. My cassandra version is 2.1.14; Just now two nodes crashed and client fails to export data with read consistency QUORUM. The following are logs of failed nodes: ERROR [SharedPool-Worker-159] 2016-09-26 20:51:14,124 Message.java:538 - Unexpected exception during request; channel = [id: 0xce43a388, /13.13.13.80:55536 :> /13.13.13.149:9042] java.lang.AssertionError: null at org.apache.cassandra.transport.ServerConnection.applyStateTransition(ServerConnection.java:100) ~[apache-cassandra-2.1.14.jar:2.1.14] at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:442) [apache-cassandra-2.1.14.jar:2.1.14] at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:335) [apache-cassandra-2.1.14.jar:2.1.14] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32) [netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324) [netty-all-4.0.23.Final.jar:4.0.23.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65] at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164) [apache-cassandra-2.1.14.jar:2.1.14] at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [apache-cassandra-2.1.14.jar:2.1.14] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65] ERROR [SharedPool-Worker-116] 2016-09-26 20:51:14,125 JVMStabilityInspector.java:117 - JVM state determined to be unstable. Exiting forcefully due to: java.lang.OutOfMemoryError: Java heap space ERROR [SharedPool-Worker-121] 2016-09-26 20:51:14,125 JVMStabilityInspector.java:117 - JVM state determined to be unstable. Exiting forcefully due to: java.lang.OutOfMemoryError: Java heap space ERROR [SharedPool-Worker-157] 2016-09-26 20:51:14,124 Message.java:538 - Unexpected exception during request; channel = [id: 0xce43a388, /13.13.13.80:55536 :> /13.13.13.149:9042] My server has total 256G memory so I set the MAX_HEAP_SIZE 60G, the config in cassandra-env.sh: MAX_HEAP_SIZE="60G" HEAP_NEWSIZE="20G" How to solve such OOM?