Verify Your mongot Connection

For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

Verify Your mongot Connection

Use the tutorial on this page to verify that your mongot deployment is active and connected to your MongoDB Community deployment.

Before You Begin

Install MongoDB Community and MongoDB Search. For installation tutorials, see [Install MongoDB Community Edition](https://www.mongodb.com/docs/manual/administration/install-community.md#std-label-install-mdb-community-edition and [Procedure.](https://www.mongodb.com/docs/search/self-managed/current/installation/linux.md#std-label-community-search-deploy

Steps

  1. Verify that your mongot instance is active.

To check the status of your mongot instance, run one of the following commands in your terminal, based on your installation method:

##### Tarball or systemd

shell ps aux | grep '[m]ongot'

If mongot is active, this command returns the mongot process with a reference to your configuration file.

##### Container

```shell # standalone mongot container docker ps --filter "name="

# atlas-local docker ps --filter "ancestor=mongodb/mongodb-atlas-local" ```

If mongot is active, this command returns the active container.

  1. Verify the health of your mongot instance.

To check the health of your mongot instance, use the /health and /ready endpoints.

To check if mongot is live, curl against the /health endpoint:

Note:

The default healthCheck address is localhost:8080. However, you can define the address in the [healthCheck.address](https://www.mongodb.com/docs/search/self-managed/current/configuration/reference.md#mongodb-setting-healthCheck.address option in your mongot configuration file.

shell curl localhost:8080/health

The endpoint returns one of the following responses:

  • {“status”:“SERVING”}, if the mongot process is running.

  • {“status”:“NOT_SERVING”}, if the mongot process isn't running.

To check if mongot is ready for queries, curl against the /ready endpoint:

shell curl localhost:8080/ready

The endpoint returns one of the following responses:

  • {“status”:“SERVING”}, if the mongot process is ready for queries.

  • {“status”:“NOT_SERVING”}, if the mongot process isn't ready for queries.

  • Check mongot Prometheus metrics.

If you enabled the Prometheus metrics endpoint in your mongot configuration file, curl the /metrics endpoint to retrieve process-level metrics:

shell curl localhost:9946/metrics

Note:

The default metrics address is localhost:9946. To use a different address, set the [metrics.address](https://www.mongodb.com/docs/search/self-managed/current/configuration/reference.md#mongodb-setting-metrics.address option in your mongot configuration file.

To view the state of search index replication, filter for the mongot_replication_mongodb_indexManagerState metric:

shell curl -s localhost:9946/metrics | grep -E \ "^(# (HELP|TYPE) mongot_replication_mongodb_indexManagerState|mongot_replication_mongodb_indexManagerState)"

  1. Verify that index management is active.

To verify that index management is active, run a search index management method against any collection.

For example, the following command checks if any search indexes exist on a movies collection:

javascript db.movies.getSearchIndexes()

If the operation succeeds without an error, index management is functional.

  1. Run a search query.

Run an end-to-end search query to confirm that the full query path is functional.

For example, create a test collection with a search index:

```javascript db.test.insertMany([ { name: "alpha" }, { name: "beta" }, { name: "alphabet" } ])

db.test.createSearchIndex( "verify-index", { mappings: { dynamic: true } } ) ```

Verify that MongoDB builds the index:

javascript db.test.getSearchIndexes()

The index is ready for queries if the command returns the following response:

javascript status: 'READY', queryable: true,

Then, run a search query:

javascript db.test.aggregate([ { $search: { index: "verify-index", text: { query: "alpha", path: "name" } } } ])

A successful query confirms that you configured mongod and mongot correctly.

For troubleshooting your mongot and mongod connection, see [Troubleshoot MongoDB Search for Self-Managed Deployments.](https://www.mongodb.com/docs/search/self-managed/current/limitations.md#std-label-mongot-limitations

Next Steps