I used two machines to build ZooKeeper cluster. Then I have following questions:
(1) After configuration, and start Zookeeper separately on each machine, they work as follows: machine A is showed as follower, machine B is leader. But I have set machine A as server.1 and machine B as server.2. I wonder how ZooKeeper chose the leader and follower
(2) Then I run "zkServer.sh stop" on Machine B ,then run "zkServer.sh status" on Machine A, and found en error "Error contacting service. It is probably not running." The expected behaviour should be that machine A will change from follower to leader, right? But why it is failed. And after I start again on machine B, then running "zkServer.sh status" on Machine A will get the message that machine A is follower
So what's wrong? Can two machines not be used for ZooKeeper cluster, and at lease 3 machines? Did I made a wrong cofiguration?