日期:2014-05-16 浏览次数:20455 次
<Storage> <!--两台机器的ClusterName必须相同,作为集群标识 --> <ClusterName>BurceServers</ClusterName> <AutoBootstrap>false</AutoBootstrap> <Keyspaces> <Keyspace Name="Keyspace1"> <KeysCachedFraction>0.01</KeysCachedFraction> <ColumnFamily CompareWith="BytesType" Name="Standard1"/> <ColumnFamily CompareWith="UTF8Type" Name="Standard2"/> <ColumnFamily CompareWith="TimeUUIDType" Name="StandardByUUID1"/> <ColumnFamily ColumnType="Super" CompareWith="UTF8Type" CompareSubcolumnsWith="UTF8Type" Name="Super1" Comment="A column family with supercolumns, whose column and subcolumn names are UTF8 strings"/> </Keyspace> </Keyspaces> <Partitioner>org.apache.cassandra.dht.RandomPartitioner</Partitioner> <InitialToken></InitialToken> <EndPointSnitch>org.apache.cassandra.locator.EndPointSnitch</EndPointSnitch> <ReplicaPlacementStrategy>org.apache.cassandra.locator.RackUnawareStrategy</ReplicaPlacementStrategy> <ReplicationFactor>1</ReplicationFactor> <CommitLogDirectory>c:/cassandra/lib/cassandra/commitlog</CommitLogDirectory> <DataFileDirectories> <DataFileDirectory>c:/cassandra/lib/cassandra/data</DataFileDirectory> </DataFileDirectories> <CalloutLocation>c:/cassandra/lib/cassandra/callouts</CalloutLocation> <StagingFileDirectory>c:/cassandra/lib/cassandra/staging</StagingFileDirectory> <!--在这里可以添加多个cassandra服务器--> <Seeds> <Seed>10.219.101.101</Seed> <Seed>10.219.101.121</Seed> </Seeds> <RpcTimeoutInMillis>5000</RpcTimeoutInMillis> <CommitLogRotationThresholdInMB>128</CommitLogRotationThresholdInMB> <!--监听地址必须是本机IP--> <ListenAddress>10.219.101.101</ListenAddress> <StoragePort>7000</StoragePort> <ControlPort>7001</ControlPort> <!--基于Thrift的cassandra客户端监听地址--> <ThriftAddress>10.219.101.101</ThriftAddress> <ThriftPort>9160</ThriftPort> <ThriftFramedTransport>false</ThriftFramedTransport> <SlicedBufferSizeInKB>64</SlicedBufferSizeInKB> <ColumnIndexSizeInKB>64</ColumnIndexSizeInKB> <MemtableSizeInMB>64</MemtableSizeInMB> <MemtableObjectCountInMillions>0.1</MemtableObjectCountInMillions> <MemtableFlushAfterMinutes>60</MemtableFlushAfterMinutes> <ConcurrentReads>8</ConcurrentReads> <ConcurrentWrites>32</ConcurrentWrites> <CommitLogSync>periodic</CommitLogSync> <CommitLogSyncPeriodInMS>10000</CommitLogSyncPeriodInMS> <GCGraceSeconds>864000</GCGraceSeconds> <BinaryMemtableSizeInMB>256</BinaryMemtableSizeInMB> </Storage>
/** * */ package com.tpri.sis.test; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import me.prettyprint.cassandra.service.CassandraClient; import org.apache.cassandra.service.Cassandra; import org.apache.cassandra.service.ColumnPath; import org.apache.cassandra.service.ConsistencyLevel; import org.apache.cassandra.service.InvalidRequestException; import org.apache.cassandra.service.TimedOutException; import org