aojea commented on issue #328: Docker image: add a Docker Compose example file
URL: https://github.com/apache/bookkeeper/issues/328#issuecomment-350436134
 
 
   @jiazhai I hardcoded 3 bookies in the docker compose because of the next 
reasons:
   1. Lazy users like me :) don't use to RTFM and will not notice that the 
[minimum number of bookies is 
3](http://bookkeeper.apache.org/docs/master/bookkeeperConfig.html) and can be 
trying the example without any success, giving a false impression that 
something is wrong.
   
   2. To be able to pass the bookie IP as a parameter to the docker  `dice`  I 
leverage the docker-compose `link` feature. Using the scale approach the name 
used in the `links`section doesn't work because the names of the containers 
change, hence the `wait for` script in the `dice`client fails. 
   
   However, you still can scale the number of bookkeepers selecting one of the 
bookies:
   
    `docker-compose up -d --scale dice=3 --scale bookie1=3`
   
   this gives you 5 bookies (3 bookie1 + 1 bookie2 + 1 bookie3) and 3 dices:
   
   ```
   docker-compose up -d --scale dice=3 --scale bookie1=3
   docker_zookeeper_1 is up-to-date
   docker_bookie3_1 is up-to-date
   Starting docker_bookie1_1 ... 
   Starting docker_bookie1_1 ... done
   Starting docker_dice_1 ... 
   Starting docker_dice_1 ... done
   Creating docker_bookie1_3 ... 
   Creating docker_dice_2 ... 
   Creating docker_dice_3 ... 
   Creating docker_bookie1_3
   Creating docker_bookie1_2
   Creating docker_bookie1_2 ... done
   Creating docker_dice_3 ... done
   ```
   
   
   I think that a more elegant solution to the tutorial could be adding the 
wait logic in the dice itself, using zookeeper for the autodiscovery and 
waiting until the ensemble is ready, but it can be left as a good exercise for 
new developers ;)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to