NoSQL_Cassandra_运行cqlsh 遇到的问题集

博主今天在搭建Cassandra 2.2.7集群时遇到了一堆问题。


最近迷上了 stack-overflow 和 google。在描述我如何解决遇到的问题的方法,我都尝试以英文进行表述,有问题的同学可以留言联系我。

tips: 英文水平不太好,有表述不准确的地方. 请大家指出,thanks.


Q1,Q2... 等问题存在先后的相关性


Q1:在利用sqlsh 连接 server 时 提示 no appropriate python:

Answer: install python 2.7 +, but python does not provide installer version for linux, so you must complie the source file and install.


Q2:编译安装python 2.7.12

可以直接参考我的另一篇博文(anthor blog):

http://blog.csdn.net/u010003835/article/details/53465032


Answer: 

(1) when compile python 2 .7.12 and install python , you need install some dependency tools first (WTF when 

./configure  there no tips about dependency)  

dependency tools:

1.zlib        2.zlib-devel      3.openssl     4.openssl-devel

you can follow this:

yum install openssl

yum install openssl-devel (solve the zlib & zlib-devel dependencies)


(2)before make && make install, you should  check ./Modules/Setup  (create by configure):

vim Modules/Setup

use     /zlib zlibmo   to search 

#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

remove annotation(#)   //去掉注释#


编译安装完python后, 需要把安装后的lib 加入到path 环境变量中。

用  python --version 检查是否安装好了



Q3: when use cqlsh to connect cassandra server。

Tips:  pip install cassandra-driver

Answer: You should install pip first. A software like yum:

pip 为类似 yum 一样的管理python包的工具,但是 yum install pip 的版本很低, for python 2.6,

需要从官网上下载  地址:  https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py

download the get-pip.py (just click it, and copy, make sure the postfix is .py)

     python get-pip.py

to install appropriate pip version for your system.

then:

pip -V

to make sure installed complete~

next:

pip install cassandra-driver



Q4:Connection error: ('Unable to connect to any servers', {'localhost': TypeError('ref() does not take keyword arguments',)})

vim /etc/profile

add this:

export CQLSH_NO_BUNDLED=TRUE     

(add what you like after =)

I find the answer use stack-overflow, 哎,博主为了找这个答案, 翻了不下30篇文章,最后还是在stack-overflow上找到了答案,珍爱生命,请用google 和 stack-overflow

这是我在stack-overflow 上找到的原话:

问题地址:http://stackoverflow.com/questions/39703374/cqlsh-typeerrorref-does-not-take-keyword-arguments












Cassandra是一个混合型的非关系的数据库,类似于Google的BigTable。其主要功能比Dynomite(分布式的Key-Value存储系统)更丰富,但支持度却不如文档存储MongoDB(介于关系数据库和非关系数据库之间的开源产品,是非关系数据库当中功能最丰富,最像关系数据库的。支持的数据结构非常松散,是类似json的bjson格式,因此可以存储比较复杂的数据类型。)Cassandra最初由Facebook开发,后转变成了开源项目。它是一个网络社交云计算方面理想的数据库。以Amazon专有的完全分布式的Dynamo为基础,结合了Google BigTable基于列族(Column Family)的数据模型。P2P去中心化的存储。很多方面都可以称之为Dynamo 2.0。 功能   Cassandra的主要特点就是它不是一个数据库,而是由一堆数据库节点共同构成的一个分布式网络服务,对Cassandra 的一个写操作,会被复制到其他节点上去,对Cassandra的读操作,也会被路由到某个节点上面去读取。对于一个Cassandra来说,扩展性能是比较简单的事情,只管在群里面添加节点就可以了。   这里有很多理由来选择Cassandra用于您的网站。和其他数据库比较,有三个突出特点: 模式灵活 :使用Cassandra,像文档存储,你不必提前解决记录中的字段。你可以在系统运行时随意的添加或移除字段。这是一个惊人的效率提升,特别是在大型部署上。 真正的可扩展性 :Cassandra是纯粹意义上的水平扩展。为给群添加更多容量,可以指向另一台电脑。你不必重启任何进程,改变应用查询,或手动迁移任何数据。 多数据中心识别 :你可以调整你的节点布局来避免某一个数据中心起火,一个备用的数据中心将至少有每条记录的完全复制。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值