Removing nodes entirely


You can take a node out of the cluster with nodetool decommission to a live node, or nodetool removetoken (to any other machine) to remove a dead one. This will assign the ranges the old node was responsible for to other nodes, and replicate the appropriate data there. If decommission is used, the data will stream from the decommissioned node. If removetoken is used, the data will stream from the remaining replicas.


No data is removed automatically from the node being decommissioned, so if you want to put the node back into service at a different token on the ring, it should be removed manually.

원문: http://wiki.apache.org/cassandra/Operations#Removing_nodes_entirely



 

removetoken 

decomission 

 명령 실행 대상

클러스터에서 대상 노드를 제외하고

남아 있는 노드중 하나

decommission 대상 노드 

Replica 재조정 

남아 있는 노드들이 Replica 재생성 

decommission 노드가 데이터 스트림 수행

 제거 대상 노드 상태

Down 

Up 


Wiki 가이드 내용을 요약하면 표와 같다.


정리하자면, 제거 대상 노드가 살아 있을 경우, decommission이 유리하고, 그렇지 않을 경우에 removetoken을 사용해야 할 것으로 예상된다.


이유는, 아무래도, 없어진 replica에 대해서 누군가로부터 읽어서, 그리고 노드간 송/수신이 일어나야 복원이 되는 removetoken에 비해, decommission의 경우 탈퇴/제거 당시 시점까지의 데이타는 모두 가지고 있기 때문에 속했던 클러스터로 데이타를 주기만 하며, 클러스트에서 계속 서비스 중인 노드들은 이제는 외부로부터 데이타를 받기만 하면 되기 때문이다.


여튼저튼, decommission명령에 더이상 서비스는 담당하지 않겠다는, disable thrift, disable gossip과 같은 행위가 수반되는지를 Source Code로부터 확인은 해봐야 겠지만, 위 정보만으로 우선 메모 해둠...

(최근 발표된 cassandra 1.2.x는 virtual-node 방식이라, decommission은 어떻게 작용할지 의문이나, removetoken은 더이상 의미가 없을 것 같다.)


추후, 확인 하고 내용 추가 예정...

Posted by 사랑줍는거지
,


YCSB 사용할 일이 반복적으로 많아 질것 같아 Script 처리를 하면 좀 편해질까 싶어 막스크립트 작성중... 우선은 Cassandra가 직접적으로 관련이 있어 cassandra-10만 우선 지원.(cassnadra-7,8도 동일하게 가능할듯...)


기능은 단순하다.

- ycsb 명령 줄의 parameter들을 다이얼로그 형태로 지원하는 것일 뿐....

- 그일 첨 시작이라 테스트 해보고 써억~ 편의점이 없다면 과감히 휴지통으로 고고~


실행 예)



# ./ycsb_runner.workloads.20130108.sh 


 === 'Green' is supported ===


 [a] basic

 [b] cassandra-10

 [c] cassandra-7

 [d] cassandra-8

 [e] gemfire

 [f] hbase

 [g] infinispan

 [h] jdbc

 [i] mapkeeper

 [j] mongodb

 [k] nosqldb

 [l] redis

 [m] voldemort


 -> Select Database: b



 -> Title(Name): test


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


 -> hosts (Not Null, ex:192.168.1.52,192.168.1.53): 172.21.81.139,172.21.81.127


 -> cassandra.username (Default: Null): 


 -> cassandra.password (Default: Null): 


 -> cassandra.connectionretries (Default: 300): 


 -> cassandra.operationretries (Default: 300): 


 -> cassandra.columnfamily (Default: data): 


 -> fieldcount (Default: 10): 


 -> fieldlength (Default: 200): 


 -> cassandra.readconsistencylevel (Default: ONE): 


 -> cassandra.writeconsistencylevel (Default: ONE): 


 -> cassandra.scanconsistencylevel (Default: ONE): 


 -> cassandra.deleteconsistencylevel (Default: ONE): 


 -> threads - Number of client threads (Default: 1):


ycsb_runner.sh

#!/bin/bash



### by call518@gmail.com (Jung-In.Jung)


### ChangeLog

#* 2013-01-03 : created, support and tested cassandra-10




# [YCSB]

# Usage: ./bin/ycsb command database [options]

# Commands:

#     load          Execute the load phase

#     run           Execute the transaction phase

#     shell         Interactive mode

# Databases:

#     basic         https://github.com/brianfrankcooper/YCSB/tree/master/basic

#     cassandra-10  https://github.com/brianfrankcooper/YCSB/tree/master/cassandra

#     cassandra-7   https://github.com/brianfrankcooper/YCSB/tree/master/cassandra

#     cassandra-8   https://github.com/brianfrankcooper/YCSB/tree/master/cassandra

#     gemfire       https://github.com/brianfrankcooper/YCSB/tree/master/gemfire

#     hbase         https://github.com/brianfrankcooper/YCSB/tree/master/hbase

#     infinispan    https://github.com/brianfrankcooper/YCSB/tree/master/infinispan

#     jdbc          https://github.com/brianfrankcooper/YCSB/tree/master/jdbc

#     mapkeeper     https://github.com/brianfrankcooper/YCSB/tree/master/mapkeeper

#     mongodb       https://github.com/brianfrankcooper/YCSB/tree/master/mongodb

#     nosqldb       https://github.com/brianfrankcooper/YCSB/tree/master/nosqldb

#     redis         https://github.com/brianfrankcooper/YCSB/tree/master/redis

#     voldemort     https://github.com/brianfrankcooper/YCSB/tree/master/voldemort

# Options:

#     -P file       Specify workload file

#     -p key=value  Override workload property

#     -s            Print status to stderr

#     -target n     Target ops/sec (default: unthrottled)

#     -threads n    Number of client threads (default: 1)

# Workload Files:

#     There are various predefined workloads under workloads/ directory.

#     See https://github.com/brianfrankcooper/YCSB/wiki/Core-Properties

#     for the list of workload properties.


trap "rm -f $tmp_file; reset_color; echo; exit 99" 2


now_time() {

date +"%Y-%m-%d__%H-%M-%S"

}


reset_color() {

tput sgr0

}


color_green="\033[1;32m"

color_red="\033[1;31m"

color_blue="\033[1;34m"

color_yellow="\033[1;33m"

color_cyan="\033[1;36m"


tmp_file="/dev/shm/$RANDOM.tmp"


CASSANDRA_CLI="/usr/local/cassandra/bin/cassandra-cli"


YCSB_BIN="/usr/local/src/ycsb-0.1.4/bin/ycsb"

WORKLOAD_DIR="/usr/local/src/ycsb-0.1.4/workloads"


RUN_PATH=`pwd`

LOG_DIR="$RUN_PATH/logs"


mkdir -p $LOG_DIR


if [ -z $YCSB_BIN ]; then

YCSB_BIN=`which ycsb`

if [ -z $YCSB_BIN ]; then

echo

echo -e "$color_red Not found ycsb command!!!"

reset_color

echo

echo -n " -> Input YCSB Command Path: "

read YCSB_BIN

if [ ! -f $YCSB_BIN ] || [ -z $YCSB_BIN ]; then

echo

echo -e "$color_red Invalid path or not found. retry!!"

echo

reset_color

exit 101

fi

fi

fi


if [ ! -d $WORKLOAD_DIR ]; then

echo -e "$color_red Not found workloads directory command!!!"

reset_color

exit 101

fi


###############################################################

basic() {

echo -e "$color_green TBD"

echo

}


cassandra_10() {

echo -n "

 -> Title(Name): "

read title

if [ -z $title ]; then

echo -e "$color_red title is Invalid of Null. retry!!"

echo

reset_color

exit 101

fi


#echo -n "

# [a] load

# [b] run

#

# -> Select Command: "

#

#read command

#case $command in

# a|A)

# command="load"

# ;;

# b|B)

# command="run"

# ;;

#esac

command="run"


echo

echo "==============================================="


echo -n -e "$color_red

 -> hosts (Not Null, ex:192.168.1.52,192.168.1.53): "

reset_color

read hosts

if [ -z $hosts ];then

echo

echo -e "$color_red Hosts is Null !!! retry!!!"

echo

reset_color

exit 105

fi


echo -n "

 -> cassandra.username (Default: Null): "

read cassandra_username


echo -n "

 -> cassandra.password (Default: Null): "

read cassandra_password


echo -n "

 -> cassandra.connectionretries (Default: 300): "

read cassandra_connectionretries

if [ -z $cassandra_connectionretries ]; then cassandra_connectionretries="300"; fi


echo -n "

 -> cassandra.operationretries (Default: 300): "

read cassandra_operationretries

if [ -z $cassandra_operationretries ]; then cassandra_operationretries="300"; fi


echo -n "

 -> cassandra.columnfamily (Default: data): "

read cassandra_columnfamily

if [ -z $cassandra_columnfamily ]; then cassandra_columnfamily="data"; fi


echo -n "

 -> fieldcount (Default: 10): "

read fieldcount

if [ -z $fieldcount ]; then fieldcount="10"; fi


echo -n "

 -> fieldlength (Default: 200): "

read fieldlength

if [ -z $fieldlength ]; then fieldlength="200"; fi


echo -n "

 -> cassandra.readconsistencylevel (Default: ONE): "

read cassandra_readconsistencylevel


echo -n "

 -> cassandra.writeconsistencylevel (Default: ONE): "

read cassandra_writeconsistencylevel

if [ -z $ ]; then =""; fi


echo -n "

 -> cassandra.scanconsistencylevel (Default: ONE): "

read cassandra_scanconsistencylevel


echo -n "

 -> cassandra.deleteconsistencylevel (Default: ONE): "

read cassandra_deleteconsistencylevel


echo -n "

 -> threads - Number of client threads (Default: 1): "

read threads


echo -n "

 -> target - Target ops/sec (Default: unthrottled): "

read target


args="a b c d e f"


TIMESTAMP=`now_time`

for arg in $args

do

host_one=`echo $hosts | awk -F',' '{print $1}'`

echo "create keyspace usertable;

use usertable;

drop column family $cassandra_columnfamily;

create column family $cassandra_columnfamily;" > $tmp_file

$CASSANDRA_CLI -h $host_one -p 9160 < $tmp_file > /dev/null

rm -f $tmp_file


CMD="$YCSB_BIN $command $db -s -P workloads/workload$arg -p hosts=$hosts"


if [ ! -z $cassandra_username ]; then CMD="$CMD -p cassandra.username=$cassandra_username"; fi

if [ ! -z $cassandra_password ]; then CMD="$CMD -p cassandra.password=$cassandra_password"; fi

if [ ! -z $cassandra_connectionretries ]; then CMD="$CMD -p cassandra.connectionretries=$cassandra_connectionretries"; fi

if [ ! -z $cassandra_operationretries ]; then CMD="$CMD -p cassandra.operationretries=$cassandra_operationretries"; fi

if [ ! -z $cassandra_columnfamily ]; then CMD="$CMD -p cassandra.columnfamily=$cassandra_columnfamily"; fi

if [ ! -z $fieldlength ]; then CMD="$CMD -p fieldlength=$fieldlength"; fi

if [ ! -z $fieldcount ]; then CMD="$CMD -p fieldcount=$fieldcount"; fi

if [ ! -z $cassandra_readconsistencylevel ]; then CMD="$CMD -p cassandra.readconsistencylevel=$cassandra_readconsistencylevel"; fi

if [ ! -z $cassandra_writeconsistencylevel ]; then CMD="$CMD -p cassandra.writeconsistencylevel=$cassandra_writeconsistencylevel"; fi

if [ ! -z $cassandra_scanconsistencylevel ]; then CMD="$CMD -p cassandra.scanconsistencylevel=$cassandra_scanconsistencylevel"; fi

if [ ! -z $cassandra_deleteconsistencylevel ]; then CMD="$CMD -p cassandra.deleteconsistencylevel=$cassandra_deleteconsistencylevel"; fi

if [ ! -z $threads ]; then

CMD="$CMD -threads $threads"

fi

if [ ! -z $target ]; then

CMD="$CMD -target $target"

fi

echo -e "$color_cyan"

echo "=== [ YCSB Benchamrk Command ] ==="

echo

echo "# $CMD"

#echo -n "$color_blue

#Press any key to continue..... "

#read tmp

LOG_FILE="$LOG_DIR/$title--workload$arg---$TIMESTAMP.log"


echo "[Start]: `now_time`" > $LOG_FILE

echo >> $LOG_FILE

echo "[Running] # $CMD" >> $LOG_FILE

echo >> $LOG_FILE

$CMD 2>&1 | tee -a $LOG_FILE

echo >> $LOG_FILE

echo "[END]: `now_time`" >> $LOG_FILE

done

reset_color


echo

}


cassandra_7() {

echo -e "$color_green TBD"

echo

}


cassandra_8() {

echo -e "$color_green TBD"

echo

}


gemfire() {

echo -e "$color_green TBD"

echo

}


hbase() {

echo -e "$color_green TBD"

echo

}


infinispan() {

echo -e "$color_green TBD"

echo

}


jdbc() {

echo -e "$color_green TBD"

echo

}


mapkeeper() {

echo -e "$color_green TBD"

echo

}


mongodb() {

echo -e "$color_green TBD"

echo

}


nosqldb() {

echo -e "$color_green TBD"

echo

}


redis() {

echo -e "$color_green TBD"

echo

}


voldemort() {

echo -e "$color_green TBD"

echo

}

###############################################################


clear


echo

echo -e "$color_green === 'Green' is supported ==="; reset_color

echo

echo " [a] basic"; reset_color

echo -e "$color_green [b] cassandra-10"; reset_color

echo " [c] cassandra-7"; reset_color

echo " [d] cassandra-8"; reset_color

echo " [e] gemfire"; reset_color

echo " [f] hbase"; reset_color

echo " [g] infinispan"; reset_color

echo " [h] jdbc"; reset_color

echo " [i] mapkeeper"; reset_color

echo " [j] mongodb"; reset_color

echo " [k] nosqldb"; reset_color

echo " [l] redis"; reset_color

echo " [m] voldemort"; reset_color

echo

echo -n " -> Select Database: "


read db

echo


case $db in

a|A)

db="basic"

basic

;;

b|B)

db="cassandra-10"

cassandra_10

;;

c|C)

db="cassandra-7"

cassandra_7

;;

d|D)

db="cassandra-8"

cassandra_8

;;

e|E)

db=gemfire

gemfire

;;

f|F)

db="hbase"

hbase

;;

g|G)

db="infinispan"

infinispan

;;

h|H)

db="jdbc"

jdbc

;;

i|I)

db="mapkeeper"

mapkeeper

;;

j|J)

db="mongodb"

mongodb

;;

k|K)

db="nosqldb"

nosqldb

;;

l|L)

db="redis"

redis

;;

m|M)

db="voldemort"

voldemort

;;

*)

echo

echo -e "$color_red Invalid Selection. Retry!!"

echo

reset_color

exit 100

;;

esac


reset_color


Posted by 사랑줍는거지
,

Partition tolerance refers to the ability for a system to continue to operate in the presence of a network partitions.  For example, if I have a database running on 80 nodes across 2 racks and the interconnect between the racks is lost, my database is now partitioned.  If the system is tolerant of it, then the database will still be able to perform read and write operations while partitioned.  If not, often times the cluster is completely unusable or is read-only.



Consistency : all nodes see the same data at the same time
Availability : node failures do not prevent survivors from continuing to operate
Partition Tolerance : the system continues to operate despite arbitrary message loss


Posted by 사랑줍는거지
,
  우선 금번 포스팅은 지극히 개인적인 생각이다. 나만의 시각일 뿐임... 특히 MR같은 특수한 기능 측면 보다는 기존 RDB에 비춰 NoSQL의 일반적 특성이 뭘까 고민 해본 정도??

  작년엔 IaaS로 후끈~ 달아 오르더니 딱 1년 지나니... 조용.......... 뭔가 모든걸 해결해 줄듯~ 기세등등한 "Oral-Clouder"들의 천국(전부가 다 그렇단 이야긴 아니니 오해 없길...)이었던 것 같다... 한 1년 겪어보니 이게 장난이 아니구나~ 싶었던걸까...... 그러던 "IT깡국 대한민국"이... 올해는NoSQL, Big-Data로 난리도 아닐것 같다... 뭐가 됐든, 붐이 이는건 좋다... 다만, 걱정되는건 작년 IaaS 처럼... 반짝~ 하고 말게 되지나 않을까 하는거.....

  NoSQL의 개념이나, 등장 하게된 배경...등은 위키피디아를 참고 하시고... 여기서 하고 싶은 이야기는 그것의 본질적 목적이 무엇인가~에 대한 것이다...

 
  같은 값이면 다홍치마~ 라고 했던가? NoSQL이면서, RDB의 기능을 커버할 수 있다면 오죽 좋으련만... 세상에 겁나 싸면서, 기름 열라 작게 먹고, 그런데 승차감은 죽이는데, 속도는 마하급.. 그리고 실내는 버스만큼 넓은~ 그런차는... 몰라 훗날엔 존재할지도 모르겠지만, 당장은 절대로 없다... 무슨 말이냐... RDB의 특징을 유지하면서는, 대용량(기존의 전통적 시스템으로 커버 불가능한 용량) 서비스가 불가능 하기에, 일정 부분 불편함이나, 기능 포기를 감수하고서라도 그러한 대용량 서비스에 대해 탄력적으로 대응이 가능하고 원활한 서비스가 가능케 할 수 있는 방법이 뭘까~ 고민, 고민 하다 나온게(어쩌면 울며 겨자먹기식 차선책일지도 모른다) NoSQL 아닐까.. 싶다.

급조된(?) 아래 그림을 보자...


  가로축은 서비스 이용자 규모다.... 가운데 즈음의 회색 점선을 기준으로 과거 RDB가 커버 가능한 사용자 규모와, 불가능한 규모를 가정하여 잘라둔것...
  세로축은 성능이다... 단, 이 "성능"이라는 말에는 퍼포먼스 뿐만이 아니라, 기능, 그외 사용자가 느끼는 모든 것들을 포괄한 넓은 개념의 그 무엇이라고 보면된다... 그게 일관성이든, 트랜잭션이든, 응답성이든, 기능이든 뭐든...

   다음으로, 파란선은 기존의 RDB를 가정하여 그린 곡선이다. 과거의 전통적인 시스템에서는 하이엔드급 단일 시스템 또는 역할이 분리된 서버군으로 처리가 가능하였다.. 그러나 사용자수가 일정규모를 넘어서는 시점(요즘 말하는 대용량..)부터는 성능이 급감하게 된다... 소위 동적 수평 확장이 어려워 증가하는 사용자 규모에 대해 탄력적 대응이 어렵다..

  반면 빨간선 그래프는 요즘 뜨고 있는 NoSQL이라 생각하고 그려 본 것이다.. 딱 보면, 성능이 사용자 규모의 증가에 적절히 대처 하고 있을 것이라 예상되어 저렇게 그렸던 것이다... 왜? 동적 수평 확장이 가능하기에... 뭐 어디까지나 이론적이지만,,, 아쉽게도 수백대의 NoSQL로 그러한 규모의 사용자에 대한 서비스 처리를 직접 경험해본 적은 없다... 

  여기까진 개략적인 설명이고, 이 그림에서 주목할 부분은 왼쪽의 그래프 시작부분의 빨간선과 파란선의 초기 "성능"값이 다르다는 것이다. 즉, RDB가 NoSQL에 비해, 성능(사용자가 느끼는 모든 부분의...)에서는 월등하다.. 그게 편리함이건, 퍼포먼스건 뭐건... 이 부분에서 사람들이 착각하기 쉬운게 아닐까? 그런 손해를 감수 하고서라도, 그래프의 오른쪽의 대규모 사용자 영역에서 빛을 발하도록 고안된게 NoSQL일 것이다.

  그런 NoSQL을 왼쪽, 다시 말해 전통적인 규모에서 RDB의 기능들을 어설프게 따라 가려 하다가는, 진짜 자기 영역인 오른쪽 영역에서 RDB만도 못한 기대치를 보여줄 가능성이 매우 높을 것이라는 것이다...

  앞서도 언급했지만, "같은 값이면 다홍치마"면 얼마나 좋으려나~ 그러나 절대로 RDB와 NoSQL이 같은 "값"이 아니다.. 그 목적하는 바와 규모, 용도가 전혀 다르다...적어도 현재는... 수년이 지나면 RDB가 NoSQL의 장점을 일부 흡수하게되고(지금도 그런 움직임이 오라클이나, MySQL쪽에서 일고 있다..), NoSQL도 허용가능한 범위에서 RDB의 편리한 점은 흡수하려 할것이다.. 그러나 태생적으로 그 둘 모두의 장점을 결합한 그 무엇은 단기간 내에 보기는 힘들 것이다...

  저 그래프가 시간이 지났을 때를 예측한다면, RDB 입장에선 성능이 급감하는 시점(사용자 규모)을 더 오른쪽으로 최대한 옮길려고 할테고, 그에 대항해 NoSQL은 전체적인 성능을 올리는, 즉 그래프를 조금씩이라도 위쪽으로 옮기려 할 것이다... 뭐 NoSQL이나 Big-Data보다는 Virtualization에 훨씬 관심이 많지만, 이 분야도 앞으로 어떻게 전개될지 흥미는 있을것 같다...


Posted by 사랑줍는거지
,