Modifying Cluster Parameters
When using an OpenSearch cluster, you may need to adjust cluster behavior based on service requirements. For example, frontend applications may need to access cluster APIs across domains, query performance may need to be optimized by adjusting the cache, or the OpenSearch Dashboards session timeout may need to be extended. CSS allows you to modify the opensearch.yml, opensearch_dashboards.yml, and system.config configuration files online to flexibly adjust core cluster parameters and visualization platform parameters. You can use this feature for scenarios such as configuring cross-domain access, optimizing query performance, and customizing OpenSearch Dashboards behavior.
Configuration File Description
A CSS cluster relies on the following configuration files. Each file has a different purpose and modification method, and changes to one file do not affect the others. You must modify them separately.
| Configuration File | Configuration Range | When Changes Take Effect |
|---|---|---|
| opensearch.yml | Core cluster configuration parameters, including cross-origin access, index reindexing, query caching, and thread pools. | After modification, all nodes load the new configuration when the cluster is manually restarted. |
| opensearch_dashboards.yml | Independent configuration parameters for OpenSearch Dashboards, the visualization platform, such as session timeout, default redirect page, and user interface display. | After modification, only OpenSearch Dashboards loads the new configuration when it is restarted. Cluster nodes are not affected. The changes apply only when OpenSearch Dashboards is accessed through a public or private network address. They do not apply if OpenSearch Dashboards is accessed in one click from the console. |
| system.config | Metadata file for the SAML identity provider (IdP). For details, see SAML - OpenSearch Documentation. | After configuration, a descriptor.xml file is generated in the OpenSearch config directory. All nodes load this file when the cluster is manually restarted. |
How to apply the changes:
- Modify parameters: Edit the parameter values for the required modules on the parameter configuration page.
- Save changes: CSS writes the changes to the corresponding configuration file.
- Restart the cluster or process: Nodes or components reload the new configuration file.
- Apply the changes: The new configuration takes effect after the restart is complete.
Constraints
- system.config can be modified only for OpenSearch 2.19.0.
- Exercise caution when configuring custom parameters. Make sure custom parameters are supported by the corresponding component. Otherwise, the cluster or the corresponding component may fail to restart.
- After modifying parameters in opensearch.yml and system.config, you must manually restart the cluster for the changes to take effect.
- A maximum of 20 modification records are displayed.
- You are advised to modify parameters and restart clusters during off-peak hours to minimize impact on services.
Modifying OpenSearch Configuration (opensearch.yml)
Modify core OpenSearch cluster parameters, including cross-domain access, index reindexing, query caching, and thread pools.
- Log in to the CSS management console.
- In the navigation pane on the left, choose Clusters > OpenSearch.
- In the cluster list, click the name of the target cluster. The cluster information page is displayed.
- Choose Cluster Settings > Parameter Settings > OpenSearch.
- Click Edit to modify module parameters as required.
Table 2 Module parameters Module Name
Parameter
Description
Cross-domain Access
http.cors.allow-credentials
Whether to carry authentication information in cross-domain requests, that is, whether to contain the Access-Control-Allow-Credentials field in the response header.
The value can be:- true: The response header contains the Access-Control-Allow-Credentials field.
- false (default value): The response header does not contain the Access-Control-Allow-Credentials field.
http.cors.allow-origin
Source IP addresses or domain names allowed for cross-domain access. When there are multiple values, separate them with commas (,).
Example: 192.168.122.122:9200 or 192.168.1.1:9200, 192.168.1.2:9200
http.cors.allow-headers
Request header fields for cross-domain access. When there are multiple values, separate them using a comma (,) and a space.
Example: X-Requested-With, Content-Type, Content-Length
The value can contain a maximum of 1024 characters. It can only contain letters, digits, hyphens (-), underscores (_), and slashes (/).
http.cors.max-age
Maximum retention duration of pre-check responses in the browser cache.
Unit: s
Value range: 0 to 31,536,000 (approximately 1 year)
Default value: 1,728,000 (20 days)
http.cors.enabled
Whether to enable cross-domain access.
The value can be:- true: Enable cross-domain access.
- false (default): Disable cross-domain access.
http.cors.allow-methods
HTTP methods allowed for cross-domain access. When there are multiple values, separate them using a comma (,) and a space.
Example: OPTIONS, GET, POST
Value range: OPTIONS, HEAD, GET, POST, PUT, and DELETE
Reindexing
reindex.remote.whitelist
Which remote hosts are allowed for remote reindexing operations. Use commas (,) to separate multiple values.
Example: 192.168.122.122:9200 or 192.168.1.1:9200, 192.168.1.2:9200
Custom Cache
indices.queries.cache.size
Maximum heap space allocated to the query cache.
Unit: percentage (%)
Value range: 1 to 100
Default value: 10%
Queue Size in a Thread Pool
thread_pool.force_merge.size
Size of the thread pool used for force merge operations.
Value range: a positive integer
Default value: 1
Custom
-
Click Add to add or modify custom parameters supported by OpenSearch.
WARNING:Set the values of any custom parameters to those supported by OpenSearch. Otherwise, the cluster may fail to restart. Exercise caution when performing this operation.
- After modifying the file, click Save. In the displayed dialog box, confirm the parameters and select the restart option, and then click OK.
If Job Status is Succeeded in the parameter settings task list below, the change has been saved.
- Click Restart in the upper right corner to restart the cluster and apply the change.
- After restart, check that Cluster Status is Available in the cluster list. This state indicates the parameter changes have taken effect.
Modifying OpenSearch Dashboards Configuration (opensearch_dashboards.yml)
Modify OpenSearch Dashboards visualization platform parameters, such as the session timeout, default redirect page, and user interface display language.
- Log in to the CSS management console.
- In the navigation pane on the left, choose Clusters > OpenSearch.
- In the cluster list, click the name of the target cluster. The cluster information page is displayed.
- Choose Cluster Settings > Parameter Settings > Dashboards.
- Click Edit to modify module parameters as required.
Table 3 Module parameters Module Name
Parameter
Description
Base Path
server.basePath
Custom value for Base Path.
When you need to access OpenSearch Dashboards through a reverse proxy (such as Nginx), this value is appended to the proxy address as a subpath. For example, if the reverse proxy address is http://example.com and server.basePath is set to /test, you can access OpenSearch Dashboards through the address http://example.com/test.
The value can be:- Must start with /.
- Must not contain consecutive slashes (for example, //).
- Can only contain letters, digits, hyphens (-), underscores (_), periods (.), and slashes (/).
- Can contain multi-level paths, but its length cannot exceed 254 characters.
- Must not end with a slash (/).
server.rewriteBasePath
Whether OpenSearch Dashboards or a reverse proxy will remove the server.basePath prefix from the request path.
This parameter is optional. If no reverse proxy is used, ignore this parameter.
The value can be:- true: OpenSearch Dashboards will automatically remove the server.basePath prefix from the request path.
- false (default): The reverse proxy (such as Nginx) will remove the server.basePath prefix from the request path. In this case, you can only access OpenSearch Dashboards through the reverse proxy.
Custom
-
Click Add to add or modify custom parameters supported by OpenSearch Dashboards.
WARNING:Set the values of custom parameters to those supported by OpenSearch Dashboards. Otherwise, OpenSearch Dashboards may fail to restart. Proceed with caution.
- After modifying the file, click Save. In the displayed dialog box, confirm the parameters and select the restart option, and then click OK. Modifying OpenSearch Dashboards settings will restart OpenSearch Dashboards, making it temporarily unavailable.
If Job Status is Succeeded in the parameter settings task list below, the parameter changes have taken effect.
Modifying System Configuration (system.config)
system.config can be modified only for OpenSearch 2.19.0.
Modify system configuration parameters. A descriptor.xml file is generated or modified in the same directory as the opensearch.yml configuration file.
- Log in to the CSS management console.
- In the navigation pane on the left, choose Clusters > OpenSearch.
- In the cluster list, click the name of the target cluster. The cluster information page is displayed.
- Choose Cluster Settings > Parameter Settings > System.
- Click Edit and enter the content of the descriptor.xml file in the System area.
The file size cannot exceed 100 KB (102,400 bytes or characters, including line breaks).
- After modifying the file, click Save. In the displayed dialog box, confirm the parameters and select the restart option, and then click OK.
If Job Status is Succeeded in the parameter settings task list below, the change has been saved.
- Click Restart in the upper right corner to restart the cluster and apply the change.
- After restart, check that Cluster Status is Available in the cluster list. This state indicates the new descriptor.xml file has taken effect.
Related Documents
- After configuration changes, you must restart the cluster to apply the changes. For details, see Restarting a Cluster.
- For more parameters supported by OpenSearch, see the OpenSearch official documentation.
- For more parameters supported by OpenSearch Dashboards, see OpenSearch Dashboards official documentation.
FAQ
- Q1: What should I do if the cluster status shows Configuration error after modifying parameters?
Configuration error indicates that the modified configuration file contains invalid parameter values. Check the specific error message in the parameter configuration task list, correct the parameter values as prompted, save the changes, and then restart the cluster again. If the error is caused by a custom parameter, verify whether the parameter is officially supported by the corresponding component.
- Q2: What will happen if I forget to restart the cluster after modifying parameters?
- If you do not restart the cluster after modifying parameters in opensearch.yml and system.config, the changes do not take effect and the cluster continues to run with the old configuration. Task Status in the cluster list shows Configuration Not Updated. You are advised to restart the cluster immediately after modifying parameters.
- Modifying parameters in opensearch_dashboards.yml automatically restarts the OpenSearch Dashboards process, so there is no need to manually restart the cluster. The new configuration takes effect immediately after the OpenSearch Dashboards process is restarted.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot