2

我的配置

具有两个节点的集群:

  • 节点 1:硬件:Intel Xeon 2.83 GHz(4 核),24GB RAM,Dell VIRTUAL DISK SCSI 500GB
    系统:Windows Server 2008 R2 x64
    Java 版本:7 更新 4 x64
    Apache Cassandra 版本:1.1.1

  • 节点 2:硬件:Intel Xeon 2.83 GHz(4 核),8GB RAM,Dell VIRTUAL DISK SCSI 500GB
    系统:Windows Server 2008 R2 x64
    Java 版本:7 更新 4 x64
    Apache Cassandra 版本:1.1.1

Cassandra服务器配置:

heap size: 4 GB
seed_provider:
    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
      parameters:
         - seeds: "xxx.xxx.xxx.10,xxx.xxx.xxx.11"
listen_address: xxx.xxx.xxx.10
rpc_address: 0.0.0.0
rpc_port: 9160
rpc_timeout_in_ms: 20000
endpoint_snitch: PropertyFileSnitch

cassandra-topology.properties

xxx.xxx.xxx.10=datacenter1:rack1
xxx.xxx.xxx.11=datacenter1:rack1
default=datacenter1:rack1

问题

我已经使用 CLI 命令处理了键空间和列族:

create keyspace testks with placement_strategy = 'org.apache.cassandra.locator.NetworkTopologyStrategy' and strategy_options = {datacenter1:2};
use testks;
create column family testcf;

然后我启动了我的 Java 应用程序,它使用 Hector 客户端将 50 000 000 行插入到创建的列族中。客户端连接到节点 1。大约 30 秒后(插入了 160 000 行)节点 1 上的 Cassandra 服务器抛出异常:

ERROR [COMMIT-LOG-ALLOCATOR] 2012-06-13 10:26:38,393 AbstractCassandraDaemon.java (line 134) Exception in thread Thread[COMMIT-LOG-ALLOCATOR,5,main]
java.io.IOError: java.io.IOException: Rename from c:\apache-cassandra\storage\commitlog\CommitLog-7345742389552.log to 7475933520374 failed
    at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:127)
    at org.apache.cassandra.db.commitlog.CommitLogSegment.recycle(CommitLogSegment.java:204)
    at org.apache.cassandra.db.commitlog.CommitLogAllocator$2.run(CommitLogAllocator.java:166)
    at org.apache.cassandra.db.commitlog.CommitLogAllocator$1.runMayThrow(CommitLogAllocator.java:95)
    at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: Rename from c:\apache-cassandra\storage\commitlog\CommitLog-7345742389552.log to 7475933520374 failed
    at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:105)
    ... 5 more

然后,几秒钟后,节点 2 上的 Cassandra 服务器抛出了相同的异常:

ERROR [COMMIT-LOG-ALLOCATOR] 2012-06-14 10:26:44,005 AbstractCassandraDaemon.java (line 134) Exception in thread Thread[COMMIT-LOG-ALLOCATOR,5,main]
java.io.IOError: java.io.IOException: Rename from c:\apache-cassandra\storage\commitlog\CommitLog-7320337904033.log to 7437675489307 failed
    at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:127)
    at org.apache.cassandra.db.commitlog.CommitLogSegment.recycle(CommitLogSegment.java:204)
    at org.apache.cassandra.db.commitlog.CommitLogAllocator$2.run(CommitLogAllocator.java:166)
    at org.apache.cassandra.db.commitlog.CommitLogAllocator$1.runMayThrow(CommitLogAllocator.java:95)
    at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Rename from c:\apache-cassandra\storage\commitlog\CommitLog-7320337904033.log to 7437675489307 failed
    at org.apache.cassandra.db.commitlog.CommitLogSegment.<init>(CommitLogSegment.java:105)
    ... 5 more

之后,我的应用程序无法再插入任何数据。Hector 从 Thrift 获得 TimedOutException:

Thread-4 HConnectionManager.java 306 012-06-14 10:12:56,034      HConnectionManager operateWithFailover      WARN    %Could not fullfill request on this host CassandraClient<xxx.xxx.xxx.10:9160-10> 
Thread-4 HConnectionManager.java 307 2012-06-14 10:12:56,034     HConnectionManager operateWithFailover      WARN    %Exception:  
me.prettyprint.hector.api.exceptions.HTimedOutException: TimedOutException()
    at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:35)
    at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:264)
    at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecuteOperation(ExecutingKeyspace.java:97)
    at me.prettyprint.cassandra.model.MutatorImpl.execute(MutatorImpl.java:243)
    at patrycjusz.nosqltest.db.cassandra.CassandraHectorDbAdapter.commitTransaction(CassandraDbAdapter.java:63)
    at patrycjusz.nosqltest.DbTest.insertData(DbTest.java:459)
    at patrycjusz.nosqltest.gui.InsertPanel.executeTask(NePanel.java:154)
    at patrycjusz.nosqltest.gui.InsertPanel$1.run(NePanel.java:141)
    at java.lang.Thread.run(Unknown Source)
Caused by: TimedOutException()
    at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20269)
    at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
    at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:922)
    at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:908)
    at me.prettyprint.cassandra.model.MutatorImpl$3.execute(MutatorImpl.java:246)
    at me.prettyprint.cassandra.model.MutatorImpl$3.execute(MutatorImpl.java:243)
    at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:103)
    at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:258)
    ... 8 more

我该如何解决?也许我做错了什么?

问候, Patrycjusz

4

1 回答 1

0

Apache Cassandra 不完全支持 Java 7。 http://www.datastax.com/docs/1.1/install/install_rpm

Java7 不是“推荐”的

正如您所发现的,使用 1.6 没有问题...

于 2012-06-14T20:52:18.220 回答