Happy Apache Cassandra 1: Setup
来源:互联网 发布:sql触发器 编辑:程序博客网 时间:2024/06/06 07:32
Cassandra Setup
Setup Cassandra
GettingStarted
Single Node
- Download
- tar xvf cassandra-*.tar.gz
- conf/cassandra.yaml
data_file_directories: ./datacommitlog_directory: ./commitlogsaved_caches_directory: ./saved_cachescluster_name: 'cassandra 1.0 Cluster'
- conf/log4j-server.properties
log4j.appender.R.File=./log/system.log
- mkdir data|commitlog|saved_caches|log
- Start up
nohup bin/cassandra -f &
- Shut down
kill -9 `ps -ef | grep cassandra | awk '{print $2}'`
- Node ring
bin/nodetool -host localhost ring
Cluster
- each node, same as above
- conf/cassandra.yaml, comment out localhost
#listen_address: localhost#rpc_address: localhostseed_provider:- seeds: "172.16.101.227,172.16.101.228"
- a quick setup is to copy the cassandra from the first node and clean the data/system to avoid different node uses same token
scp -r . 172.16.101.227:/home/xnavuser/cassandra-1.0.2scp -r . 172.16.101.228:/home/xnavuser/cassandra-1.0.2rm -rf data/system
Load_balancing
Load_balancing
If you uses even node number, the address token of each node would liketo split the range equally.
If you use odd node number, you can calculate new tokens for the nodes.
Keep your node token stable after start, otherwise, data may be can notbe found.
calculate tokes
def tokens(nodes): for x in xrange(nodes): print 2 ** 127 / nodes * x
move node
bin/nodetool -host 172.16.101.227 move 0bin/nodetool -host 172.16.101.228 move 34028236692093846346337460743176821145bin/nodetool -host 172.16.101.228 move 68056473384187692692674921486353642290bin/nodetool -host 172.16.101.228 move 102084710076281539039012382229530463435bin/nodetool -host 172.16.101.228 move 136112946768375385385349842972707284580
balance
Address DC Rack Status State Load Owns Token 136112946768375385385349842972707284580 172.16.101.227 datacenter1 rack1 Up Normal 54.64 KB 20.00% 0 172.16.101.228 datacenter1 rack1 Up Normal 50.32 KB 20.00% 34028236692093846346337460743176821145 172.16.101.229 datacenter1 rack1 Up Normal 54.56 KB 20.00% 68056473384187692692674921486353642290 172.16.101.230 datacenter1 rack1 Up Normal 54.59 KB 20.00% 102084710076281539039012382229530463435 172.16.101.231 datacenter1 rack1 Up Normal 15.42 KB 20.00% 136112946768375385385349842972707284580
Monitoring
http://wiki.apache.org/cassandra/Operations#Monitoring
- bin/cassandra-cli -h host
- bin/nodetool -h host cfstats|tpstats
- JMX
- JConsole/JVisuialVM host:7199 (MBean)
- MX4J, host:8081
- Download mx4j-tools.jar from http://mx4j.sourceforge.net/
- Add mx4j-tools.jar to the classpath (e.g. under lib/)
- Start cassandra
- Browser to http host:8081
- Happy Apache Cassandra 1: Setup
- Happy Apache Cassandra 3: Monitor
- Apache Cassandra Learning Step by Step (1): Setup to play
- Happy Apache Cassandra 2: File Store Format
- Setup Cassandra on Windows
- apache setup
- Datastax文档Apache Cassandra v2.1 第一部分 关于Apache Cassandra和CQL
- apache-cassandra-12.9安装
- Apache Cassandra架构理解
- Apache Cassandra架构理解
- Apache Cassandra:多学多得
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构之架构概要
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_数据分发和副本
- apache shiro setup
- 初识apache cassandra 学习笔记
- Cassandra Dev 1: Cassandra 入门
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_节点间通信(Gossip)
- Apache Cassandra (四):使用php-cassandra进行分页查询,
- OAuth 认证步骤
- C#获取当前页面的url
- 我的js补零
- 键盘输入模型
- 左右上中下框架界面
- Happy Apache Cassandra 1: Setup
- sqlite3.7.9 VC2010编译说明
- struts2自定义标签中传递对象
- 虚拟机virtualbox中挂载新硬盘
- jprofiler安装图解
- zoj 1476 Weird Clock(纠结的水题)
- 移植ssh到arm
- 能帮你找到网页设计灵感的16个网站
- 编译原理的各个阶段及其功能 && clang产生背景