- 浏览: 2537893 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Cassandra Database(1)Begin from the GettingStarted
1. Data Model Introduction
COLUMN name value timestamp
SUPERCOLUMN name, value [ NAME1 : COLUMN1, NAME2 : COLUMN2, ...]
COLUMNFAMILY RDBMS-Table
Standard key, Columns
Super key, SuperColumns
KEYSPACE
2. Installation
2.1 Download the zip file
>wget http://apache.mirrors.pair.com/cassandra/1.2.4/apache-cassandra-1.2.4-bin.tar.gz
Unzip this file and copy to working directory. Link to my default working directory.
>cd /opt/cassandra
Prepare the log directory
>sudo mkdir -p /var/log/cassandra
>whoami
carl
Put the right authority to the directory
>sudo chown -R carl /var/log/cassandra
>sudo mkdir -p /var/lib/cassandra
>sudo chown -R carl /var/lib/cassandra
Here are the path for log and data storage.
Put that in the path
>sudo vi ~/.profile
export CASSANDRA_HOME=/opt/cassandra
export PATH=/opt/cassandra/bin:$PATH
>. ~/.profile
2.2 Check the configuration
In the conf/cassandra.yaml, we can find all the configuration
data_file_directories:
- /var/lib/cassandra/data
commitlog_directory: /var/lib/cassandra/commitlog
saved_caches_directory: /var/lib/cassandra/saved_caches
The Log configuration is conf/log4j-server.properties
log4j.appender.R.File=/var/log/cassandra/system.log
Usually, the cassandra uses the 1/4 ~ 1/2 of my memory. It is configured here.
conf/cassandra-env.sh
uncomments these lines and change the value
#MAX_HEAP_SIZE="4G"
#HEAP_NEWSIZE="800M"
2.3 Start the cassandra DB
>./cassandra -f
2.4 Using cassandra-cli
>cassandra-cli
cassandra-cli>help;
Creating KeySpace
cassandra-cli>create keyspace DEMO
... with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
... and strategy_options = {replication_factor:1};
Change to DEMO
cassandra-cli>use DEMO;
Create Users column family
cassandra-cli>create column family Users
... with key_validation_class = 'UTF8Type'
... and comparator = 'UTF8Type'
... and default_validation_class = 'UTF8Type';
7ad2d938-930e-360c-8163-fd71c719d3f8
Store data into Users column family
cassandra-cli>set Users[1234][name] = carl;
cassandra-cli>set Users[1234][password] = 111111;
It seems to me that there is table Users and one row with name = carl, password = 111111.
Fetch the data from DB
cassandra-cli>get Users[1234];
=> (column=name, value=carl, timestamp=1368728151201000)
=> (column=password, value=111111, timestamp=1368728169110000)
Returned 2 results.
We can also use cassandra-cli like this
>cassandra-cli -host localhost -port 9160
3. Configuring Multinode Cluster
Multiple nodes communicate with each other with Gossip and Thrift.
Configure and Find the configuration file conf/cassandra.yaml
a, listen_address: 192.168.11.15 // for the nodes communicate
b, rpc_address: 0.0.0.0 // for the client
c, seeds: - "192.168.11.15"
- "192.168.11.16"
a, listen_address: 192.168.11.16
b, rpc_address: 0.0.0.0
c, seeds: -"192.168.11.15"
-"192.168.11.16"
a, listen_address: 192.168.11.17
b, rpc_address: 0.0.0.0
c, seeds: -"192.168.11.15"
-"192.168.11.16"
>nodetool -h 192.168.11.15 ring
>nodetool -h 192.168.11.15 -port 8080 ring
References:
http://www.cnblogs.com/gpcuster/archive/2010/03/12/1684072.html
http://www.cnblogs.com/gpcuster/archive/2010/03/25/1695490.html
GettingStarted
http://wiki.apache.org/cassandra/GettingStarted
Cassandra-cli
http://wiki.apache.org/cassandra/CassandraCli
Multiple Nodes
http://rdc.taobao.com/blog/cs/?p=3
http://blog.csdn.net/computerchao/article/details/8538126
http://dongxicheng.org/nosql/cassandra-install/
1. Data Model Introduction
COLUMN name value timestamp
SUPERCOLUMN name, value [ NAME1 : COLUMN1, NAME2 : COLUMN2, ...]
COLUMNFAMILY RDBMS-Table
Standard key, Columns
Super key, SuperColumns
KEYSPACE
2. Installation
2.1 Download the zip file
>wget http://apache.mirrors.pair.com/cassandra/1.2.4/apache-cassandra-1.2.4-bin.tar.gz
Unzip this file and copy to working directory. Link to my default working directory.
>cd /opt/cassandra
Prepare the log directory
>sudo mkdir -p /var/log/cassandra
>whoami
carl
Put the right authority to the directory
>sudo chown -R carl /var/log/cassandra
>sudo mkdir -p /var/lib/cassandra
>sudo chown -R carl /var/lib/cassandra
Here are the path for log and data storage.
Put that in the path
>sudo vi ~/.profile
export CASSANDRA_HOME=/opt/cassandra
export PATH=/opt/cassandra/bin:$PATH
>. ~/.profile
2.2 Check the configuration
In the conf/cassandra.yaml, we can find all the configuration
data_file_directories:
- /var/lib/cassandra/data
commitlog_directory: /var/lib/cassandra/commitlog
saved_caches_directory: /var/lib/cassandra/saved_caches
The Log configuration is conf/log4j-server.properties
log4j.appender.R.File=/var/log/cassandra/system.log
Usually, the cassandra uses the 1/4 ~ 1/2 of my memory. It is configured here.
conf/cassandra-env.sh
uncomments these lines and change the value
#MAX_HEAP_SIZE="4G"
#HEAP_NEWSIZE="800M"
2.3 Start the cassandra DB
>./cassandra -f
2.4 Using cassandra-cli
>cassandra-cli
cassandra-cli>help;
Creating KeySpace
cassandra-cli>create keyspace DEMO
... with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy'
... and strategy_options = {replication_factor:1};
Change to DEMO
cassandra-cli>use DEMO;
Create Users column family
cassandra-cli>create column family Users
... with key_validation_class = 'UTF8Type'
... and comparator = 'UTF8Type'
... and default_validation_class = 'UTF8Type';
7ad2d938-930e-360c-8163-fd71c719d3f8
Store data into Users column family
cassandra-cli>set Users[1234][name] = carl;
cassandra-cli>set Users[1234][password] = 111111;
It seems to me that there is table Users and one row with name = carl, password = 111111.
Fetch the data from DB
cassandra-cli>get Users[1234];
=> (column=name, value=carl, timestamp=1368728151201000)
=> (column=password, value=111111, timestamp=1368728169110000)
Returned 2 results.
We can also use cassandra-cli like this
>cassandra-cli -host localhost -port 9160
3. Configuring Multinode Cluster
Multiple nodes communicate with each other with Gossip and Thrift.
Configure and Find the configuration file conf/cassandra.yaml
a, listen_address: 192.168.11.15 // for the nodes communicate
b, rpc_address: 0.0.0.0 // for the client
c, seeds: - "192.168.11.15"
- "192.168.11.16"
a, listen_address: 192.168.11.16
b, rpc_address: 0.0.0.0
c, seeds: -"192.168.11.15"
-"192.168.11.16"
a, listen_address: 192.168.11.17
b, rpc_address: 0.0.0.0
c, seeds: -"192.168.11.15"
-"192.168.11.16"
>nodetool -h 192.168.11.15 ring
>nodetool -h 192.168.11.15 -port 8080 ring
References:
http://www.cnblogs.com/gpcuster/archive/2010/03/12/1684072.html
http://www.cnblogs.com/gpcuster/archive/2010/03/25/1695490.html
GettingStarted
http://wiki.apache.org/cassandra/GettingStarted
Cassandra-cli
http://wiki.apache.org/cassandra/CassandraCli
Multiple Nodes
http://rdc.taobao.com/blog/cs/?p=3
http://blog.csdn.net/computerchao/article/details/8538126
http://dongxicheng.org/nosql/cassandra-install/
发表评论
-
Update Site will come soon
2021-06-02 04:10 1672I am still keep notes my tech n ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 286Hadoop Docker 2019 Version 3.2. ... -
Nginx and Proxy 2019(1)Nginx Enable Lua and Parse JSON
2019-12-03 04:17 436Nginx and Proxy 2019(1)Nginx En ... -
Data Solution 2019(13)Docker Zeppelin Notebook and Memory Configuration
2019-11-09 07:15 278Data Solution 2019(13)Docker Ze ... -
Data Solution 2019(10)Spark Cluster Solution with Zeppelin
2019-10-29 08:37 243Data Solution 2019(10)Spark Clu ... -
AMAZON Kinesis Firehose 2019(1)Firehose Buffer to S3
2019-10-01 10:15 312AMAZON Kinesis Firehose 2019(1) ... -
Rancher and k8s 2019(3)Clean Installation on CentOS7
2019-09-19 23:25 300Rancher and k8s 2019(3)Clean In ... -
Pacemaker 2019(1)Introduction and Installation on CentOS7
2019-09-11 05:48 332Pacemaker 2019(1)Introduction a ... -
Crontab-UI installation and Introduction
2019-08-30 05:54 441Crontab-UI installation and Int ... -
Spiderkeeper 2019(1)Installation and Introduction
2019-08-29 06:49 489Spiderkeeper 2019(1)Installatio ... -
Supervisor 2019(2)Ubuntu and Multiple Services
2019-08-19 10:53 361Supervisor 2019(2)Ubuntu and Mu ... -
Supervisor 2019(1)CentOS 7
2019-08-19 09:33 320Supervisor 2019(1)CentOS 7 Ins ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 364Redis Cluster 2019(3)Redis Clus ... -
Amazon Lambda and Version Limit
2019-08-02 01:42 428Amazon Lambda and Version Limit ... -
MySQL HA Solution 2019(1)Master Slave on MySQL 5.7
2019-07-27 22:26 497MySQL HA Solution 2019(1)Master ... -
RabbitMQ Cluster 2019(2)Cluster HA and Proxy
2019-07-11 12:41 455RabbitMQ Cluster 2019(2)Cluster ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:35 314Running Zeppelin with Nginx Aut ... -
Running Zeppelin with Nginx Authentication
2019-05-25 21:34 315Running Zeppelin with Nginx Aut ... -
ElasticSearch(3)Version Upgrade and Cluster
2019-05-20 05:00 319ElasticSearch(3)Version Upgrade ... -
Jetty Server and Cookie Domain Name
2019-04-28 23:59 388Jetty Server and Cookie Domain ...
相关推荐
《Getting Started with Storm》这本书是入门Apache Storm的绝佳资源,它深入浅出地介绍了这个分布式实时计算系统的原理、架构以及实际应用。Apache Storm是一个开源的流处理系统,它能够处理无限的数据流,并确保每...
"storm学习入门《Getting started with Storm》中英文版" 指的是一个关于Apache Storm的初学者教程资源,包含了该技术的入门介绍。Apache Storm是一个开源的分布式实时计算系统,用于处理流数据,即持续不断的数据流...
and JavaScript are the most commonly used programming/scripting languages, author Vivek Mishra includes complete coverage of accessing Cassandra database with these languages and developing ...
Cassandra The Definitive Guide(2nd) 英文azw3 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Discover how Cassandra's distributed design lets you add or remove nodes from the cluster as your application requires, Get examples for writing clients in Java, Python, and C#, Extend Cassandra by ...
Master the advanced features available in Cassandra 3.x through a step-by-step tutorial and build a scalable, high performance database layer Book Description Cassandra is a distributed database ...
Apache Cassandra is the most commonly used NoSQL database written in Java and is renowned in the industry as the only NoSQL solution that can accommodate the complex requirements of today’s modern ...
Beginning Apache Cassandra Development introduces you to one of the most robust and best-performing NoSQL database platforms on the planet. Apache Cassandra is a document database following the JSON ...
Cassandra The Definitive Guide(2nd) 英文mobi 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
ness problems, freeing you from the burden of plumbing. Using connectivity compo- nents has never been easier, because you don’t have to implement JMS message listeners or FTP clients, deal with ...
Build, manage, and configure high-performing, reliable NoSQL database for your applications with Cassandra Key Features Write programs more efficiently using Cassandra's features with the help of ...
Cassandra The Definitive Guide(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
This technical report presents the results of a benchmark test conducted by Locomatix, Inc., on Apache’s Cassandra open-source distributed database management system (DBMS), utilizing the Violin ...