Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Created July 11, 2018 20:47
Show Gist options
  • Save sarjarapu/59ce8866372b863d35a891e4773ace07 to your computer and use it in GitHub Desktop.
Save sarjarapu/59ce8866372b863d35a891e4773ace07 to your computer and use it in GitHub Desktop.
A bash script showing the connectivity to the MongoDB replica set member via mongo shell
kubectl -n ${K8_NAMESPACE} exec -it ${K8_NAMESPACE}-replicaset-0 -- bin/bash
# mongodb@mongodb-world-replicaset-0:/$
/var/lib/mongodb-mms-automation/mongodb-linux-x86_64-3.6.5/bin/mongo
# MongoDB shell version v3.6.5
# connecting to: mongodb://mongodb-world-replicaset-0:27017/
# MongoDB server version: 3.6.5
# mongodb-world-replicaset:PRIMARY>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment