For the purposes of this chapter, as described earlier, we will use docker-compose up to bring the replica set members online. As our replica set consists of Docker containers, we can create a simple shell script (/path/to/repo/chapters/13/verify_connections.sh) to confirm connectivity between members:
#!/bin/bash
docker exec learn-mongo-member-1 /bin/bash -c "ping -c1 member2.biglittle.local"
docker exec learn-mongo-member-2 /bin/bash -c "ping -c1 member3.biglittle.local"
docker exec learn-mongo-member-3 /bin/bash -c "ping -c1 member1.biglittle.local"
Here is the expected output from this sequence of ping commands:
If it appears that the members are not able to ping each other, confirm that the network configuration in the docker-compose.yml file is correctly stated. Also, confirm that Docker is installed correctly on the development server, and that Docker has set up its own internal virtual network. Next,...