cassandra中遇到的问题
来源:互联网 发布:java 统计一年月消费 编辑:程序博客网 时间:2024/05/18 02:06
Cassandra问题一览
UnavailableException错误情况
1
2
[
default
@dtest
] set Student[
'tom]['
name
']='
tom';
3
null
4
UnavailableException()
5
at org.apache.cassandra.thrift.Cassandra$insert_result.read(Cassandra.java:
15206
)
6
at org.apache.cassandra.thrift.Cassandra$Client.recv_insert(Cassandra.java:
858
)
7
at org.apache.cassandra.thrift.Cassandra$Client.insert(Cassandra.java:
830
)
8
at org.apache.cassandra.cli.CliClient.executeSet(CliClient.java:
901
)
9
at org.apache.cassandra.cli.CliClient.executeCLIStatement(CliClient.java:
218
)
10
at org.apache.cassandra.cli.CliMain.processStatementInteractive(CliMain.java:
220
)
11
at org.apache.cassandra.cli.CliMain.main(CliMain.java:
348
)
当时很惊讶,因为这么简单的命令,不可能出错啊,但是就是这么奇怪地报了。经过查看cassandra.thrift中该异常的描述为在写入/读取的过程中,需要操作的节点数少于实际存活的节点数。于是我执行了show shema发现:
1
create keyspace dtest
2
with placement_strategy =
'NetworkTopologyStrategy'
3
and strategy_options = {dc1 :
1
}
4
and durable_writes =
true
;
这就发现了很明显的问题,原来默认的strategy_options变化了。于是执行:
1
update keyspace dtest
2
with placement_strategy =
'SimpleStrategy'
3
and strategy_options = {replication_factor :
1
}
4
and durable_writes =
true
;
再次插入,发现正常了!
总结:类似的UnavailableException均应该从集群几点存活数量这方面考虑。这次的异常是因为没注意到创建keyspace的时候由于是测试而太懒惰,没有写strategy options,并且默认的该值又有问题导致的。
无法通过eclipse连接远程主机上的cassandra
conf/cassadnra.yaml中的rpc_address专门用于客户端的连接
rpc_address
(Default: localhost) The listen address for client connections (Thrift remote procedure calls). Valid values are:
• 0.0.0.0: Listens on all configured interfaces.
• IP address
• hostname
• unset: Resolves the address using the hostname configuration of the node. If left unset, the hostname must resolve to the IP address of this node using /etc/hostname, /etc/hosts, or DNS.
当出现连接被拒绝时,可以通过修改这个配置项来到达连接的目的,如想连接到 IP为172.28.112.110时可以直接修改这个配置项:
rpc_address:172.28.112.110
连接便可建立
在使用java语言调用API进行keyspace和column family的创建时
ksDef.strategy_options = Collections.singletonMap("replication_factor", "1");来进行keyspace的factor的设置
使用ksDef.replication_factor = 1等方法设置时会出错
- cassandra中遇到的问题
- 使用python-cassandra遇到的一个问题
- 遇到一些cassandra问题及解决
- Cassandra在实践中用到的问题
- Cassandra中rowcache的更新
- 调式中遇到的问题
- 面试中遇到的问题
- LFS中遇到的问题
- 面试中遇到的问题
- Tomcat中遇到的问题
- phpmyadmin中遇到的问题
- plasma 中遇到的问题
- php中遇到的问题
- tomcat 中遇到的问题
- 开发中遇到的问题
- flex 中遇到的问题
- 进步中遇到的问题
- 工作中遇到的问题
- unityd 模型跟随鼠标移动,鼠标隐藏
- iOS -- @property属性说明
- Win7+PHP 5.4.19+Apache 2.2+phpMyAdmin 4.0
- android启动过程分析--启动systemServer
- uva 1016 - Silly Sort(置换的灵活应用)
- cassandra中遇到的问题
- UVA - 531 Compromise
- 如何解决加载大图片时内存溢出的问题
- 浅谈协方差矩阵
- PHPExcel使用方法总结
- 如何配置 PLSQL 连接远程 Oracle 服务器
- 最新VMware Workstation 10注册码,绝对可用!
- 关于现在2013.9
- %循环,二维数组