`

cassandra

 
阅读更多

cassandra 客户端命令操作流程:

 

具体流程:

首先,启动cassandra:

进入安装目录,使用命令:bin/cassandra

然后,连接到一个节点上

 
$ ./cassandra-cli -host localhost -port 9160
  
Connected to: "Test Cluster" on localhost/9160
  
Welcome to cassandra CLI.
  
Type 'help;' or '?' for help. Type 'quit;' or 'exit;' to quit.

之后创建一个key space和CF

 
 
[default@unknown] create keyspace twissandra with replication_factor=1
  
and placement_strategy='org.apache.cassandra.locator.SimpleStrategy';
  
[default@unknown] use twissandra;
  
Authenticated to keyspace: twissandra
  
------------
  
... schemas agree across the cluster
  
[default@twissandra]  create column family users with comparator = UTF8Type;
  
c21f48d5-8748-11e0-8afd-e700f669bcfc
  
Waiting for schema agreement...
  
... schemas agree across the cluster
  
[default@twissandra] set users['Bob']['phone']='1251892983';
  
Value inserted.
  
[default@twissandra] set users['Bob']['address']='Haidian,Beijing';
  
Value inserted.
  
[default@twissandra] set users['Bob']['birthday']='1980-08-09';
  
Value inserted.
  
[default@twissandra] get users['Bob'];
  
=> (column=address, value=4861696469616e2c4265696a696e67, timestamp=1306380804182000)
  
=> (column=birthday, value=313938302d30382d3039, timestamp=1306380831152000)
  
=> (column=phone, value=31323531383932393833, timestamp=1306380777399000)
  
Returned 3 results.

更新phone column的值

 
[default@twissandra]  set users['Bob']['phone']='1251892999';
  
Value inserted.

删除phone column

 
[default@twissandra] del  users['Bob']['phone'];
  
column removed.
  
[default@twissandra] list users;
  
Using default limit of 100
  
-------------------
  
RowKey: Bob
  
=> (column=adress, value=4861696469616e2c4265696a696e67, timestamp=1306380804182000)
  
=> (column=birthday, value=313938302d30382d3039, timestamp=1306380831152000)

删除users CF

 
[default@twissandra] drop column family users;
  
f1d9d7a6-874a-11e0-8afd-e700f669bcfc
  
Waiting for schema agreement...
  
... schemas agree across the cluster
  
------

创建SCF

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[default@twissandra] create column family friends with column_type=Super;
  
73264792-8740-11e0-8afd-e700f669bcfc
  
Waiting for schema agreement...
  
... schemas agree across the cluster
  
[default@twissandra] set friends['Bob']['address']['family']='BeiJing';
  
Value inserted.
  
[default@twissandra] set friends['Bob']['address']['company']='BeiJing';
  
Value inserted.
  
[default@twissandra] get friends['Bob']['address'];
  
=> (column=636f6d70616e79, value=4265694a696e67, timestamp=1306380530572000)
  
=> (column=66616d696c79, value=4265694a696e67, timestamp=1306380522162000)
  
Returned 2 results.
  
[default@twissandra] get friends['Bob'];
  
=> (super_column=61646472657373,
  
(column=636f6d70616e79, value=4265694a696e67, timestamp=1306380530572000)
  
(column=66616d696c79, value=4265694a696e67, timestamp=1306380522162000))
  
Returned 1 results。
分享到:
评论

相关推荐

    Cassandra(apache-cassandra-3.11.11-bin.tar.gz)

    Cassandra(apache-cassandra-3.11.11-bin.tar.gz)是一套开源分布式NoSQL数据库系统。它最初由Facebook开发,用于储存收件箱等简单格式数据,集GoogleBigTable的数据模型与Amazon Dynamo的完全分布式的架构于一身...

    cassandra-3.11.3下载

    Cassandra是一款分布式、高度可扩展的NoSQL数据库系统,由Facebook于2008年开源,并在随后被Apache软件基金会接纳为顶级项目。Cassandra的设计灵感来源于Google的Bigtable,旨在处理大规模的数据存储需求,特别适合...

    apache-cassandra-3.11.13

    Apache Cassandra 是一个分布式数据库系统,特别设计用于处理大规模数据,具备高可用性、线性可扩展性和优秀的性能。在这个"apache-cassandra-3.11.13"版本中,我们探讨的是Cassandra项目的其中一个稳定版本,它包含...

    Learning_Apache_Cassandra

    在本文档中,标题“Learning_Apache_Cassandra”透露了内容的主题,即学习Apache Cassandra。Cassandra是一个开源的NoSQL分布式数据库管理系统,它以高可用性和分布式架构著称。该书详细介绍了Cassandra的基本概念、...

    spring boot与cassandra集成,使用JPA方式。

    在本文中,我们将深入探讨如何将Spring Boot框架与Cassandra数据库集成,并利用Java Persistence API (JPA) 进行数据操作。Spring Boot以其简洁的配置和开箱即用的特性,已经成为Java开发中的首选框架之一。而...

    Cassandra的数据模型介绍

    amily 是 Cassandra 数据模型的核心组成部分,用来组织和管理 Column 和 SuperColumn。在 Cassandra 中,一个 ColumnFamily 相当于传统数据库中的表,但它不遵循严格的行与列的关系,而是以键值对的形式存储数据,...

    DevCenter cassandra客户端

    DevCenter 是一个强大的工具,专为数据科学家、开发人员和管理员设计,用于与Apache Cassandra数据库进行交互。这个工具提供了一个直观的用户界面,使得管理、查询和开发Cassandra数据库变得简单易行。Cassandra是一...

    Cassandra_概要指南

    ### Cassandra概要指南 #### 一、Cassandra的诞生与背景 Cassandra作为一个高可靠性的大规模分布式存储系统,它的诞生背景源于互联网Web2.0应用的飞速发展以及云计算技术的普及。随着用户数据量的爆炸性增长和对...

    Cassandra

    The rising popularity of Apache Cassandra rests on its ability to handle very large data sets that include hundreds of terabytes -- and that's why this distributed database has been chosen by ...

    基于Cassandra的实时气象数据分布式存储系统.pdf

    "基于Cassandra的实时气象数据分布式存储系统" 本文主要介绍了基于Cassandra的实时气象数据分布式存储系统的设计和实现。该系统采用Cassandra作为分布式存储解决方案,旨在满足气象数据存储的高可用性和性能要求。 ...

    Cassandra在饿了么的应用

    标题中提到的"Cassandra在饿了么的应用"意味着文章将讨论Apache Cassandra这个大规模分布式NoSQL数据库系统在著名的中国本地生活服务平台饿了么中的实际应用案例。描述中重复多次提及"Cassandra",这表明主题将专注...

    Mastering.Apache.Cassandra.2nd.Edition.1784392618

    Title: Mastering Apache Cassandra, 2nd Edition Author: Nishant Neeraj Length: 322 pages Edition: 2 Language: English Publisher: Packt Publishing Publication Date: 2015-02-27 ISBN-10: 1784392618 ISBN-...

    Cassandra(apache-cassandra-4.0.1-bin.tar.gz)

    Cassandra(apache-cassandra-4.0.1-bin.tar.gz)是一套开源分布式NoSQL数据库系统。它最初由Facebook开发,用于储存收件箱等简单格式数据,集GoogleBigTable的数据模型与Amazon Dynamo的完全分布式的架构于一身...

    ycsb cassandra 压力测试工具

    **ycsb cassandra 压力测试工具** YCSB(Yahoo! Cloud Serving Benchmark)是 Yahoo 开源的一个云服务性能基准测试工具,它主要用于评估分布式数据库、键值存储和其他云服务的性能。Cassandra 是一个分布式NoSQL...

    java NoSql Cassandra hector

    Java NoSQL Cassandra Hector详解 在当今大数据时代,非关系型数据库(NoSQL)因其灵活性、高可扩展性和高性能,越来越受到开发者的青睐。Cassandra,作为NoSQL数据库家族中的重要一员,尤其在大规模分布式存储系统...

    Cassandra实战.pdf

    在深入探讨《Cassandra实战.pdf》这一资源时,我们聚焦于Apache Cassandra数据库系统的全面解析与实践应用,这是一份详尽的技术文档,旨在为数据库管理员、开发者以及对分布式数据库技术感兴趣的专业人士提供深入...

    Java连接cassandra实现简单的增删查demo

    在Java编程环境中,连接Cassandra数据库并实现基本的增、删、查操作是常见的任务。Cassandra是一款分布式NoSQL数据库,常用于处理大规模数据。在这个示例中,我们将探讨如何通过Java来操作Cassandra数据库。 首先,...

    cassandra入门项目源代码

    【标题】:“Cassandra入门项目源代码”是一个针对初学者的教程项目,旨在帮助开发者了解如何在Eclipse环境中使用Spring Data框架与EasyRest风格来操作Cassandra数据库和Lucene搜索引擎。这个项目提供了一整套实践性...

    Cassandra JDBC Driver 0.8.2

    Cassandra JDBC Driver 0.8.2 是一个专门为 Cassandra 数据库设计的 Java 数据库连接器(JDBC)驱动程序。这个驱动程序使得开发者能够通过使用标准的 JDBC API 来与 Cassandra 数据库进行交互,这对于那些熟悉 JDBC ...

Global site tag (gtag.js) - Google Analytics