码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu安装Cassandra

时间:2017-05-09 18:53:12      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:man   alter   lib   cat   schema   apt   art   add new   cassandra   

Uninstall Cassandra

$ sudo su

remove cassandra

$ apt-get remove cassandra

 

cleaned the cassandra folders

$ rm -rf /var/lib/cassandra

$ rm -rf /var/log/cassandra

$ rm -rf /etc/cassandra

Install Cassandra

Add the DataStax Community repository to the /etc/apt/sources.list.d/cassandra.sources.list

$ echo "deb http://debian.datastax.com/community stable main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list


Add the DataStax repository key to your aptitude trusted keys.

$ curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -


If the above doesn’t work try:

curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -


And then

sudo apt-get update and then sudo apt-get install cassandra

Configure and run Cassandra

This is the configuration file cassandra reads at startup

$ sudo vi /etc/cassandra/cassandra.yaml


Change authenticator: AllowAllAuthenticator

to authenticator: PasswordAuthenticator


Bring up cassandra when system boots up

$ sudo update-rc.d cassandra enable

use $ cassandra command to enable the cassandra service


then login with following command and you will be able to add new user and create schema:

cqlsh -u cassandra -p cassandra

Create kespace and user

  1. create keyspace rainbowdba with replication = { ‘class‘ : ‘SimpleStrategy‘, ‘replication_factor‘ : 1 };

  2. CREATE USER OC_APP_RAINBOWDBA WITH PASSWORD ‘0b6e8c45df68f6f16d1c494c6ba443c0‘;

ALTER USER OC_APP_RAINBOWDBA WITH PASSWORD ‘a3c224d4b89192d2ea3ea943dd7e9648‘; (may change USER to ROLE)

3) Create the schema accordingly

Ubuntu安装Cassandra

标签:man   alter   lib   cat   schema   apt   art   add new   cassandra   

原文地址:http://www.cnblogs.com/codingforum/p/6832024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!