Skip to content

Commit

Permalink
Doc change: Added troubleshooting section for knife search (#8724)
Browse files Browse the repository at this point in the history
* adding knife troubleshooting section.

Signed-off-by: talktovikas <vikas.yadav@progress.com>

* fixing Punctuations

Signed-off-by: talktovikas <vikas.yadav@progress.com>

* rewording docs.

Signed-off-by: talktovikas <vikas.yadav@progress.com>

* reviewed and fixed

Signed-off-by: Dishank Tiwari <dtiwari@progress.com>

---------

Signed-off-by: talktovikas <vikas.yadav@progress.com>
Signed-off-by: Dishank Tiwari <dtiwari@progress.com>
Co-authored-by: Dishank Tiwari <dtiwari@progress.com>
  • Loading branch information
talktovikas and dishanktiwari2501 authored Jan 7, 2025
1 parent 483aa28 commit 04f0f33
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions components/docs-chef-io/content/automate/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,46 @@ max_shards_per_node = 1000
```

Once done, run the chef-automate config patch `</path/to/your-file.toml>` to deploy your change.

## Issue: Knife search limits at 10000 records

### Details

The knife node list and knife node search commands are inconsistent in the number of records they return. By default, knife search returns a maximum of 10,000 records.

### Fixes

This issue occurs because OpenSearch, by default, limits the maximum number of records (or documents) returned in a single query to 10,000. This safeguard prevents large queries from overloading the system. This approach will do that if you try to retrieve more than 10,000 records.

#### Step 1: Increase the max_result_window to retrieve more than **10000** records.

In the case of embedded opensearch:

```bash
curl -XPUT "http://127.0.0.1:10144/chef/_settings" \
-d '{
"index": {
"max_result_window": 50000
}
}' \
-H "Content-Type: application/json"
```

Changes can be verified by doing the following:

```bash
curl http://127.0.0.1:10144/_settings?pretty
```

For external OpenSearch, ensure the `max_result_window` is also increased accordingly.

#### Step 2: Patch the config in Automate

To set the value of tracking total hits in OpenSearch, patch the following configuration in the `.toml` file.

```bash
[erchef.v1.sys.index]
track_total_hits = true
```

Once done, run the chef-automate config patch `</path/to/your-file.toml>` to deploy your change.

0 comments on commit 04f0f33

Please sign in to comment.