Cassandra的介绍和背景是什么

Cassandra的介绍和背景是什么

本文目录

  • Cassandra的介绍背景是什么
  • 如何设置cassandra用户名和密码
  • cassandra数据库怎么连
  • 请教Cassandra如何安全关闭
  • 如何安装配置Cassandra
  • 关于cassandra的统计功能
  • 为什么 Cassandra 的写速度比 MySQL 快
  • 请教Cassandra如何安全关闭的相关推荐
  • 有关希腊神话人物Cassandra的传说
  • 国内哪些互联网公司使用了Cassandra数据库

Cassandra的介绍和背景是什么


Cassandra的高可用性、动态可伸缩性、最小化管理开销等特性使得它越来越受关注
1. 伸缩性,当我们增加一个系统中的资源,并能获取与增加的资源保持适当的比例关系的性能提升,我们就认为这个服务具备了伸缩性,可伸缩性表示的工作量和吞吐量之间的关系
资源投入与输出保持线性关系。
为促进冗余投入的资源不会带来性能损失。
能够处理异构资源。
能做到运维高效。
具备自修复能力。
2.Scale Out Vs Scale Up
Scale Up: 在同一个逻辑单元内增加资源,例如增加CPU/内存/网卡数量等。
Scale Out- :增加多个逻辑单元的资源,并使它们如同一个集中的资源那样提供服务(集群/分布式/负载均衡等) 。
Scale Up  :较为简单,但是规模有限,代价越来越大。
Scale Out :需要从架构层面设计,规模没有限制,代价由架构决定。

如何设置cassandra用户名和密码


适应于cassandra2.0以上的版本
1、首先修改配置文件 cassandra.yaml
默认的authenticator: AllowAllAuthenticator运行所有人登录设置为用密码登录:
authenticator: PasswordAuthenticator
2、登录cassandra创建用户
使用默认账户登录cassandra
在bin目录下执行
./cqlsh -ucassandra -pcassandra
创建用户
1
CREATE USER myusername WITH PASSWORD ’mypassword’ SUPERUSER ;
3、使用新用户登录
删除默认帐号:
DROP USER cassandra ;
4、java使用用户名密码访问cassandra
Cluster cluster = Cluster.builder()
.addContactPoint(“192.168.22.161“)
.withCredentials(“myusername“, “mypassword“)
.build();

cassandra数据库怎么连


Cassandra的文件包中,bin下有自带的数据库操作命令工具cassandra-cli,lib中有可供Java编程访问的Driver.我们先介绍命令行工具的基本数据库操作:
$ bin/cassandra-cli
》》 Connected to: “Test Cluster“ on 127.0.0.1/9160 Welcome to Cassandra CLI version 2.0.3 The CLI is deprecated and will be removed in Cassandra 3.0. Consider migrating to cqlsh. CQL is fully backwards compatible with Thrif
》》 [default@unknown]
Key space类似于数据库的概念,首先需要创建一个Key space.

请教Cassandra如何安全关闭


cat pidfile | xargs kill
cassandrabin目录stop-server脚本面用
kill `cat 《pidfile》`
见cassandra确关闭
再想安全点先用nodetool drain操作阻止该几点继续接收请求执行功执行kill命令关闭该cassandra节点

如何安装和配置Cassandra


Cassandra安装方法
首先确保安装了JDK。
然后,修改配置文件,cassandra-0.7.6-2的conf下有以下几个配置文件:
(1) access.properties:设置每个数据库或者表的访问权限
(2) cassandra.yaml:主配置文件,包括日志路径,数据存放路径,各种参数配置等
(3) cassandra-topology.properties:配置网络的拓扑结构
(4) log4j-server.properties:log4j的配置选项
(5) passwd.properties:配置用户密码,与access.properties配合使用
对于简单的使用,只需配置cassandra.yaml文件:
(1) 集群名称cluster_name:同一个集群中的集群名称应该一样。
(2) 数据存放路径data_file_directories:可以根据情况配置一个有写权限的路径
(3) commit log路径commitlog_directory:同上
(4) saved cache路径saved_caches_directory:同上
(5) 日志文件路径log4j.appender.R.File:同上(这个选项在log4j-server.properties文件中)
此外,还需要修改服务监听的地址和thrift访问地址,即ListenAddress和ThriftAddress,配置文件默认监听的都是localhost:
《!-- Cassandra节点之间通信的监听地址,这里设置所在节点的ip--》
《ListenAddress》100.200.3.1《/ListenAddress》
《!-- 这个是Thrift监听的地址,建议设置为0.0.0.0 --》
《ThriftAddress》0.0.0.0《/ThriftAddress》
经过上面的配置就可以启动节点了:
进入bin目录,直接执行:./cassandra。

关于cassandra的统计功能


1、cassandra不支持类似group by的查询,只能通过数据结构的设计来实现一些比较简单的统计。
2、bin包解压后,在bin目录下会有bat和shell文件
3、多研究一下wiki,有不少有用的信息

为什么 Cassandra 的写速度比 MySQL 快


Cassandra 的写速度比 MySQL 快的两大根本原因
1、cassandra没有sql解析层,这是个大块
2、cassandra采用memstable+sstable的模型,最大化的提高数据的写入性能,磁盘操作只有顺序写。
nosql产品的数据写入buffer非常大, nosql用数据安全换取高性能, 其实没有绝对的优势,看你的产品具体需求

请教Cassandra如何安全关闭的相关推荐


cat pidfile | xargs kill
在cassandra的bin目录下,有个stop-server的脚本,里面是用
kill `cat 《pidfile》`
可见,cassandra的正确关闭方法就这个了
如果再想安全一点,那么可以先用nodetool drain操作,阻止该几点继续接收请求,执行成功之后,在执行kill命令,关闭该cassandra节点。

有关希腊神话人物Cassandra的传说


Cassandra,卡珊德拉或翻译为凯珊卓,希腊文:Κασσάνδρα。特洛伊国王普里阿摩斯(King Priam)的女儿。古希腊神话中又一个可怜的悲剧人物。
(古希腊神话之所以那么震撼,就在于他的悲剧基调,这样的基调是用于古希腊人对命运的认识。他们认为命运产生悲剧,命运的主宰是连众神之神的宙斯都无能为力的)
Cassandra作为祭祀住在阿波罗神殿里,她的美貌打动了阿波罗,于是阿波罗赋予她预言的能力。(还有一种传说是:Cassandra住在阿波罗神庙里,有一天晚上,一条神庙里的蛇在Cassandra熟睡中舔了她的耳朵,从此,Cassandra便可以听到未来了。)作为回报,阿波罗向Cassandra提出发生肉体关系的要求,结果被Cassandra拒绝了。阿波罗一怒下向她施以诅咒:凡她说出口的预言将百发百中,然而谁也不信以为真,她的预言能力将成为她日后无尽痛苦的根源。在戏剧
《阿加门农》中,此故事似乎被描述为Cassandra曾许诺阿波罗,她愿意做阿波罗的妻子,但是Cassandra并没有遵守诺言,所以她遭受了惩罚。
Cassandra在特洛伊被破城之前,预言过特洛伊木马计,以及阿迦门农之死和自己的终结。正因为她拥有预知能力却没有人相信她,她对此无能为力,才感到痛苦万分。
在特洛伊战争之后,Cassandra避难于雅典娜神庙,但却遭到小埃阿斯Ajax the Lesser 强暴(可怜的女人啊)。前面的朋友说阿迦门农杀死了小埃阿斯,但是还有一个版本是说小埃阿斯是被海神波塞冬杀死的,或者又说是被雅典娜杀死的。
而Cassandra的去世,也有两种说法:一说她在希腊舰队归航途中船沉丧命,另一说认为她被克吕泰涅斯特拉杀害。
In Greek mythology, Cassandra was the daughter of King Priam and Queen Hecuba of Troy. Her beauty caused Apollo to grant her the gift of prophecy. However, when she did not return his love, Apollo placed a curse on her so that no one would ever believe her predictions.
In an alternative version, she spent a night at Apollo’s temple with her twin brother Helenus, at which time the temple snakes licked her ears clean so that she was able to hear the future. This is a recurring theme in Greek mythology, though sometimes it brings an ability to understand the language of animals rather than an ability to know the future.
Apollo loved Cassandra and when she did not return his love, he cursed her so that her gift would become a source of endless pain and frustration. In some versions of the myth, this is symbolized by the god spitting into her mouth; in other Greek versions, this act was sufficient to remove the gift so recently given by Apollo, but Cassandra’s case varies. From the play Agamemnon, it appears that she made a promise to Apollo to become his consort, but broke it, thus incurring his wrath.
Telephus, the son of Heracles, loved Cassandra but she scorned him and instead helped him seduce her sister Laodice.
While Cassandra foresaw the destruction of Troy (she warned the Trojans about the Trojan Horse, the death of Agamemnon, and her own demise), she was unable to do anything to forestall these tragedies.
Coroebus and Othronus came to the aid of Troy out of love for Cassandra. Cassandra was also the first to see the body of her brother Hector being brought back to the city.
After the Trojan War, she sought shelter in the temple of Athena, where she was raped by Ajax the Lesser. Cassandra was then taken as a concubine by King Agamemnon of Mycenae. Unbeknownst to Agamemnon, while he was away at war, his wife, Clytemnestra, had begun an affair with Aegisthus. Clytemnestra and Aegisthus then murdered both Agamemnon and Cassandra. Some sources mention that Cassandra and Agamemnon had twin boys, Teledamus and Pelops, both of whom were killed by Aegisthus.
关于Cassandra的用法,前面有一位朋友说的很清楚了,只是在这里补充一点,就是在心理学上所指的Cassandra complex卡珊德拉情结。
Cassandra complex可以是看成一种精神疾病,指那些对某些暂时无法确定或者尚且毫无根据的即将发生的“灾难”异常恐惧并且深陷其中的人,一般有这样情结的人,都有一些臆想症的征兆。
关于电影资料,最好的一部是我看过的《十二只猴子》,影片描写了关于主角在一群科学家的帮助下进行时空旅行,去收集有关一场使人类几乎灭亡的病毒信息,里面的女主角是一位心理学医生,她就在一次学术讨论会上详细的解释了什么叫Cassandra complex,即讽刺又经典的是,在她的发表会上所引用的一段Cassandra式的预言,正是日后真正发生了的灾难,而她也因为命运的安排,卷入了整个事件,最后也如Cassandra一样,对将要发生的灾难无能为力而痛苦不堪。

国内哪些互联网公司使用了Cassandra数据库


从现在国内的生产环境来看使用Cassandra数据库的公司还是比较多的,那么,有哪些公司正在使用Cassandra数据库呢?

有在国内的生产环境更卡桑德拉360大公司。从开放的数据中,应该有至少1500台服务器的集群。360、选择Cassandra的原因如下:几个团队成员,紧张的需求和开源项目;无单点,没有中心,适合在线业务;代码很容易理解,团队成员的代码库;社区更活跃。其他中小型公司和初创企业也在使用中。

1、脸谱网弃用?脸谱网当初想用卡桑德拉实现其消息系统,但后来发现不合适,原因不是卡桑德拉不靠谱,而是卡桑德拉的最终一致性模型不适合留言系统,HBase具有更简单的一致性模型。卡桑德拉强调AP,HBase强调CP目前脸谱网的收件箱搜索系统在使用,8亿用户,200t数据;其移动应用开发平台也使用卡桑德拉。

推特抛弃吗?的本质是MySQL和NoSQL之间的纠纷。卡桑德拉可以进入推特视觉,这说明卡桑德拉是一个NoSQL的代表产品。为什么不在推特微博系统使用卡桑德拉?”这是一个战略转变。我们将继续维护我们原来的基于MySQL的存储。我们认为,没有时间大规模地将数据迁移到一项新技术上。”目前,推特也使用Cassandra使用Cassandra在定位和分析生产。


免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部