cassandra 性能测试场景一
:可以单独做一个场景测试Cassandra 建议将commitlog与数据目录分别存储在不同的磁盘,以减少磁盘IO竞争,提高写性能。[@more@]
hector tips
hector-v2-client-doc.pdf 读书笔记LoadBalancingPolicy Hector uses the slf4j logging API with the Log4J bridge to provide runtime logging.Hector测试相关的类:EmbeddedServerHelperBaseEmbeddedServerTest创建Keyspace:Cluster cluster = HFactory.getCreateCluster("TestCluster", new CassandraHostConfigurator("localhost:9160"));Keyspace keyspace = HFactory.createKeyspace("Keyspace1",cluster);StringSerializerOrderPreservingPartitionerIndexedSlicesQuery<String, String, Long&g
关于cassandra垃圾清理
cassandra垃圾数据清理:read repair:当执行nodetool repair的时候,cassandra会对当前节点上保存的每一个范围的数据计算Merkle Tree,同其他节点的副本进行比较,获取最近未被读取的不同步数据,进行同步。这个过程是比较耗CPU和IO的,所以通常不应该高频率执行,一般每周一次(GCgraceCollection默认为10天)。 在多节点的同时执行repair是安全的,没有并发问题,不过为了最小化对应用的影响,通常等待在一个节点执行完repair后再在另一个节点上执行。执行cleanup可以清除过时的HintedHandoff数据.The reason why you run nodetool cleanup
cassandra glossary
SuperColumns also differ from regular Columns in that they do not have an associated timestamp.ChitonIn ancient Greece, a chiton was a cloth garment, typically sleeveless, worn by both men and women. Chiton is the namesake for the open source project Chiton by Brandon Williams, which is a Python GTK-based browser for Apache Cassandra. It is currently hosted at http://github.com/driftx/chiton.A related project is Telephus, a low-level client API for Cassandra written in Twisted Python. It is curr
cassandra backup
Backing up dataCassandra can snapshot data while online using nodetool snapshot. You can then back up those snapshots using any desired system, although leaving them where they are is probably the option that makes the most sense on large clusters. nodetool snapshot triggers a node-wide flush, so all data written before the execution of the snapshot command is contained within the snapshot. With some combinations of operating system/jvm you may receive an error related to the inability to create
关于cassandra备份方案中几个需要考虑的问题
需要明确的几个问题:1.cassandra中compact对数据进行压缩的效率?2.针对当前的对象存储元数据数据库数据量的估算?3.cassandra备份中,本地备份磁盘拷贝的速率估算异地备份,选择千兆光纤传输介质拷贝速率影响 估算?4.casssandra从0.7.3版本升级到0.8.0可能存在的兼容性问题?5.增量备份恢复,如何能达到最高的一致性,减少repair,compact的额外操作对资源的占用?6.搞定使用python压力测试工具大批量灌数据的场景?总结了cassandra中的策略:http://dongxicheng.org/nosql/cassandra-strategy/[@more@]
Incremental Cassandra Backup
Incremental Cassandra BackupEnable incremental Cassandra backupconf/cassandra.yamlincremental_backups: trueWhen incremental backup is enabled (default is off), Cassandra persists flushed SSTable to a backup directory under/var/lib/cassandra/data/mykeyspace/backups/ Old incremental backup files needs to be manually removed. Consider removing them after snapshotsWith these incremental backup files in conjunction with a snapshot, an administrator can restore data in a node when data corruption occu
jdk版本不匹配引起的cassandra启动命令无反应故障
cassandra 0.8.0 ,jdk1.7.0-ea 兼容问题表现:使用如下命令启动cassandra直接返回,无启动加载信息,ps查看进程cassandra未启动#>./cassandra原因:cassandra0.8.0不兼容jdk1.7.0版本解决:rpm -qa |grep jdkrpm -e jdk1.7.0-earpm -ivh **.rpm[@more@]
Postmark测试后端存储性能
Postmark用于对进行频繁,大量存取小文件的存储系统的存储性能测试。原理:构建一个测试文件池,通过文件最大,最小大小,数量等参数进行配置,然后进行事务的初始化,对每一个事务中读取/附加,创建/删除等所占的比例进行设置来模拟真是应用场景,事务操作完成后,Postmark对文件池进行删除,结束测试,输出结果。===========================配置的两种方式:一、直接在命令行中输入配置命令如:# ./postmark-1.51 >set size 10000 20000二、使用配置文件启动 ./postmark XXX.cfg--XXX.cfgset transactions 5000set number 5000runqui
cassandra业务数据一致性问题处理?
cassandra如何保持多个columnfamily业务相关的数据一致性,比如,有bucket,bucket_object,object这样三个CF,分别存框信息,与框关联的对象信息,对象信息,如果删除了object中的一个key,那么希望在bucket_object中也删除相应的key,如何做到? --这个放到程序中去保证吧,比如1.现在要删除一个object,在bucke_object中有一个key需要同步的删除,就在程序中调一次delete_object()操作。2.同时可以写一个一致性检查的类,封装相应的方法,比如批量的检查,清除。[@more@]
cassandra笔记2
1.SSTable 的大小?取决于刷memtable到磁盘的时间间隔。2.一个SSTable文件用一次从Memtable中写入?SSTable是只读的。3.每个CF对应一个Memtable,当Memtable满足刷新条件后批量刷新数据存储到磁盘上的SSTable中,下一次Memtable需要刷新到一个新的SSTable文件中,这也是保证SSTable中数据是按key的一定顺序排列的。4.几个写时间瓶颈:Memtable到阀值后flush到SSTable;同一个CF的多个SSTable被合并成一个大的SSTable。5.Write ConsistencyLevel的三种选择:ONE:确保写入至少一个借点的commitlog和memtableQUORUM:确保至少写入n/2+1个节点A
hector-v2-client-doc.pdf read notes
hector-v2-client-doc.pdf 读书笔记LoadBalancingPolicy Hector uses the slf4j logging API with the Log4J bridge to provide runtime logging.Hector测试相关的类:EmbeddedServerHelperBaseEmbeddedServerTest创建Keyspace:Cluster cluster = HFactory.getCreateCluster("TestCluster", new CassandraHostConfigurator("localhost:9160"));Keyspace keyspace = HFactory.createKeyspace("Keyspace1",cluster);StringSerializerOrderPreservingPartitionerIndexedSlicesQuery<String, String, Long&g
看了四个小时hector guide,借用一个hector的使用清单来总结下hector的使用
import static me.prettyprint.cassandra.utils.StringUtils.bytes;import static me.prettyprint.cassandra.utils.StringUtils.string;import org.apache.cassandra.service.Column;import org.apache.cassandra.service.ColumnPath;public class ExampleClient { public static void main(String[] args) throws IllegalStateException, PoolExhaustedException, Exception { CassandraClientPool pool = CassandraClientPoolFactory.INSTANCE.get(); CassandraClient client = pool.borrowClient("localhost", 9160); /
(转)使用binary memtable 批量导数据到cassandra
package com.alibaba.dw.thrift.client; import java.io.IOException;import java.io.UnsupportedEncodingException; import org.apache.cassandra.config.DatabaseDescriptor;import org.apache.cassandra.db.Column;import org.apache.cassandra.db.ColumnFamily;import org.apache.cassandra.db.RowMutation;import org.apache.cassandra.db.filter.QueryPath;import org.apache.cassandra.io.util.DataOutputBuffer;import java.net.InetAddress; import org.apache.cassandra.net.Message;import org.apache.cassandra.net.Messaging
cassandra性能调优及其他
占座[@more@]
redhat安装双节点cassandra集群
tar -zxvf cassandra-$version.tar.gzmv cassandra-$version /opt/obs/cassandrasudo mkdir -p /var/log/cassandrasudo mkdir -p /var/lib/cassandraecho 'alias PATH=$PATH:/opt/obs/cassandra/bin' >>~/.bashrc################################# 1.有些命令的路径没有在PATH环境变量中,可以用echo $PATH命令查询得知,添加路径到PATH环境变量的方法如下: (如添加/sbin到PATH环境变量中) (1)如果只想在本次开机过程中临时性的添加修改,下次开机就无效的话,可以: 输入export PATH=$PATH:/sbin (2)如果只给当
cassandra相关的几个问题
1.SSTable 的大小?2.一个SSTable文件用一次从Memtable中写入?3.每个CF对应一个Memtable,当Memtable满足刷新条件后批量刷新数据存储到磁盘上的SSTable中,下一次Memtable需要刷新到一个新的SSTable文件中,这也是保证SSTable中数据是按key的一定顺序排列的。4.几个写时间瓶颈:Memtable到阀值后flush到SSTable;同一个CF的多个SSTable被合并成一个大的SSTable。5.Write ConsistencyLevel的三种选择:ONE:确保写入至少一个借点的commitlog和memtableQUORUM:确保至少写入n/2+1个节点ALL:确保写入n个节点,有单点失效问题。--?一个节点失效,