...
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" |
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@a51 |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label in ( "peopledb" , "high-availability" , "ha" , "mongo" , "nosql" , "database" , "cluster" , "peopledb3" , "replication" , "mongodb" ) and type = "page" and space = "SD" |
---|
labels | peopledb peopledb3 mongo mongodb nosql database cluster replication ha high-availability |
---|
|
...