为什么从Cassandra CLI教程中切割和粘贴不工作? [英] Why does cutting and pasting from the Cassandra CLI tutorial not work?
本文介绍了为什么从Cassandra CLI教程中切割和粘贴不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
盲目遵循 http://wiki.apache.org/cassandra/CassandraCli ,并且可以有人请解释一下?
Blindly following http://wiki.apache.org/cassandra/CassandraCli, and can someone please explain this?
aaron-mac:apache-cassandra-1.0.0 aaron$ bin/cassandra-cli -host localhost -port 9160
Connected to: "Test Cluster" on localhost/9160
Welcome to the Cassandra CLI.
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[default@unknown] use Keyspace1;
Authenticated to keyspace: Keyspace1
[default@Keyspace1] create column family User with comparator = UTF8Type;
5ef4bad0-fb2a-11e0-0000-242d50cf1ffd
Waiting for schema agreement...
... schemas agree across the cluster
[default@Keyspace1] set User['jsmith']['first'] = 'John';
org.apache.cassandra.db.marshal.MarshalException: cannot parse 'jsmith' as hex bytes
[default@Keyspace1]
推荐答案
在Cassandra CLI中运行任何set命令之前,总是建议执行以下操作:
Before you run any set command in Cassandra CLI, it is always advisable to do the following :
assume <column_family> keys as utf8;
assume <column_family> comparator as utf8;
assume <column_family> validator as utf8;
这将确保您设置和列出的一切都能被理解
This will ensure that everything you set and list will be understood
PS:这只适用于Cassandra的新手
P.S : This is only for newcomers to Cassandra
这篇关于为什么从Cassandra CLI教程中切割和粘贴不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文