help loading schema into cassandra

695 views
Skip to first unread message

okonom kaufmann

unread,
Jun 14, 2015, 5:25:34 PM6/14/15
to bluefloo...@googlegroups.com
Hello,

I'm trying out blueflood using the "10 Minute Guide" on github.

I've run into a little trouble loading the blueflood schema into cassandra.
Perhaps someone can tell where I got off track?

Using Ubuntu 14.04, I've installed cassandra-2.1.6 from the debian package here:

Cassandra logs show it running without errors. Per the guide, my cassandra.yaml config appears to have the needed settings.

I've also built blueflood-2.0.0-SNAPSHOT from github sources, all without issue.

Now I'm trying to load the schema found here:
src/cassandra/cli/load.script

The syntax I'm trying varies a little from the guide --- cassandra-cli has been replaced by cqlsh, and the ip:port default to 127.0.0.1:9160.

Running this cmd...
$ cqlsh -f src/cassandra/cli/load.script
...I get this result...
src/cassandra/cli/load.script:4:SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 3:46 no viable alternative at input ':' (... 'org.apache.cassandra.locator.SimpleStrategy'    AND strategy_options = {[replication_factor]:...)">
src/cassandra/cli/load.script:5:InvalidRequest: code=2200 [Invalid query] message="Keyspace 'data' does not exist"
...followed by messages for the various colums.

I'm new to cassandra as well blueflood, and I'm working to learn cassandra a little better.
However, just to get something basic running, I'd be grateful for any suggestions on how to move forward.

Thank you.

okonom kaufmann

unread,
Jun 14, 2015, 9:46:37 PM6/14/15
to bluefloo...@googlegroups.com
I'm able to get around the first part of the error message by editing the "CREATE KEYSPACE" statement in the load.script file.

I've edited this part...
CREATE KEYSPACE DATA
    WITH placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
    AND strategy_options = {replication_factor:1};
USE DATA;
...to instead read like this...
CREATE KEYSPACE DATA
    WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1}; 
USE DATA;

Now I'm just left with error messages for the "CREATE COLUMN" statements.
These messages are similar to...
src/cassandra/cli/load.script:6:SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:7 no viable alternative at input 'COLUMN' ([CREATE] COLUMN...)">

The documentation that I'm finding makes me think "CREATE COLUMN" may not be used in all versions of cassandra?

I'll keep reading up on cassandra docs, but really feel like I'm headed the wrong direction at this point.

Thanks again.

Gary Dusbabek

unread,
Jun 14, 2015, 11:42:51 PM6/14/15
to okonom kaufmann, bluefloo...@googlegroups.com
Please feel free to fix the wiki!

Kind Regards,

Gary.

--
You received this message because you are subscribed to the Google Groups "Blueflood Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blueflood-disc...@googlegroups.com.
Visit this group at http://groups.google.com/group/blueflood-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/blueflood-discuss/e0cc0f17-72f2-4db1-afaf-664c74c909ea%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

okonom kaufmann

unread,
Jun 16, 2015, 11:57:13 PM6/16/15
to bluefloo...@googlegroups.com
Just tried cassandra-2.0.15 and the load.script worked.

I see further on in the wiki ("Deployment Dependencies" section) it says to use cassandra 2.0.

The "10 Minute Guide" says "Get the latest version of cassandra" -- that's the part that got me off track.

Thanks!


On Sunday, June 14, 2015 at 2:25:34 PM UTC-7, okonom kaufmann wrote:
Message has been deleted

Jack Kenefick

unread,
Sep 10, 2015, 11:54:52 AM9/10/15
to Blueflood Discuss
Hi,
I had the same problems with cassandra-2.2.0.  I've blueflood running with cassandra-2.2.0 now.  This is what I did.

Create a cql file with the content below (reverse engineered schema ddl from a cassandra-2.0 import of load.script), and use cqlsh -f <cqlfile>.  This will import the schema to cassandra-2.2.0
Next, once cassandra-2.2.0 is running, run "$CASSANDRA_HOME/bin/nodetool enablethrift".
Next restart blueflood, and wait until it says all services are running.
Then the examples in the 10 minute guide should work.

CREATE KEYSPACE "DATA" WITH replication={'class':'SimpleStrategy', 'replication_factor':1};

USE "DATA";

CREATE TABLE metrics_locator (
    key bigint,
    column1 text,
    value text,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_discovery (
    key text,
    column1 text,
    value text,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_state (
    key bigint,
    column1 text,
    value bigint,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_metadata (
    key text,
    column1 text,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_string (
    key text,
    column1 bigint,
    value text,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_full (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_5m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_20m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_60m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_240m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_1440m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_preaggregated_full (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_preaggregated_5m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_preaggregated_20m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_preaggregated_60m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_preaggregated_240m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_preaggregated_1440m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_histogram_5m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_histogram_20m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_histogram_60m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_histogram_240m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;

CREATE TABLE metrics_histogram_1440m (
    key text,
    column1 bigint,
    value blob,
    PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE
   AND read_repair_chance = 0.0
   AND dclocal_read_repair_chance = 0.1
   AND replicate_on_write = true
   AND gc_grace_seconds = 864000
   AND bloom_filter_fp_chance = 0.01
   AND caching = 'KEYS_ONLY'
   AND comment = ''
   AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy' }
   AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.LZ4Compressor' }
   AND default_time_to_live = 0
   AND speculative_retry = 'NONE'
   AND index_interval = 128;
Reply all
Reply to author
Forward
0 new messages