Storm 탄성 계산: 실시 간 으로 토폴로지 병발 수 조정

오리지널 글 을 전재 할 필요 가 있 으 면 출처 를 밝 혀 주 십시오.http://blog.csdn.net/jmppok/article/details/17143373
Storm 계산 은 topology 단위 로 topology 를 Storm 클 러 스 터 에 제출 하여 실행 한 후 storm rebalance 명령 을 통 해 topology 를 동적 으로 조정 할 수 있 습 니 다.예 를 들 어 Topology 의 worker 수 를 늘 리 고 Bolt, Spout 의 병행 집행 수량 parallelism 등 을 수정 하여 토폴로지 의 동적 조정 을 실현 하고 탄력 적 인 계산 목적 을 달성 하 는 것 이다.(물론 조정 시 모니터링 모듈 에 맞 춰 야 한다)
storm help rebalance 를 통 해 rebalance 의 도움말 정 보 를 얻 을 수 있 습 니 다:
ligh@ubuntu:~/workspace/storm_drpc_test/bin$ storm help rebalance
Syntax: [storm rebalance topology-name [-w wait-time-secs] [-n new-num-workers] [-e component=parallelism]*]

    Sometimes you may wish to spread out where the workers for a topology 
    are running. For example, let's say you have a 10 node cluster running 
    4 workers per node, and then let's say you add another 10 nodes to 
    the cluster. You may wish to have Storm spread out the workers for the 
    running topology so that each node runs 2 workers. One way to do this 
    is to kill the topology and resubmit it, but Storm provides a "rebalance" 
    command that provides an easier way to do this.

    Rebalance will first deactivate the topology for the duration of the 
    message timeout (overridable with the -w flag) and then redistribute 
    the workers evenly around the cluster. The topology will then return to 
    its previous state of activation (so a deactivated topology will still 
    be deactivated and an activated topology will go back to being activated).
    
    The rebalance command can also be used to change the parallelism of a running topology.
    Use the -n and -e switches to change the number of workers or number of executors of a component
    respectively.

기본적으로 주로 두 가지 용법 이 있다.
1) storm rebalance  topology-name -n   new-work-num,
  지정 한 토폴로지 의 워 크 넘 을 조정 합 니 다.
2)storm rebalance topology-name -e  component=parallelism
  지정 한 토폴로지 에서 지정 한 component 의 병렬 수량 을 조정 합 니 다.

좋은 웹페이지 즐겨찾기