我单节点Cassandra安装出现问题。 我可以在日志中没有任何错误地启动它。 我可以创建一个keyspace,创建表,插入和删除数据。 但是截去不工作节点在单节点Cassandra安装中无法访问
cqlsh> CREATE KEYSPACE mykeyspace WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};
cqlsh> use mykeyspace;
cqlsh:mykeyspace> create table test1 (num int, primary key (num));
cqlsh:mykeyspace> insert into test1 (num) values (12);
cqlsh:mykeyspace> select * from test1;
num
-----
12
(1 rows)
cqlsh:mykeyspace> truncate test1;
Unable to complete request: one or more nodes were unavailable.
另外,如果我尝试nodetool运行describecluster它不会返回完整的响应
[[email protected] dsc-cassandra-2.0.6]$ ./bin/nodetool describecluster
Cluster Information:
Name: Test Cluster
Snitch: org.apache.cassandra.locator.DynamicEndpointSnitch
Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
Schema versions:
UNREACHABLE: [127.0.0.1]
我使用
- 卡桑德拉DSC 2.0.6 。
- Red Hat 5.8。
- Java版本 “1.7.0_51”
的Java(TM)SE运行时环境(建立1.7.0_51-B13)
爪哇热点(TM)64位服务器VM(建立24.51-B03,混合模式)
我得到的ping 127.0.0.1和ping本地主机
我检查了所有我所知道卡桑德拉可能需要的端口(7000,9160,7199,9042),使用telnet回应 - 例如
的telnet 127.0.0.1 7199
telnet localhost 7199
我可以连接到这些端口。
我使用默认的cassandra.yaml。这些是IP或主机名显示的行
listen_address: localhost
rpc_address: localhost
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "127.0.0.1"
我也查看了源代码。我相信问题可以接近org.apache.cassandra.service.StorageProxyMBean.describeSchemaVersions()方法。很有可能我没有收到对SCHEMA_CHECK消息的响应。
我试图在log4j中为nodetool(conf/log4j-tools.properties)启用TRACE登录以获取有关该问题的更多信息,但不知怎的,log4j没有开始记录(它确实创建了我在appender中设置的文件,但该文件为空)。
必须有特定于此环境的内容,因为我无法在任何其他环境中重复此问题。所以我无法弄清楚是什么原因造成的。
在你cassandra.yaml,你有什么'listen_address'设置? – Aaron
感谢您的回复。我添加了我的cassandra.yaml中的主机/ IP相关设置(它们是默认设置)。为了以防万一,我还测试了使用127.0.0.1和localhost的cassandra端口。 – Tamas