You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Damick, Jeffrey" <Je...@neustar.biz> on 2012/05/22 17:10:31 UTC
Correct way to set strategy options in cqlsh?
What's the correct way to set the strategy options for the networktopologystrategy with cqlsh?
I've tried several variations, but what's expected way to escape the hyphen in "us-east" ?
Thanks,
-jeff
CREATE KEYSPACE something
... WITH strategy_class = 'NetworkTopologyStrategy'
... AND strategy_options:us-east=1
... AND strategy_options:us-west=1;
Bad Request: line 3:25 mismatched input '-' expecting '='
Re: Correct way to set strategy options in cqlsh?
Posted by paul cannon <pa...@datastax.com>.
I agree, this is a bug. I opened
https://issues.apache.org/jira/browse/CASSANDRA-4278 to track it.
The workaround for now is to use the CLI or the thrift interface to create
your keyspace.
p
On Wed, May 23, 2012 at 8:29 AM, Damick, Jeffrey <Jeffrey.Damick@neustar.biz
> wrote:
> Since this is the EC2MultiRegionSnitch, how do you suggest I change
> name? It needs to match the datacenter name that is bound to aws region
> names, so it seems like this is a bug to me..
>
>
>
>
>
> On 5/23/12 2:33 AM, "Romain HARDOUIN" <ro...@urssaf.fr> wrote:
>
>
> You *must* remove the hyphen.
> According to the csql 2.0 documentation, here is the correct syntax to
> create keyspace:
>
> <createKeyspaceStatement> ::= "CREATE" "KEYSPACE" <name>
> "WITH" <optionName> "=" <optionVal>
> ( "AND" <optionName> "=" <optionVal> )*
> ;
> <optionName> ::= <identifier>
> | <optionName> ":" <identifier>
> | <optionName> ":" <integer>
> ;
> <optionVal> ::= <stringLiteral>
> | <identifier>
> | <integer>
> ;
>
> The string "strategy_options:us-west=1;" matches the following syntax:
>
> <optionName> ":" <identifier> = <integer>
>
> Thus, "us-west" is an *identifier*, and again according to the
> documentation:
> An <identifier> is a letter followed by any sequence of letters, digits,
> or the underscore (_).
>
>
Re: Correct way to set strategy options in cqlsh?
Posted by "Damick, Jeffrey" <Je...@neustar.biz>.
Since this is the EC2MultiRegionSnitch, how do you suggest I change name? It needs to match the datacenter name that is bound to aws region names, so it seems like this is a bug to me..
On 5/23/12 2:33 AM, "Romain HARDOUIN" <ro...@urssaf.fr> wrote:
You *must* remove the hyphen.
According to the csql 2.0 documentation, here is the correct syntax to create keyspace:
<createKeyspaceStatement> ::= "CREATE" "KEYSPACE" <name>
"WITH" <optionName> "=" <optionVal>
( "AND" <optionName> "=" <optionVal> )*
;
<optionName> ::= <identifier>
| <optionName> ":" <identifier>
| <optionName> ":" <integer>
;
<optionVal> ::= <stringLiteral>
| <identifier>
| <integer>
;
The string "strategy_options:us-west=1;" matches the following syntax:
<optionName> ":" <identifier> = <integer>
Thus, "us-west" is an *identifier*, and again according to the documentation:
An <identifier> is a letter followed by any sequence of letters, digits, or the underscore (_).
Re: Correct way to set strategy options in cqlsh?
Posted by Romain HARDOUIN <ro...@urssaf.fr>.
You *must* remove the hyphen.
According to the csql 2.0 documentation, here is the correct syntax to
create keyspace:
<createKeyspaceStatement> ::= "CREATE" "KEYSPACE" <name>
"WITH" <optionName> "=" <optionVal>
( "AND" <optionName> "=" <optionVal> )*
;
<optionName> ::= <identifier>
| <optionName> ":" <identifier>
| <optionName> ":" <integer>
;
<optionVal> ::= <stringLiteral>
| <identifier>
| <integer>
;
The string "strategy_options:us-west=1;" matches the following syntax:
<optionName> ":" <identifier> = <integer>
Thus, "us-west" is an *identifier*, and again according to the
documentation:
An <identifier> is a letter followed by any sequence of letters, digits,
or the underscore (_).
Re: Correct way to set strategy options in cqlsh?
Posted by Yiming Sun <yi...@gmail.com>.
would it be possible to change the data center names and remove the hyphen?
On Tue, May 22, 2012 at 4:43 PM, Damick, Jeffrey <Jeffrey.Damick@neustar.biz
> wrote:
> I tried various flavors of single and double quotes in different
> locations with no luck..
>
>
>
>
>
> On 5/22/12 11:44 AM, "Yiming Sun" <yi...@gmail.com> wrote:
>
> Sorry, I didn't read carefully enough. I don't use cqlsh. Have you tried
> to add single-quotes around your data center names? I found a post that
> asked how to escape single quotes, and the answer was not back-slash, but
> using another set of single quotes per SQL model, so it may work.
>
>
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-How-to-escape-single-quotes-td6647132.html
>
>
>
>
> On Tue, May 22, 2012 at 11:26 AM, Damick, Jeffrey <
> Jeffrey.Damick@neustar.biz> wrote:
>
> Thanks, but that would be for the cli, not cqlsh
>
> CREATE KEYSPACE something
> ... WITH strategy_class = 'NetworkTopologyStrategy'
> AND strategy_options={us-east:1};
> Invalid syntax at line 2, char 72
> WITH strategy_class = 'NetworkTopologyStrategy' AND
> strategy_options={us-east:1};
>
>
>
>
> On 5/22/12 11:18 AM, "Yiming Sun" <yiming.sun@gmail.com <
> http://yiming.sun@gmail.com> > wrote:
>
> AND strategy_options={us-east:1, us-west:1};
>
>
>
> On Tue, May 22, 2012 at 11:10 AM, Damick, Jeffrey <
> Jeffrey.Damick@neustar.biz <ht...@neustar.biz> > wrote:
>
> What’s the correct way to set the strategy options for the
> networktopologystrategy with cqlsh?
>
> I’ve tried several variations, but what’s expected way to escape the
> hyphen in “us-east” ?
>
> Thanks,
> -jeff
>
> CREATE KEYSPACE something
> ... WITH strategy_class = 'NetworkTopologyStrategy'
> ... AND strategy_options:us-east=1
> ... AND strategy_options:us-west=1;
> Bad Request: line 3:25 mismatched input '-' expecting '='
>
>
>
>
>
>
>
>
Re: Correct way to set strategy options in cqlsh?
Posted by "Damick, Jeffrey" <Je...@neustar.biz>.
I tried various flavors of single and double quotes in different locations with no luck..
On 5/22/12 11:44 AM, "Yiming Sun" <yi...@gmail.com> wrote:
Sorry, I didn't read carefully enough. I don't use cqlsh. Have you tried to add single-quotes around your data center names? I found a post that asked how to escape single quotes, and the answer was not back-slash, but using another set of single quotes per SQL model, so it may work.
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-How-to-escape-single-quotes-td6647132.html
On Tue, May 22, 2012 at 11:26 AM, Damick, Jeffrey <Je...@neustar.biz> wrote:
Thanks, but that would be for the cli, not cqlsh
CREATE KEYSPACE something
... WITH strategy_class = 'NetworkTopologyStrategy' AND strategy_options={us-east:1};
Invalid syntax at line 2, char 72
WITH strategy_class = 'NetworkTopologyStrategy' AND strategy_options={us-east:1};
On 5/22/12 11:18 AM, "Yiming Sun" <yiming.sun@gmail.com <ht...@gmail.com> > wrote:
AND strategy_options={us-east:1, us-west:1};
On Tue, May 22, 2012 at 11:10 AM, Damick, Jeffrey <Jeffrey.Damick@neustar.biz <ht...@neustar.biz> > wrote:
What's the correct way to set the strategy options for the networktopologystrategy with cqlsh?
I've tried several variations, but what's expected way to escape the hyphen in "us-east" ?
Thanks,
-jeff
CREATE KEYSPACE something
... WITH strategy_class = 'NetworkTopologyStrategy'
... AND strategy_options:us-east=1
... AND strategy_options:us-west=1;
Bad Request: line 3:25 mismatched input '-' expecting '='
Re: Correct way to set strategy options in cqlsh?
Posted by Yiming Sun <yi...@gmail.com>.
Sorry, I didn't read carefully enough. I don't use cqlsh. Have you tried
to add single-quotes around your data center names? I found a post that
asked how to escape single quotes, and the answer was not back-slash, but
using another set of single quotes per SQL model, so it may work.
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-How-to-escape-single-quotes-td6647132.html
On Tue, May 22, 2012 at 11:26 AM, Damick, Jeffrey <
Jeffrey.Damick@neustar.biz> wrote:
> Thanks, but that would be for the cli, not cqlsh
>
> CREATE KEYSPACE something
> ... WITH strategy_class = 'NetworkTopologyStrategy'
> AND strategy_options={us-east:1};
> Invalid syntax at line 2, char 72
> WITH strategy_class = 'NetworkTopologyStrategy' AND
> strategy_options={us-east:1};
>
>
>
>
> On 5/22/12 11:18 AM, "Yiming Sun" <yi...@gmail.com> wrote:
>
> AND strategy_options={us-east:1, us-west:1};
>
>
>
> On Tue, May 22, 2012 at 11:10 AM, Damick, Jeffrey <
> Jeffrey.Damick@neustar.biz> wrote:
>
> What’s the correct way to set the strategy options for the
> networktopologystrategy with cqlsh?
>
> I’ve tried several variations, but what’s expected way to escape the
> hyphen in “us-east” ?
>
> Thanks,
> -jeff
>
> CREATE KEYSPACE something
> ... WITH strategy_class = 'NetworkTopologyStrategy'
> ... AND strategy_options:us-east=1
> ... AND strategy_options:us-west=1;
> Bad Request: line 3:25 mismatched input '-' expecting '='
>
>
>
>
>
>
Re: Correct way to set strategy options in cqlsh?
Posted by "Damick, Jeffrey" <Je...@neustar.biz>.
Thanks, but that would be for the cli, not cqlsh
CREATE KEYSPACE something
... WITH strategy_class = 'NetworkTopologyStrategy' AND strategy_options={us-east:1};
Invalid syntax at line 2, char 72
WITH strategy_class = 'NetworkTopologyStrategy' AND strategy_options={us-east:1};
On 5/22/12 11:18 AM, "Yiming Sun" <yi...@gmail.com> wrote:
AND strategy_options={us-east:1, us-west:1};
On Tue, May 22, 2012 at 11:10 AM, Damick, Jeffrey <Je...@neustar.biz> wrote:
What's the correct way to set the strategy options for the networktopologystrategy with cqlsh?
I've tried several variations, but what's expected way to escape the hyphen in "us-east" ?
Thanks,
-jeff
CREATE KEYSPACE something
... WITH strategy_class = 'NetworkTopologyStrategy'
... AND strategy_options:us-east=1
... AND strategy_options:us-west=1;
Bad Request: line 3:25 mismatched input '-' expecting '='
Re: Correct way to set strategy options in cqlsh?
Posted by Yiming Sun <yi...@gmail.com>.
AND strategy_options={us-east:1, us-west:1};
On Tue, May 22, 2012 at 11:10 AM, Damick, Jeffrey <
Jeffrey.Damick@neustar.biz> wrote:
> What’s the correct way to set the strategy options for the
> networktopologystrategy with cqlsh?
>
> I’ve tried several variations, but what’s expected way to escape the
> hyphen in “us-east” ?
>
> Thanks,
> -jeff
>
> CREATE KEYSPACE something
> ... WITH strategy_class = 'NetworkTopologyStrategy'
> ... AND strategy_options:us-east=1
> ... AND strategy_options:us-west=1;
> Bad Request: line 3:25 mismatched input '-' expecting '='
>
>
>
>