Supported versions
In the list below, notice that there you only specify the major version. Each version represents a rolling release of the latest minor version available from the upstream. The latest compatible minor version and patches are applied automatically.Deprecated versions
The following versions are still available in your projects, but they’re at their end of life and are no longer receiving security updates from upstream, or are no longer the recommended way to configure the service on Upsun. To ensure your project remains stable in the future, switch to a supported version.Relationship reference
For each service defined via a relationship to your application, Upsun automatically generates corresponding environment variables within your application container, in the$<RELATIONSHIP-NAME>_<SERVICE-PROPERTY> format.
Here is example information available through the service environment variables themselves,
or through the PLATFORM_RELATIONSHIPS environment variable.
- Service environment variables
- `PLATFORM_RELATIONSHIPS` environment variable
You can obtain the complete list of available service environment variables in your app container by running
upsun ssh env.Note that the information about the relationship can change when an app is redeployed or restarted or the relationship is changed. So your apps should only rely on the service environment variables directly rather than hard coding any values.Usage example
1. Configure the service
To define the service, use theopensearch type:
Note that changing the name of the service replaces it with a brand new service and all existing data is lost. Back up your data before changing the service.
2. Define the relationship
To define the relationship, use the following configuration:- Using default endpoints
- Using explicit endpoints
You can define
SERVICE_NAME as you like, so long as it’s unique between all defined services
and matches in both the application and services configuration.The example above leverages default endpoint configuration for relationships.
That is, it uses default endpoints behind the scenes, providing a relationship
(the network address a service is accessible from) that is identical to the name of that service.Depending on your needs, instead of default endpoint configuration,
you can use explicit endpoint configuration.With the above definition, the application container (APP_NAME) now has access to the service via the relationship SERVICE_NAME and its corresponding service environment variables.Example configuration
Use in app
To use the configured service in your app, add a configuration file similar to the following to your project. This configuration defines a single application (myapp), whose source code exists in the <PROJECT_ROOT>/myapp directory.myapp has access to the opensearch service, via a relationship whose name is identical to the service name
(as per default endpoint configuration for relationships).
From this, myapp can retrieve access credentials to the service through the relationship environment variables.
myapp/.environment
.environment in the myapp directory — is automatically sourced by Upsun into the runtime environment, so that the variable OPENSEARCH_HOSTS can be used within the application to connect to the service.
Note that OPENSEARCH_HOSTS, and all Upsun service environment variables like OPENSEARCH_HOST, are environment-dependent.
Unlike the build produced for a given commit,
they can’t be reused across environments and only allow your app to connect to a single service instance on a single environment.
A file very similar to this is generated automatically for your when using the upsun ify command to migrate a codebase to Upsun.
When you create an index on OpenSearch,
don’t specify the
number_of_shards or number_of_replicas settings in your OpenSearch API call.
These values are set automatically based on available resources.Authentication
By default, OpenSearch has no authentication. No username or password is required to connect to it. You may optionally enable HTTP Basic authentication. To do so, include the following in your.upsun/config.yaml configuration:
That enables mandatory HTTP Basic auth on all requests.
The credentials are available in any relationships that point at that service,
in the OPENSEARCH_USERNAME and OPENSEARCH_PASSWORD service environment variables.
You can obtain the complete list of available service environment variables in your app container by running upsun ssh env.
Note that the information about the relationship can change when an app is redeployed or restarted or the relationship is changed. So your apps should only rely on the service environment variables directly rather than hard coding any values.
This functionality is generally not required if OpenSearch isn’t exposed on its own public HTTP route.
However, certain applications may require it, or it allows you to safely expose OpenSearch directly to the web.
To do so, add a route to .upsun/config.yaml that has opensearch:opensearch as its upstream
(where opensearch is whatever you named the service).
For example:
.upsun/config.yaml
Plugins
OpenSearch offers a number of plugins. To enable them, list them under theconfiguration.plugins key in your .upsun/config.yaml file, like so:
.upsun/config.yaml
Available plugins
This is the complete list of plugins that can be enabled:| Plugin | Description | 1 | 2 | 3 |
|---|---|---|---|---|
analysis-icu | Support ICU Unicode text analysis | * | * | * |
analysis-kuromoji | Japanese language support | * | * | * |
analysis-nori | Integrates Lucene Nori analysis module into OpenSearch | * | * | * |
analysis-phonetic | Phonetic analysis | * | * | * |
analysis-smartcn | Smart Chinese Analysis Plugins | * | * | * |
analysis-stempel | Stempel Polish Analysis Plugin | * | * | * |
analysis-ukrainian | Ukrainian language support | * | * | * |
ingest-attachment | Extract file attachments in common formats (such as PPT, XLS, and PDF) | * | * | * |
mapper-annotated-text | Adds support for text fields with markup used to inject annotation tokens into the index | * | * | * |
mapper-murmur3 | Murmur3 mapper plugin for computing hashes at index-time | * | * | * |
mapper-size | Size mapper plugin, enables the _size meta field | * | * | * |
repository-s3 | Support for using S3 as a repository for Snapshot/Restore | * | * | * |
Alternative plugins
These plugins are currently available for OpenSearch2.0 and 3.0. The names below show exactly how they should be added to your configuration. For example, to use the alerting plugin, specify it in your services.yaml as so:
| Plugin | Description | 1 | 2 | 3 |
|---|---|---|---|---|
alerting | Monitor data and send alert notifications automatically | N/A | * | * |
opensearch-anomaly-detection | Detect anomalies as your log data and monitor data in near real time | N/A | * | * |
asynchronous-search | Run search queries in the background and retrieve results as they become available | N/A | * | * |
opensearch-cross-cluster-replication | Replicate data across two OpenSearch clusters | N/A | * | * |
opensearch-custom-codecs | Provide custom Lucene codecs for loading through Apache Lucene’s NamedSPILoader | N/A | * | * |
opensearch-flow-framework | Innovate AI applications on OpenSearch | N/A | * | * |
notifications | A central location for all of your notifications from OpenSearch plugins | N/A | * | * |
opensearch-reports-scheduler | Export and share reports from OpenSearch Dashboards dashboards, saved search, alerts and visualizations | N/A | * | * |
geospatial | An OpenSearch plugin that contains geospatial specific features | N/A | * | * |
opensearch-index-management | A suite of features to monitor and manage indexes | N/A | * | * |
opensearch-job-scheduler | Schedule periodical jobs running within OpenSearch nodes | N/A | * | * |
opensearch-knn | Easily run the nearest neighbor search on billions of documents | N/A | * | * |
opensearch-ml-plugin | Leverage existing open source machine learning algorithms | N/A | * | * |
opensearch-skills | Provides tools for ml-common’s agent framework OpenSearch ml-commons | N/A | * | * |
neural-search | Index documents and conduct a neural search on indexed documents | N/A | * | * |
opensearch-observability | Collection of plugins and applications that let you visualize data-driven events | N/A | * | * |
performance-analyzer | A REST API that allows you to query numerous performance metrics | N/A | * | * |
opensearch-sql-plugin | Extract insights out of OpenSearch using the familiar SQL or Piped Processing Language (PPL) query syntax | N/A | * | * |
Plugin removal
Removing plugins previously added in your.upsun/config.yaml file doesn’t automatically uninstall them from your OpenSearch instances.
This is deliberate, as removing a plugin may result in data loss or corruption of existing data that relied on that plugin.
Removing a plugin usually requires reindexing.
To permanently remove a previously enabled plugin,
upgrade the service to create a new instance of OpenSearch and migrate to it.
In most cases it isn’t necessary as an unused plugin has no appreciable impact on the server.
Upgrading
The OpenSearch data format sometimes changes between versions in incompatible ways. OpenSearch doesn’t include a data upgrade mechanism as it’s expected that all indexes can be regenerated from stable data if needed. To upgrade (or downgrade) OpenSearch, use a new service from scratch. There are two ways to do so.Destructive
In your.upsun/config.yaml file, change the version and name of your OpenSearch service.
Be sure to also update the reference to the now changed service name in it’s corresponding application’s relationship block.
When you push that to Upsun, the old service is deleted and a new one with the new name is created with no data.
You can then have your application reindex data as appropriate.
This approach has the downsides of temporarily having an empty OpenSearch instance,
which your application may or may not handle gracefully, and needing to rebuild your index afterward.
Depending on the size of your data that could take a while.
Transitional
With a transitional approach, you temporarily have two OpenSearch services. Add a second OpenSearch service with the new version a new name and give it a new relationship in.upsun/config.yaml.
You can optionally run in that configuration for a while to allow your application to populate indexes in the new service as well.
Once you’re ready to switch over, remove the old OpenSearch service and relationship.
You may optionally have the new OpenSearch service use the old relationship name if that’s easier for your app to handle.
Your application is now using the new OpenSearch service.
This approach has the benefit of never being without a working OpenSearch instance.
On the downside, it requires two running OpenSearch servers temporarily,
each of which consumes resources and needs adequate disk space.
Depending on the size of your data, that may be a lot of disk space.
Exporting Data
The export procedure for OpenSearch is identical to Elasticsearch, using the Snapshot and Restore API.- Open an SSH tunnel:
Terminal
- Register a snapshot repository:
Terminal
- Trigger a snapshot:
Terminal
- Download the snapshot from the container:
Terminal