'mongoDB'에 해당되는 글 2건

카테고리 없음

YCSB는 Mongodb를 싫어하는 것 같다.

일단 위의 문제로 인하여 많은 사람들이 노가다를 하고 있는데 ...
버전이 업그레이드 되면서 ObjectID를 체크하는 부분이 변경되어서 24byte를 맞추도록 되었는 것인지
원래 그랬던 것인지 정확한 history는 알 수 없지만...
어쨋든 문제는 MongoDbClient.java의 read, update, insert , delete 함수 내에 아래 코드 때문이다.

간단히 설명하자면 아래 코드는 _id 키에 ObjectId를 key 문자열로 생성해서 넣어주는 것인데
이게 ObjectId 객체가 안에서 받은 값을 24글자가 맞는지, 알파벳이나 숫자의 연속으로 이루진 것인지 조사를 한다.
조건에 해당되지 않으면 미친 에러를 방출
결론은...아래와 같이 변경해주고 다시 컴파일 ant clean : ant : ant dbcompile-mongodb
그럼 이제 에러가 나지 않고~ 잘될 것이다.
read, update, insert, delete 모두 수정해주자..
여기서 또 주의할 것이.. insert만 제길 DBObject q 로 선언안하고 DBObject r로 선언되어있다. 복사해서 붙여넣기 할 때 조심하자..

Before - DBObject q = new BasicDBObject().append("_id", new ObjectId(key));

After - DBObject q = new BasicDBObject(); q.put("user", key);

조만간 YCSB를 이용한 mongodb 성능테스트에 대한 글을 포스팅 해봐야겠군...

카테고리 없음
mongodb를 source로 컴파일해서 사용할려고 하면 아래와 같은 warning이 등장한다.

"warning: some regex utf8 things will not work.  pcre build doesn't have --enable-unicode-properties"

아래와 같이 확인 해보면 "No Unicode properties support" 라고 확인할 수 있다.
# pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
  UTF-8 support
  No Unicode properties support
  Newline character is LF
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack
rpm으로 pcre를 업그레이드해서 unicode를 support 하도록 해보자.
상세 내용은 아래 링크에서 참조할 수 있다.
http://chrisjean.com/2009/01/31/unicode-support-on-centos-52-with-php-and-pcre/
wget으로 rpm을 다운 받자.
# wget http://vault.centos.org/5.1/updates/SRPMS/pcre-6.6-2.el5_1.7.src.rpm
rpm을 풀어서 소스를 수정
# rpm -ivh pcre-6.6-2.el5_1.7.src.rpm
vi로 pcre.spec을 수정
# vi /usr/src/redhat/SPECS/pcre.spec
%configure --enable-utf8 <- 이렇게만 되어있는 곳에 --enable-unicode-properties를 추가하자
"%configure --enable-utf8 --enable-unicode-properties"



 
rpm을 다시 빌드하자
# rpmbuild -ba /usr/src/redhat/SPECS/pcre.spec
rpm 설치
# rpm -Uvh /usr/src/redhat/RPMS/i386/pcre-6.6-2.7.i386.rpm /usr/src/redhat/RPMS/i386/pcre-devel-6.6-2.7.i386.rpm
확인
# pcretest -C




PCRE version 6.6 06-Feb-2006
Compiled with
  UTF-8 support
  Unicode properties support
  Newline character is LF
  Internal link size = 2
  POSIX malloc threshold = 10
  Default match limit = 10000000
  Default recursion depth limit = 10000000
  Match recursion uses stack

1
블로그 이미지

개발자

우와신난다