Version
Domino v4.6 - 5x
Identifying the correct MongoDB Instance:
As of Domino 4.6, the platform namespace contains a separate DMM mongo.
The mongo pods mongodb-replicaset-X pods deployed by the mongodb-replicaset stateful set are the Domino data science platform mongodb. The mongo pods identified as mongodb-arbiter-X, monogdb-primary-0 and mongodb0-secondary-0 deployed by their respective stateful sets are part of the DMM deployment. This article references how a Domino admin with backend kubernetes access can gain access to the DMM MongoDB:
Step 1: Retrieving credentials and decoding
Note: Backend admin kubernetes access is required to run the commands below:
This command:
~# kubectl get secret -n $DOMINO_PLATFORM domino-dmm-mongodb -o go-template='{{.data.mongo_db_password | base64decode}}'; echo
can be used to retrieve and decode the MongoDB password secret stored in Kubernetes
Breaking the command down, It does the following:
get secret domino-dmm-mongodb
- Obtains the secret containing MongoDB credentials-n $DOMINO_PLATFORM
- Specify the namespace where this secret is stored, referencing the platform namespace-o go-template='...'
- Using a Go template, renders the secret.{{.data.mongo_db_password}}
- Accesses the mongo_db_password field in the secret data| base64decode}}
- Pipes the value through base64 decoding to get the actual password; echo
- Prints the decoded password to stdout
Step 2: Accessing the DMM MongoDB Shell:
This command connects to the kubernetes DMM MongoDB pod and opens the MongoDB shell.
~# kubectl exec -it -n $DOMINO_PLATFORM mongodb-primary-0 bash
I have no name!@mongodb-primary-0:/$ mongo -u admin model-monitor
[enter password from step 1 decode]
rs0:PRIMARY> [run mongodb commands]
Breaking it down:
kubectl exec -it mongodb-primary-0 bash
- Executes an interactive bash shell in the mongodb-primary-0 pod
-it
allocates a TTY for interactive use- -n define $DOMINO_PLATFORM namespace
mongo -u admin model-monitor
- Connects to the MongoDB server from inside the pod
-u admin
authenticates as the 'admin' usermodel-monitor
specifies the database name
At this point, it will prompt for the MongoDB password which needs to be entered (see step 1 for decoded password)
rs0:PRIMARY>
- This shows we've connected to the primary MongoDB node in replica set rs0.
- We can now run MongoDB shell commands interactively.
Comments
0 comments
Please sign in to leave a comment.