[couchbase] bucket 복사하기

주의  : 개발 테스트로 진행한 것. Production에서 사용할 수 있는 지는 확인이 필요하다

단순히 내 개발 머신에서 bucket 복사를 하고 싶었음. 버킷 생성할 때 다른 버킷을 기반으로 생성할 수 있는 방법이 없다.

백업하고

cbbackup.exe http://localhost:8091 백업을_저장할_폴더_경로 --single-node -b 백업할_버킷이름

리스토어하면 된다

cbrestore.exe --bucket-source 백업한_버킷이름 --bucket-destination 데이터를_풀_버킷_이름 백업을_저장한_폴더_경로 http://localhost:8091

reference
http://docs.couchbase.com/admin/admin/Tasks/restore-cbrestore.html

[couchbase/n1ql] select 결과를 insert 하기

sql 과 비슷하다.

INSERT INTO 버킷이름 (KEY k_alias, VALUE v_alias) select ‘test_key::001’ as k_alias, {‘member’ : ‘value’} as v_alias

http://developer.couchbase.com/documentation/server/4.0/n1ql/n1ql-language-reference/insert.html
http://developer.couchbase.com/documentation/server/4.1-dp/developer-guide/covering-indexes.html

PS : document에 예제 좀 많이 넣어주면 좋겠다.

[couchbase] 4.0 잘쓰고 있었는데 indexer 랑 cbq-engine이 없어졌다?

개인 개발 머신에서 indexer와 cbq-engine이 안뜸.. (아니 한동안 잘 썼다고!!)

  • 재시작해도 안올라옴
  • 검색해봐도 별 얘기 없음
  • 다시 설치해도 안올라옴
  • 하나하나 해볼 수 없어서, 막 던져봄
    • cb4.0 삭제 후 레지스트리에서 couchbase 관련 키 삭제
    • program files / couchbase 폴더 삭제
    • 설치 시 안티바이러스 off (프로세스에 kasper 어쩌구가 계속 떠있는 것으로 봐선 내가 내린 건 설정 UI 프로세스인가..)
    • 다시 설치 시 index replicas 체크
  • 이렇게 하고 나선 다시 설치했을 때 indexer 랑 cbq-engine 이랑 다시 돌아옴 =_=;;;
  • 다시 테스트 해보기는 귀찮으니 다음에 또 이러면 하나씩 해보겠다

[python] owyl 프로젝트를 python 3 에서 실행하자

owyl : A python behavior tree for implementing fast and flexible AI

owyl은 파이썬용 행동트리 구현체다. 행동트리를 이해하는 데 시각화된 예제가 필요하여 실행해보았다. (치즈샵에서 behavior tree 로 유일하게 검색된 이유이기도 하고..) 한동안 업데이트가 없는 것을 보니 앞으로도 없을 듯 하다. 약간의 감상평을 하자면 코루틴 없이 generator 로만 코딩을 해서 그런지 복잡하더라.

python 3 에서 실행해보기 위해 진행한 것을 기록한다. python 3 전용으로 실행하기 위해 살짝 변경 해놓은 소스를 이곳1에 올려놨음. for_python_3 브랜치를 이용하면 된다.

  1. examples/boids.py 를 python 3.4.3 에서 실행하면 pyglet2을 임포트할 수 없다는 에러가 발생
    (https://bitbucket.org/pyglet/pyglet/wiki/Home)
  2. pyglet 설치하자

    pip install pyglet

  3. 다시 boids.py 를 실행하면 cocos 를 임포트할 수 없다는 에러가 발생
  4. cocos3 를 설치하자

    pip install cocos2d

  5. 다시 boids.py 를 실행하면 rabbyt 를 임포트할 수 없다는 에러가 발생
  6. rabbyt4 를 설치하자

    pip install Rabbyt

  7. 다음의 에러를 출력하고 설치 실패

    File “<string>”, line 20, in <module>
    File “C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-ukorogxl\Rabbyt\setup.py”, line 17
    print “*”*80
    ^
    SyntaxError: Missing parentheses in call to ‘print’

  8. Rabbyt 가 python 3.x 를 지원안해서 설치가 안되는 것. 홈페이지5를 가보니 더 이상 개발을 종료하였고, lib2d 를 대신 만들고 있는데 Rabbyt 와 호환이 안된다고 한다. 다행하게도 Ryex 라는 사람이 Rabbyt 의 python 3 포팅을 했다.
  9. https://github.com/Ryex/Rabbyt 로 다시 설치. github 에 있는 download zip 버튼의 링크를 install 뒤에 쓰면 된다.
    pip install https://github.com/Ryex/Rabbyt/archive/master.zip
  10. 다음의 에러를 출력하고 설치 실패

    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File “<string>”, line 20, in <module>
    File “C:\Users\ADMINI~1\AppData\Local\Temp\pip-u1mmdmpo-build\setup.py”, line 6, in <module>
    from Cython.Distutils import build_ext
    ImportError: No module named ‘Cython’

  11. python 3 이상 버전은 cython이 필요하다. (from https://github.com/Ryex/Rabbyt )
  12. cython 설치하자

    pip install cython

  13. Ryex/Rabbyt 다시 설치

    pip install https://github.com/Ryex/Rabbyt/archive/master.zip

  14. 다음의 에러를 출력하고 설치 실패

    …위에 한참 있음 …
    File “C:\venv\for_owyl\lib\site-packages\setuptools\msvc9_support.py”, line 52, in query_vcvarsall
    return unpatched[‘query_vcvarsall’](version, *args, **kwargs)
    File “D:\Python343\Lib\distutils\msvc9compiler.py”, line 287, in query_vcvarsall
    raise ValueError(str(list(result.keys())))
    ValueError: [‘lib’, ‘path’, ‘include’]

  15. 각을 보니 windows sdk command shell 에서 진행을 해야 할 듯. 일단 나는 windows sdk 7.1 을 설치했으니 “Windows SDK 7.1 Command Prompt” 를 실행하여 다시 13을 실행 -> 설치됨
  16. examples/boids.py 를 실행하면 끝.
  1. https://github.com/kernel0/owyl.git
  2. pyglet: a cross-platform windowing and multimedia library for Python
  3. cocos : a 2D framework for games and multimedia
  4. rabbyt : A fast 2D sprite engine using OpenGL
  5. rabbyt website : http://arcticpaint.com/projects/rabbyt/