You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Paul van Hoven <pa...@googlemail.com> on 2013/01/22 12:04:53 UTC

Creating a keyspace fails

I just started with cassandra. Currently I'm reading the following
tutorial about cal:
http://www.datastax.com/docs/1.1/dml/using_cql#use-cql

But I already fail when trying to create a keyspace:


$ ./cqlsh --cql3
Connected to Test Cluster at localhost:9160.
[cqlsh 2.3.0 | Cassandra 1.2.0 | CQL spec 3.0.0 | Thrift protocol 19.35.0]
Use HELP for help.
cqlsh> CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
AND strategy_options:replication_factor='1';
Bad Request: line 1:82 mismatched input ':' expecting '='
Perhaps you meant to use CQL 2? Try using the -2 option when starting cqlsh.


What is wrong?

Re: Creating a keyspace fails

Posted by Paul van Hoven <pa...@googlemail.com>.
Alright. Thanks for you quick help. :)

2013/1/22 Jason Wee <pe...@gmail.com>:
> maybe typo or forget to update the doc... but anyway, you can use the help
> command when you are in cqlsh.. for example:
>
> cqlsh> HELP CREATE_KEYSPACE;
>
>         CREATE KEYSPACE <ksname>
>             WITH replication = {'class':'<strategy>' [,'<option>':<val>]};
>
>
>
> On Tue, Jan 22, 2013 at 8:06 PM, Paul van Hoven
> <pa...@googlemail.com> wrote:
>>
>> Okay, that worked. Why is the statement from the tutorial wrong. I
>> mean, why would a company like datastax post somthing like this?
>>
>> 2013/1/22 Jason Wee <pe...@gmail.com>:
>> > cqlsh> CREATE KEYSPACE demodb WITH replication = {'class':
>> > 'SimpleStrategy',
>> > 'replication_factor': 3};
>> > cqlsh> use demodb;
>> > cqlsh:demodb>
>> >
>> >
>> > On Tue, Jan 22, 2013 at 7:04 PM, Paul van Hoven
>> > <pa...@googlemail.com> wrote:
>> >>
>> >> CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
>> >> AND strategy_options:replication_factor='1';
>> >
>> >
>> >
>
>

Re: Creating a keyspace fails

Posted by Jason Wee <pe...@gmail.com>.
maybe typo or forget to update the doc... but anyway, you can use the help
command when you are in cqlsh.. for example:

cqlsh> HELP CREATE_KEYSPACE;

        CREATE KEYSPACE <ksname>
            WITH replication = {'class':'<strategy>' [,'<option>':<val>]};



On Tue, Jan 22, 2013 at 8:06 PM, Paul van Hoven <
paul.van.hoven@googlemail.com> wrote:

> Okay, that worked. Why is the statement from the tutorial wrong. I
> mean, why would a company like datastax post somthing like this?
>
> 2013/1/22 Jason Wee <pe...@gmail.com>:
> > cqlsh> CREATE KEYSPACE demodb WITH replication = {'class':
> 'SimpleStrategy',
> > 'replication_factor': 3};
> > cqlsh> use demodb;
> > cqlsh:demodb>
> >
> >
> > On Tue, Jan 22, 2013 at 7:04 PM, Paul van Hoven
> > <pa...@googlemail.com> wrote:
> >>
> >> CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
> >> AND strategy_options:replication_factor='1';
> >
> >
> >
>

Re: Creating a keyspace fails

Posted by Tyler Hobbs <ty...@datastax.com>.
I sent a note to our docs team to add a warning/note to the docs there
about the difference between the syntax in 1.1 and 1.2.

Thanks!


On Tue, Jan 22, 2013 at 10:49 AM, Colin Blower <cb...@barracuda.com>wrote:

>  You were most likely looking at the wrong documentation. The syntax for
> CQL3 changed between Cassandra 1.1 and 1.2. When I google "cassandra CQL3"
> the first result is Cassandra 1.1 documentation about CQL3, which is wrong
> for 1.2.
>
> Make sure you are looking at the documentation for the version you are
> using. It might also be nice for DataStax to update the 1.1 documentation
> with a warning.
>
> --
>  *Colin Blower*
>
>
> On 01/22/2013 04:06 AM, Paul van Hoven wrote:
>
> Okay, that worked. Why is the statement from the tutorial wrong. I
> mean, why would a company like datastax post somthing like this?
>
> 2013/1/22 Jason Wee <pe...@gmail.com> <pe...@gmail.com>:
>
>  cqlsh> CREATE KEYSPACE demodb WITH replication = {'class': 'SimpleStrategy',
> 'replication_factor': 3};
> cqlsh> use demodb;
> cqlsh:demodb>
>
>
> On Tue, Jan 22, 2013 at 7:04 PM, Paul van Hoven<pa...@googlemail.com> <pa...@googlemail.com> wrote:
>
>  CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
> AND strategy_options:replication_factor='1';
>
>
>
>
>


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

Re: Creating a keyspace fails

Posted by Colin Blower <cb...@barracuda.com>.
You were most likely looking at the wrong documentation. The syntax for 
CQL3 changed between Cassandra 1.1 and 1.2. When I google "cassandra 
CQL3" the first result is Cassandra 1.1 documentation about CQL3, which 
is wrong for 1.2.

Make sure you are looking at the documentation for the version you are 
using. It might also be nice for DataStax to update the 1.1 
documentation with a warning.

-- 
*Colin Blower*


On 01/22/2013 04:06 AM, Paul van Hoven wrote:
> Okay, that worked. Why is the statement from the tutorial wrong. I
> mean, why would a company like datastax post somthing like this?
>
> 2013/1/22 Jason Wee <pe...@gmail.com>:
>> cqlsh> CREATE KEYSPACE demodb WITH replication = {'class': 'SimpleStrategy',
>> 'replication_factor': 3};
>> cqlsh> use demodb;
>> cqlsh:demodb>
>>
>>
>> On Tue, Jan 22, 2013 at 7:04 PM, Paul van Hoven
>> <pa...@googlemail.com> wrote:
>>> CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
>>> AND strategy_options:replication_factor='1';
>>
>>



Re: Creating a keyspace fails

Posted by Paul van Hoven <pa...@googlemail.com>.
Okay, that worked. Why is the statement from the tutorial wrong. I
mean, why would a company like datastax post somthing like this?

2013/1/22 Jason Wee <pe...@gmail.com>:
> cqlsh> CREATE KEYSPACE demodb WITH replication = {'class': 'SimpleStrategy',
> 'replication_factor': 3};
> cqlsh> use demodb;
> cqlsh:demodb>
>
>
> On Tue, Jan 22, 2013 at 7:04 PM, Paul van Hoven
> <pa...@googlemail.com> wrote:
>>
>> CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
>> AND strategy_options:replication_factor='1';
>
>
>

Re: Creating a keyspace fails

Posted by Jason Wee <pe...@gmail.com>.
cqlsh> CREATE KEYSPACE demodb WITH replication = {'class':
'SimpleStrategy', 'replication_factor': 3};
cqlsh> use demodb;
cqlsh:demodb>


On Tue, Jan 22, 2013 at 7:04 PM, Paul van Hoven <
paul.van.hoven@googlemail.com> wrote:

> CREATE KEYSPACE demodb WITH strategy_class = 'SimpleStrategy'
> AND strategy_options:replication_factor='1';
>