Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
 scl enable rh-mongodb36 "mongo -u root -p'**REDACTED**' --authenticationDatabase admin --eval 'rs.status()'"


Code Block
[root@clortho ~]# ansible mongodb_stageansible mongodb_stage -m shell -a  "scl enable rh-mongodb36 $'mongo -u root -p \'REDACTED1P\' --authenticationDatabase admin --eval \'rs.status()\' '" 


Code Block
[root@siomongo1-stage ~]# scl enable rh-mongodb36 "mongo -u root -p'REDACTED1P' --quiet --authenticationDatabase admin --eval 'JSON.stringify(rs.status())'"  | jq '.'


Let's find the state of the cluster nodes and which one is primary

Code Block
scl enable rh-mongodb36 "mongo -u root -p'REDACTED' --quiet --authenticationDatabase admin --eval 'JSON.stringify(rs.status())'" \
| jq -C '.members[] | [.name, .stateStr]'


THIS ONE BELOW WORKS!!!!

Code Block
ansible siomongo1-stage.ucsd.edu -m shell -a  "scl enable rh-mongodb36 $'mongo -u root -p \'REDACTED1P\' --quiet --authenticationDatabase admin --eval \'JSON.stringify(rs.status())\' '" 

 | jq '.members[] | [.name, .stateStr]'"


There are some in-progress scripts on root@clortho:~/mongo-scripts. The following ENV variable must be set to see output

Code Block
ANSIBLE_STDOUT_CALLBACK="minimal"



Info

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@a51
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ( "peopledb" , "high-availability" , "ha" , "mongo" , "nosql" , "database" , "cluster" , "peopledb3" , "replication" , "mongodb" ) and type = "page" and space = "SD"
labelspeopledb peopledb3 mongo mongodb nosql database cluster replication ha high-availability

...