Showing posts with label Cassandra. Show all posts
Showing posts with label Cassandra. Show all posts

Monday, April 22, 2013

cassandra nodetool troubleshooting

./nodetool -h localhost ring

if you can see this line

Failed to connect to '127.0.0.1:7199': Connection refused


change "cassandra-env.sh"

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<hostname>"

Tuesday, April 16, 2013

Cassandra Node and Cluster add

http://theeye.pe.kr/entry/an-example-of-adding-new-node-and-operating-nodes-on-cassandra

노드랑 클러스트 추가

Friday, April 12, 2013

1.2.3 user and password setting

1.In the cassandra.yaml, comment out the default AllowAllAuthorizer and add the CassandraAuthorizer as shown
here:
#authorizer: org.apache.cassandra.auth.AllowAllAuthorizer
authorizer: org.apache.cassandra.auth.CassandraAuthorizer


and restart -> now you can access to cassandra 

cassandra-cli -u cassandra -pw cassandra 

because cassandra/cassandra is default setting

============================================================================

2. if you use window and want to connect cqlsh 

refer to this blog


============================================================================

3. access on prom "cassandra_path/bin"/python cqlsh -u cassandra -p cassandra

CREATE USER spillman WITH PASSWORD 'Niner27';
CREATE USER akers WITH PASSWORD 'Niner2' SUPERUSER;
CREATE USER boone WITH PASSWORD 'Niner75' NOSUPERUSER;

DROP USER user_name

Wednesday, April 10, 2013

Cassandra Gui Tool download site

currently cassandra port 8080 was change to 7199


download 0.8beta gui tool

http://code.google.com/a/apache-extras.org/p/cassandra-gui/downloads/list

Tuesday, April 9, 2013

2 day : get where


// make Users column tables


create column family Users with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type and column_metadata=[{column_name: fname, validation_class: UTF8Type}, {column_name: email, validation_class:UTF8Type}, {column_name: state, validation_class: UTF8Type, index_type:KEYS}];

//


set Users['song']['fname']='moo chan';
set Users['song']['email']='mcsong@example.com';
set Users['song']['state']='seoul';

set Users['choi']['fname']='won woo';
set Users['choi']['email']='wonwoo@example.com';
set Users['choi']['state']='seoul';

set Users['jang']['fname']='jang woo';
set Users['jang']['email']='jangwoo@example.com';
set Users['jang']['state']='boosan';

 get Users where state='seoul';

Cassandra Basic Use~!


this is basic Guide for users who start it first time

follow step by step from top to bottom

// make keyspace
[default@unknown] create keyspace MyKeyspace with placement_strategy='org.apache.cassandra.locator.SimpleStrategy' and strategy_op
tions ={replication_factor:1};

use MyKeyspace

// make column fammily
create column family User with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type;

// insert data
[default@MyKeyspace] set User['song']['fname']='moo chan';
Value inserted.
Elapsed time: 36 msec(s).
[default@MyKeyspace] set User['song']['email']='ehewitt@example.com';
Value inserted.

// count data
[default@MyKeyspace] count User['song'];
2 columns

// get data
[default@MyKeyspace] get User['song'];
=> (column=email, value=ehewitt@example.com, timestamp=1365494876521000)
=> (column=fname, value=moo chan, timestamp=1365494847746000)
Returned 2 results.
Elapsed time: 28 msec(s).

// remove data
[default@MyKeyspace] del User['song']['email'];
column removed.
Elapsed time: 19 msec(s).

카산드라 설치 (윈도우)


카산드라 설치 (윈도우)
1. 파일을 다운 받는다.
2. 일단 JAVA_HOME이라는 환경변수가 잡아져있어야 한다
3. cassandra 설치한 폴더로 간다
4. cmd cassandra -f 실행  // -f 옵션은
5. cssandra-cli 로 접속한다.
 - cassandra-cli -h localhost -p 9160
6. Mission Complete

질문이 있으면 댓글 달아주세요