docker-compose up 커맨드는 모든 서비스를 결합한 표준 출력을 리턴한다. 


모든 로그의 표준 출력을 본다해도 거의 도움이 되지 않아서 


docker-compose up -d를 사용하는 것이 더 나은 선택이다. 


docker-compose up -d 커맨드를 사용하면 표준 출력을 리턴하지 않는다. 


https://docs.docker.com/compose/reference/up/

Posted by '김용환'
,



zookeeper 클러스터에 zookeeper 신규 서버 추가하기


아래 github gist를 참고하면 좋을 것 같다. 

(3.4 이후에서 잘 동작한다)

https://gist.github.com/miketheman/6057930


추가적으로 zookeeper 클러스터의 서버 대수보다 더 많은 서버 대수를 추가할 때는 조심하는 게 좋을 것 같다. 

항상 쿼럼을 유지해야 하니까..




정상적으로 클러스터링되었는지 확인하는 방법은 3가지가 있다.


1. 로그 파일을 통해 확인 (클러스터링 장비 중 하나에서 zookeeper 재시작 시  에러 난다)

zookeeper.log 


2. 각 장비의 data file system 파일이 동일하다. 


3. 다음 커맨드를 실행해서 클러스터링 상태를 확인할 수 있다.


상태 정보와 함께 Zxid, follower


$ echo stat | nc 장비 2181


Latency min/avg/max: 0/0/0

Received: 2

Sent: 1

Connections: 1

Outstanding: 0

Zxid: 0xa00000160

Mode: follower

Node count: 11467





이전 커맨드를 실행시 zookeeper 에서 다음 커맨드 에러가 발생한다면.. 정상적이지 않다는 것이다.


This ZooKeeper instance is not currently serving requests


https://github.com/apache/zookeeper/search?utf8=%E2%9C%93&q=ZK_NOT_SERVING&type=



다양한 원인이 있는데. 지금 제대로 동기가 안된 거일 수 있다. 그러나 다른 장비는 정상적이라면..

config/zoo.cfg 이슈일지 꼼꼼히 살펴본다.

Posted by '김용환'
,


YAML의 문자열(string)은 일반적으로 다음처럼 사용한다.







1
2
3
4
5
A string in YAML

'A singled-quoted string in YAML'

"A double-quoted string in YAML"



multi-line은 어떻게 표시할까? (사실 이번에 처음 알았다.. YAML에 multi line이 있을 줄이야..)

pipe(|) 또는 >를 사용한다. 



When a string contains line breaks, you can use the literal style, indicated by the pipe (|), to indicate that the string will span several lines. In literals, newlines are preserved:

1
2
3
|
  \/ /| |\/| |
  / / | |  | |__

Alternatively, strings can be written with the folded style, denoted by >, where each line break is replaced by a space:

1
2
3
4
5
>
  This is a very long sentence
  that spans several lines in the YAML
  but which will be rendered as a string
  without carriage returns.



출처 : http://symfony.com/doc/current/components/yaml/yaml_format.html

Posted by '김용환'
,


zookeeper node에 ttl 기능이 생길 예정이다. 아직 릴리즈 되지 않은 3.6.0에 추가되었다. 



https://issues.apache.org/jira/browse/ZOOKEEPER-1925


Here are only some problems with app-level cleaning:
– Slow for large trees. If the network latency is high it takes a very long time for the app to walk whole tree (e.g. 1M nodes).
– Risky. If the cleanup application crash (or becomes unreachable) it puts whole ZK cluster to danger.
– The implementation might be error-prone if multiple cleanup threads are used.

– Has to be implemented separately by each developer (until a proven implementation shared as a library).


여러 이슈가 있어서. 3.6.0으로 미룬 상태이다..


zookeeper에 ttl이 있고 성능만 좋다면 앞으로 많이 사용할 듯 싶다. 



Posted by '김용환'
,