여기저기서 빅데이터 빅데이터 해서, 나도 하둡이니 뭐니 공부는 하고 있지만...


가만 보면... 수익을 내기 위해서 들어가는 돈이 너무.... 많아서 개인이 뭔가 비지니스를 하겠다고 하기에는 엄두가 안나는 분야이다.


하지만, 배워서 남주는거 아니니.. 공부는 또 계속 한다.


http://venublog.com/2012/11/30/typical-big-data-architecture/





블로그 이미지

커뉴

이 세상에서 꿈 이상으로 확실한 것을, 인간은 가지고 있는 것일까?

,

얼마전 Lucene 을 안드로이드에 포팅하다가 Solr을 좀 보게 된 적이 있는데, 그때는 관심없이 지나쳤었는데...

검색엔진에서 많이 쓰이고 있다.


Solr 와 ElasticSearch에 대해서 오늘 검색하던중, 아래 글을 발견했는데....

공부해둬야 될것 같다.. 개발자의 삶이란 언제 무엇을 요구할지 모르기 때문에...


요약 : ElasticSearch 가 더 좋을지도 모른다.


http://stackoverflow.com/questions/10213009/solr-vs-elasticsearch



블로그 이미지

커뉴

이 세상에서 꿈 이상으로 확실한 것을, 인간은 가지고 있는 것일까?

,

개발일을 하면서 여러명이 같이 일을 하다보니, 소스 변경이 너무 많고, 왜 이런 수정사항이 생겼는지 관리조차 되지 않을때가 있다.

개인적인 프로젝트를 진행하더라도, 자기가 그날 그날 수정한 코드들이 왜 수정되었는지 관리가 필요할 경우 우리가 생각해볼수 있는것은 여러가지 있겠지만, 그중에서도 가장 편한 방법은 쓰기 쉬운 형상관리 툴을 사용하는 것이다.


그동안 SourceSafe,SVN,CVS,GIT,ClearCase등을 다 써봤지만, Perforce만큼빠르고 쓰기 쉬운 툴은 아직 못본것 같다.


그런던차에 Perforce 를 개인적인 프로젝트를 위해서 사용할수 있는 방법이 없는지 하고 해당 사이트를 들어가보니, 20명의 유저와 20개의 워크스페이스로 무제한으로 사용가능한 Free 버전이 있었다. 바로 다운 받아서 설치했다. 아~~쾌적하다...



1. 일단 perforce 설치를 위해서 perforce 사용자를 추가하자. 앞으로 perforce의 모든 로그, 기록, 명령들은 perforce라는 사용자에 의해서 관리된다.




2. 그리고 나서 Perforce 서버는 기본적으로 daemon이라는 것이 있어야 돌아간다. 설치하자.



3. 이제는 perforce 서버데몬(p4d)와 command line tool(p4)를 다운받고...

http://www.perforce.com/downloads/complete_list




4.실행권한 줘서 복사하자..




5.저장소와 로그디렉토리를 만들고..(저장소에 모든 소스들이 저장된다)


 

6. 이젠 뭐 사용자들이 p4 잘쓸수 있게 profile에 추가해주고..(친절하니까...) 저기 보면 P4PORT가 있는데 나중에 IP가 바뀌면 저거도 같이 바꿔줘야 한다..





7. perforce를 init script에 포함시켜서 부팅시마다 알아서 시작되게 해두자..(역시 저기에 나오는 P4PORT값은 나중에 IP가 바뀌면 !!! 꼭!!!!! 바꿔줘야 p4d가 뜬다)




8. 실행해보면~~~




이제 형상관리 서버를 만들었으니,  cocos2dx를 안드로이드로 포팅하는 작업에 형상관리를 시작해야 겠다.

끝~

블로그 이미지

커뉴

이 세상에서 꿈 이상으로 확실한 것을, 인간은 가지고 있는 것일까?

,

한 10년전쯤인가, 그때는 PHP + MySQL등등으로 RDB전성시대였었던것 같은데(물론 지금은 어떤지 알수 없다..) 최근에는 여기 저기서 NoSQL DB를 많이 사용하고 있는것 같다. 대용량 데이터를 처리하고 다뤄야 하는 데이터 싱크 용도로는 Cassandra 같은 분산 DB가 단연 최고이다.


오늘은 그래서 Cassandra를 한번 설치해봤다. Cassandra가 뭐고, 어떻게 동작하는 것인지는 설치부터 해놓고 이것 저것 만들어가면서 설명해도 모지라지 않으니 일단은 설치부터 해보자.




설치 및 실행 방법


1. 설치하는 방법

1. 다운로드 받기 (http://cassandra.apache.org/download/)

cassandra@ubuntu:~$ wget http://apache.mirror.cdnetworks.com/cassandra/1.1.6/apache-cassandra-1.1.6-bin.tar.gz


2. 압축풀기

cassandra@ubuntu:~$ tar xvfz apache-cassandra-1.1.6-bin.tar.gz

cassandra@ubuntu:~$ mkdir bin

cassandra@ubuntu:~$ mv apache-cassandra-1.1.6 ./bin

cassandra@ubuntu:~$ cd bin

cassandra@ubuntu:~/bin$ ln -s apache-cassandra-1.1.6 cassandra


3. 로그 설정이라던지, 각종 설정 변경하기는 아래 두개의 파일을 수정하면 됨.

cassandra@ubuntu:~/bin$ cd cassandra

cassandra@ubuntu:~/bin/cassandra$ cd conf

cassandra.yaml --> 기본적인 설정들

log4j-server.properties --> 로그 설정들.


2. 실행하는 방법 

cassandra@ubuntu:~$ bin/cassandra/bin/cassandra

xss =  -ea -javaagent:bin/cassandra/bin/../lib/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms753M -Xmx753M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -Xss180k

 INFO 07:44:21,693 Logging initialized

 INFO 07:44:21,697 JVM vendor/version: Java HotSpot(TM) Client VM/1.6.0_37

 INFO 07:44:21,697 Heap size: 779091968/780140544

 INFO 07:44:21,698 Classpath: bin/cassandra/bin/../conf:bin/cassandra/bin/../build/classes/main:bin/cassandra/bin/../build/classes/thrift:bin/cassandra/bin/../lib/antlr-3.2.jar:bin/cassandra/bin/../lib/apache-cassandra-1.1.6.jar:bin/cassandra/bin/../lib/apache-cassandra-clientutil-1.1.6.jar:bin/cassandra/bin/../lib/apache-cassandra-thrift-1.1.6.jar:bin/cassandra/bin/../lib/avro-1.4.0-fixes.jar:bin/cassandra/bin/../lib/avro-1.4.0-sources-fixes.jar:bin/cassandra/bin/../lib/commons-cli-1.1.jar:bin/cassandra/bin/../lib/commons-codec-1.2.jar:bin/cassandra/bin/../lib/commons-lang-2.4.jar:bin/cassandra/bin/../lib/compress-lzf-0.8.4.jar:bin/cassandra/bin/../lib/concurrentlinkedhashmap-lru-1.3.jar:bin/cassandra/bin/../lib/guava-r08.jar:bin/cassandra/bin/../lib/high-scale-lib-1.1.2.jar:bin/cassandra/bin/../lib/jackson-core-asl-1.9.2.jar:bin/cassandra/bin/../lib/jackson-mapper-asl-1.9.2.jar:bin/cassandra/bin/../lib/jamm-0.2.5.jar:bin/cassandra/bin/../lib/jline-0.9.94.jar:bin/cassandra/bin/../lib/json-simple-1.1.jar:bin/cassandra/bin/../lib/libthrift-0.7.0.jar:bin/cassandra/bin/../lib/log4j-1.2.16.jar:bin/cassandra/bin/../lib/metrics-core-2.0.3.jar:bin/cassandra/bin/../lib/servlet-api-2.5-20081211.jar:bin/cassandra/bin/../lib/slf4j-api-1.6.1.jar:bin/cassandra/bin/../lib/slf4j-log4j12-1.6.1.jar:bin/cassandra/bin/../lib/snakeyaml-1.6.jar:bin/cassandra/bin/../lib/snappy-java-1.0.4.1.jar:bin/cassandra/bin/../lib/snaptree-0.1.jar:bin/cassandra/bin/../lib/jamm-0.2.5.jar

 INFO 07:44:21,699 JNA not found. Native methods will be disabled.

 INFO 07:44:21,710 Loading settings from file:/home/cassandra/bin/apache-cassandra-1.1.6/conf/cassandra.yaml

 INFO 07:44:21,826 32bit JVM detected.  It is recommended to run Cassandra on a 64bit JVM for better performance.

 INFO 07:44:21,826 DiskAccessMode 'auto' determined to be standard, indexAccessMode is standard

 INFO 07:44:22,008 Global memtable threshold is enabled at 248MB

 INFO 07:44:22,239 Initializing key cache with capacity of 37 MBs.

 INFO 07:44:22,249 Scheduling key cache save to each 14400 seconds (going to save all keys).

 INFO 07:44:22,253 Initializing row cache with capacity of 0 MBs and provider org.apache.cassandra.cache.SerializingCacheProvider

 INFO 07:44:22,258 Scheduling row cache save to each 0 seconds (going to save all keys).

 INFO 07:44:22,353 Opening /home/cassandra/data/system/Versions/system-Versions-hf-1 (247 bytes)

 INFO 07:44:22,379 Opening /home/cassandra/data/system/LocationInfo/system-LocationInfo-hf-6 (346 bytes)

 INFO 07:44:22,385 Opening /home/cassandra/data/system/LocationInfo/system-LocationInfo-hf-5 (163 bytes)

 INFO 07:44:22,445 Couldn't detect any schema definitions in local storage.

 INFO 07:44:22,446 Found table data in data directories. Consider using the CLI to define your schema.

 INFO 07:44:22,467 completed pre-loading (2 keys) key cache.

 INFO 07:44:22,596 Replaying /home/cassandra/commitlog/CommitLog-1353080634664.log, /home/cassandra/commitlog/CommitLog-1353080634663.log

 INFO 07:44:22,606 Replaying /home/cassandra/commitlog/CommitLog-1353080634664.log

 INFO 07:44:22,615 Finished reading /home/cassandra/commitlog/CommitLog-1353080634664.log

 INFO 07:44:22,616 Replaying /home/cassandra/commitlog/CommitLog-1353080634663.log

 INFO 07:44:22,655 Finished reading /home/cassandra/commitlog/CommitLog-1353080634663.log

 INFO 07:44:22,687 Enqueuing flush of Memtable-Versions@19288329(83/103 serialized/live bytes, 3 ops)

 INFO 07:44:22,692 Writing Memtable-Versions@19288329(83/103 serialized/live bytes, 3 ops)

 INFO 07:44:22,742 Completed flushing /home/cassandra/data/system/Versions/system-Versions-hf-2-Data.db (247 bytes) for commitlog position ReplayPosition(segmentId=1353080662588, position=0)

 INFO 07:44:22,750 Log replay complete, 3 replayed mutations

 INFO 07:44:22,777 Cassandra version: 1.1.6

 INFO 07:44:22,777 Thrift API version: 19.32.0

 INFO 07:44:22,780 CQL supported versions: 2.0.0,3.0.0-beta1 (default: 2.0.0)

 INFO 07:44:22,846 Loading persisted ring state

 INFO 07:44:22,849 Starting up server gossip

 INFO 07:44:22,856 Enqueuing flush of Memtable-LocationInfo@29499086(29/36 serialized/live bytes, 1 ops)

 INFO 07:44:22,859 Writing Memtable-LocationInfo@29499086(29/36 serialized/live bytes, 1 ops)

 INFO 07:44:22,871 Completed flushing /home/cassandra/data/system/LocationInfo/system-LocationInfo-hf-7-Data.db (80 bytes) for commitlog position ReplayPosition(segmentId=1353080662588, position=363)

 INFO 07:44:22,892 Starting Messaging Service on port 7000

 INFO 07:44:22,904 Using saved token 77712367279614969246272394525491308416

 INFO 07:44:22,911 Enqueuing flush of Memtable-LocationInfo@12254719(53/66 serialized/live bytes, 2 ops)

 INFO 07:44:22,917 Writing Memtable-LocationInfo@12254719(53/66 serialized/live bytes, 2 ops)

 INFO 07:44:22,944 Completed flushing /home/cassandra/data/system/LocationInfo/system-LocationInfo-hf-8-Data.db (163 bytes) for commitlog position ReplayPosition(segmentId=1353080662588, position=544)

 INFO 07:44:22,959 Node master/192.168.0.20 state jump to normal

 INFO 07:44:22,960 Bootstrap/Replace/Move completed! Now serving reads.


3.끝내는 방법

cassandra@ubuntu:~$ pkill -f 'java.*cassandra'

쉽다 너무..@.@


다음번에는 Cassandra의 Key,Column,Value에 대해서 설명하고 사용하는 것에 대해서 이야기하겠습니다.


블로그 이미지

커뉴

이 세상에서 꿈 이상으로 확실한 것을, 인간은 가지고 있는 것일까?

,

언제 부터인가 우분투에서는 openJDK가 기본으로 설치되고, /usr/bin/java도 기본으로 openJDK를 사용하도록 되어 있다.


Oracle에서 제공하는 Sun JDK를 설치하고 나서 기본 설정을 바꿔주기 위해서는 아래와 같이 하면 끝난다.(패스를 설정해줄수도 있지만)


/usr/local/java-6-sun 에 Sun JDK를 설치했다고 가정함.


nuke@ubuntu:~$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java-6-sun/bin/java" 1


nnuke@ubuntu:~$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java-6-sun/bin/javac" 1

update-alternatives: using /usr/local/java-6-sun/bin/javac to provide /usr/bin/javac (javac) in auto mode.


nuke@ubuntu:~$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java-6-sun/bin/javaws" 1

update-alternatives: using /usr/local/java-6-sun/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode.


nuke@ubuntu:~$ sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).


  Selection    Path                                           Priority   Status

------------------------------------------------------------

* 0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode

  1            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode

  2            /usr/local/java-6-sun/bin/java                         1         manual mode


Press enter to keep the current choice[*], or type selection number: 2

update-alternatives: using /usr/local/java-6-sun/bin/java to provide /usr/bin/java (java) in manual mode.


nuke@ubuntu:~$ java -version

java version "1.6.0_37"

Java(TM) SE Runtime Environment (build 1.6.0_37-b06)

Java HotSpot(TM) Client VM (build 20.12-b01, mixed mode, sharing)


이전에는 패스를 설정해서 oracle java가 먼저 실행되도록 했었지만, 기왕이면 설정을 등록하고 디폴트 설정을 선택할수 있으니 앞으로는 이와 같은 방법을 사용하여 더 편하게 사용하면 된다.

블로그 이미지

커뉴

이 세상에서 꿈 이상으로 확실한 것을, 인간은 가지고 있는 것일까?

,