itsuugo commented on issue #328: Docker image: add a Docker Compose example file URL: https://github.com/apache/bookkeeper/issues/328#issuecomment-341963509 @ivankelly I was trying to follow your tutorial using the docker compose file in #701 but I'm facing several issues. ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d27578fa2b35 caiok/bookkeeper-tutorial "/bin/sh -c '/bin/..." 7 minutes ago Up 7 minutes docker_dice_4 0be4e70a0add caiok/bookkeeper-tutorial "/bin/sh -c '/bin/..." 37 minutes ago Up 2 minutes docker_dice_2 001e5c0f9282 caiok/bookkeeper-tutorial "/bin/sh -c '/bin/..." 37 minutes ago Up 2 minutes docker_dice_3 277e59f29faa caiok/bookkeeper-tutorial "/bin/sh -c '/bin/..." 37 minutes ago Up 3 minutes docker_dice_1 43d787a08991 bookkeeper "/bin/bash /opt/bo..." 37 minutes ago Up 37 minutes (healthy) 3181/tcp docker_bookkeeper_2 ff2100d20ed5 bookkeeper "/bin/bash /opt/bo..." 37 minutes ago Up 37 minutes (healthy) 3181/tcp docker_bookkeeper_1 789ba349a4cc zookeeper:3.4.9 "/docker-entrypoin..." 37 minutes ago Up 37 minutes 2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp docker_zookeeper_1 ``` If I start the dices containers at the same time that the application, they fail with the following error: ```bash + java -jar /local/bookkeeper-tutorial.jar --zookeeper-servers zookeeper:2181 Zookeeper Server: zookeeper:2181 log4j:WARN No appenders could be found for logger (org.apache.curator.CuratorZookeeperClient). log4j:WARN Please initialize the log4j system properly. Connecting to Zookeeper Server... Connected. Exception in thread "main" org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /ledgers/available/readonly at org.apache.zookeeper.KeeperException.create(KeeperException.java:111) at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783) at org.apache.bookkeeper.client.BookieWatcher$ReadOnlyBookieWatcher.<init>(BookieWatcher.java:264) at org.apache.bookkeeper.client.BookieWatcher.<init>(BookieWatcher.java:85) at org.apache.bookkeeper.client.BookKeeper.<init>(BookKeeper.java:219) at org.apache.bookkeeper.Dice.<init>(Dice.java:54) at org.apache.bookkeeper.Dice.main(Dice.java:269) ``` However, if I run the `docker-compose up `and, once everything is working, I run new dice containers I'm able to see how the clients change from follower to leader, but I can't see in the logs the value of the dice. Docker dice_4 is not the leader ```bash $ docker logs docker_dice_4 + java -jar /local/bookkeeper-tutorial.jar --zookeeper-servers zookeeper:2181 Zookeeper Server: zookeeper:2181 log4j:WARN No appenders could be found for logger (org.apache.curator.CuratorZookeeperClient). log4j:WARN Please initialize the log4j system properly. Connecting to Zookeeper Server... Connected. Follow ``` Restart dice 1 2 and 3 ``` $docker restart docker_dice_1; docker restart docker_dice_2; docker restart docker_dice_3 docker_dice_1 docker_dice_2 docker_dice_3 ``` Now, dice4 is the leader but can't see any value ``` $ docker logs docker_dice_4 + java -jar /local/bookkeeper-tutorial.jar --zookeeper-servers zookeeper:2181 Zookeeper Server: zookeeper:2181 log4j:WARN No appenders could be found for logger (org.apache.curator.CuratorZookeeperClient). log4j:WARN Please initialize the log4j system properly. Connecting to Zookeeper Server... Connected. Follow Becoming leader ```
---------------------------------------------------------------- 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
