zoukankan      html  css  js  c++  java
  • [nosql/Cassandra] Cassandra 安装测试

    官网 http://cassandra.apache.org/

    下载&安装

    wget http://www.fayea.com/apache-mirror/cassandra/1.2.0/apache-cassandra-1.2.0-bin.tar.gz
    tar -zxvf apache-cassandra-1.2.0-bin.tar.gz
    cd apache-cassandra-$VERSION
    sudo mkdir -p /var/log/cassandra
    sudo chown -R `whoami` /var/log/cassandra
    sudo mkdir -p /var/lib/cassandra
    sudo chown -R `whoami` /var/lib/cassandra

    启动服务

    bin/cassandra -f

    测试客户端

    bin/cqlsh
    # 创建scheme (类似mysql创建一个数据库 create database )
    qlsh> CREATE SCHEMA schema1 WITH replication = { 'class':'SimpleStrategy', 'replication_factor' : 1 };
    # 使用scheme (类似mysql use <databasename>;)
    cqlsh> USE schema1;
    # 创建一张表 (类似mysql create table)
    cqlsh:Schema1> CREATE TABLE users (
                                      user_id varchar PRIMARY KEY,
                                      first varchar,
                                      last varchar,
                                      age int
                               );
    # 插入一条数据
    cqlsh:Schema1> INSERT INTO users (user_id, first, last, age) VALUES ('jsmith', 'John', 'Smith', 42);
    # 查询表数据
    cqlsh:Schema1> SELECT * FROM users;
        user_id | age | first | last
       ---------+-----+-------+-------
         jsmith |  42 |  john | smith
    
    # 退出cqlsh
     cqlsh:Schema1>quit
    think in coding
  • 相关阅读:
    更好的抽屉效果(ios)
    系统拍照动画
    UITabBarController详解
    touch事件分发
    iOS UWebView详解
    iOS 监听声音按键
    webservice偶尔报黄页,解决方案
    FastReport脚本把数据绑定到文本控件上
    [转]js版的md5()
    JQuery中$.ajax()方法参数详解
  • 原文地址:https://www.cnblogs.com/bluefrog/p/2851210.html
Copyright © 2011-2022 走看看