Files
team/docs/main/administration-guide/scale/opensearch-setup.mdx
b5f007d35e docs: fix broken path links, anchors, and tab rendering from RST-to-MDX migration (#37433)
* docs: resolve cross-file anchor mismatches from RST-to-MDX migration

The Sphinx-to-Docusaurus migration converted `:ref:`/`{ref}` links using
naive text-slugification, so anchors that pointed to headings in a
different file (e.g. release-summary tables linking into their
respective changelog pages) were emitted as same-page fragments and
silently resolved to nothing.

Built a label registry from the original Sphinx `.. _label:` / `(label)=`
targets to recover the true source file for each cross-reference, then
rewrote the affected links to point at the correct file + heading
anchor. Fixes 282 broken cross-file anchors, primarily in the mobile/
desktop/server release-summary pages, plus assorted same-page anchor
mismatches caught by re-auditing after the prior admonition/anchor fix.

* docs: manually resolve remaining anchor mismatches after cross-file audit

Hand-verified fixes for anchors that fuzzy-matching alone couldn't
safely resolve (confirmed against actual heading text/context, and in a
few cases against the original RST source, before applying):

- Typos and dropped words carried over from the original Sphinx docs
  (e.g. "bot-acocunts", "auto-follow-all-new-channel-threads" ->
  "follow-all-new-channel-threads").
- Sphinx auto-generated duplicate-heading IDs (#id1/#id3/#id4) resolved
  to their real target headings.
- Numbered-step TOC links in enterprise-roll-out-checklist.mdx that
  dropped the leading "N. " used in the actual heading slugs.
- Push-notification docs pointing at the wrong file entirely
  (environment-configuration-settings instead of
  push-notification-server-configuration-settings).
- SAML "saml-enterprise" label resolved to its true cross-file target
  (authentication-configuration-settings#saml-2-0), recovered from the
  original RST label definition that the automated registry missed
  because it sat after an RST transition marker.
- sso-saml-technical references converted from broken same-page/
  malformed-path anchors to correct page links.

* docs: fix SAML 2.0 anchor slug (saml-2-0 -> saml-20)

github-slugger strips periods rather than hyphenating them, so "SAML
2.0" slugifies to saml-20, not saml-2-0 as previously fixed.

* docs: fix broken path links found during docs/main migration cleanup

* docs: convert div.tab blocks to Docusaurus Tabs/TabItem components

* docs: restore missing Kubernetes deployment architecture diagrams

The RST-to-MDX migration never copied over the AWS/Azure/Oracle
architecture diagrams referenced by the deployment-architecture-at-scale
page, leaving broken images in each Tabs/TabItem.

* docs: fix 7 anchor mismatches from the fragment/heading audit

Covers three root causes from the anchor mismatch breakdown:
- Fragment repeated the target page's own title instead of a real
  heading, so the link is simplified to point at the bare page.
- Heading exists verbatim but lives on a sibling settings page
  (experimental-configuration-settings, push-notification-server-
  configuration-settings) rather than environment-configuration-settings.
- A page path was mistakenly pasted into a same-page #fragment instead
  of being used as a real cross-page link.

* docs: fix 8 anchor slugs that were close but didn't match the real heading

Repoints links whose fragment was a plausible guess (typo, reworded
heading, or wrong section) at the actual auto-generated slug of the
target heading, confirmed by inspecting each target page directly.

* docs: merge split Tabs blocks so tabs render horizontally

The div.tab conversion script split some sibling tab groups into
separate single-item Tabs blocks whenever a stray blockquote marker
sat between them, causing them to render stacked instead of as one
horizontal tab bar. Merges the MySQL/PostgreSQL and Team/Enterprise
Edition tab groups back into single Tabs blocks.

* docs: remove Azure tab and restore Kubernetes deploy content

The Mattermost Operator, Azure, and Oracle platform tabs on the
Kubernetes deployment guide were split across two separate Tabs
blocks (rendering stacked instead of as one tab bar) and all three
tab bodies were empty because the migration never flattened the
original RST include directives. Removes the unsupported Azure tab
and restores the Mattermost Operator and Oracle content from the
pre-migration RST sources as a single merged Tabs block.

* addresscoderabbitreview

* docs: unify Linux/Kubernetes/Containers deploy pages and fix FIPS/STIG placement

Kubernetes and Containers duplicated full install content across a top-level
page (Tabs) and orphaned sidebar subpages that nothing linked to. Reworked
both to follow the Linux page's pattern: shared content on the landing page,
platform-specific instructions live once in their own subpage.

Also removed configure-fips-at-install-time.mdx, which claimed FIPS is
available for native Linux installs — FIPS/STIG in Mattermost is a container
image property (Chainguard-based build), not available outside Docker/
Kubernetes. Consolidated all FIPS/STIG references onto
containers/fips-stig.mdx and pointed the Mattermost Operator subpage (not
Oracle OKE, which doesn't expose image selection) at it.

* docs: fix review findings — image alt text, Important callout markup, typo

- Replace generic alt="image" on scaling diagrams with descriptive text
  identifying cloud provider and user scale.
- Convert raw div.important markup in deploy-containers.mdx to the
  repo's <Important> component, matching usage elsewhere in the file.
- Fix "Matermost" typo in manage-your-display-options.mdx.

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-10 14:50:13 +03:00

323 lines
9.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "AWS OpenSearch server setup"
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import Inc0_common_configure_mattermost_for_enterprise_search from './common-configure-mattermost-for-enterprise-search.mdx';
<PlanAvailability slug="ent-plus" />
AWS OpenSearch Service allows you to search large volumes of data quickly, in near real-time, by creating and managing an index of post data. The indexing process can be managed from the System Console after setting up and connecting an OpenSearch server. The post index is stored on the OpenSearch server and updated constantly after new posts are made. In order to index existing posts, a bulk index of the entire post database must be generated.
Deploying AWS OpenSearch includes the following two steps: [setting up AWS OpenSearch](#set-up-aws-opensearch), and [configuring Mattermost](#configure-mattermost).
## Set up AWS OpenSearch
From Mattermost v9.11, beta support is available for [AWS OpenSearch v1.x and v2.x](https://opensearch.org/). This document covers both on‑premises and AWS OpenSearch setup, including manual steps and Terraform examples.
We highly recommend that you set up an AWS OpenSearch server on a separate machine from the Mattermost server.
<Tabs>
<TabItem value="on-premises-opensearch" label="On-Premises OpenSearch">
1. To install on-premise OpenSearch, provision a dedicated server (e.g. Ubuntu 22.04 LTS).
2. Install Java (OpenSearch requires Java 11+):
> ``` sh
> sudo apt update
> sudo apt install -y openjdk-11-jdk
> java -version
> ```
3. Download & extract OpenSearch 2.x:
> ``` sh
> wget https://artifacts.opensearch.org/releases/bundle/opensearch/2.9.0/opensearch-2.9.0-linux-x64.tar.gz
> tar -xzf opensearch-2.9.0-linux-x64.tar.gz
> sudo mv opensearch-2.9.0 /usr/share/opensearch
> ```
4. Create a dedicated user & set permissions:
> ``` sh
> sudo useradd --no-create-home --shell /bin/false opensearch
> sudo chown -R opensearch:opensearch /usr/share/opensearch
> ```
5. Configure systemd:
> ``` sh
> [Unit]
> Description=OpenSearch
> Wants=network-online.target
> After=network-online.target
>
> [Service]
> Type=notify
> User=opensearch
> Group=opensearch
> ExecStart=/usr/share/opensearch/bin/opensearch
> Restart=on-failure
> LimitNOFILE=65536
> LimitNPROC=4096
>
> [Install]
> WantedBy=multi-user.target
> ```
6. Edit `opensearch.yml` to include the following:
> ``` yaml
> cluster.name: mattermost-cluster
> node.name: node-1
> path.data: /var/lib/opensearch
> path.logs: /var/log/opensearch
> network.host: 0.0.0.0
> discovery.seed_hosts: ["&lt;other-node-ip&gt;"]
> cluster.initial_master_nodes: ["node-1", "node-2"]
> ```
>
> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> Ensure `path.data` and `path.logs` directories exist and are owned by the `opensearch` user before starting the service:
>
> ``` sh
> sudo mkdir -p /var/lib/opensearch /var/log/opensearch
> sudo chown -R opensearch:opensearch /var/lib/opensearch /var/log/opensearch
> ```
>
> </div>
7. Enable & start OpenSearch:
> ``` sh
> sudo systemctl daemon-reload
> sudo systemctl enable opensearch
> sudo systemctl start opensearch
> sudo systemctl status opensearch
> ```
8. Install the [icu-analyzer plugin](https://docs.opensearch.org/latest/install-and-configure/additional-plugins/index/) to the `/usr/share/opensearch/plugins` directory by running the following command:
> ``` sh
> sudo /usr/share/opensearch/bin/opensearch-plugin install analysis-icu
> ```
**(Optional) CJK language analyzer plugins**: To improve search for Korean, Japanese, or Chinese content, install one or more of the following language-specific analyzer plugins: `analysis-nori` (Korean), `analysis-kuromoji` (Japanese), and `analysis-smartcn` (Chinese).
> ``` sh
> sudo /usr/share/opensearch/bin/opensearch-plugin install analysis-nori
> sudo /usr/share/opensearch/bin/opensearch-plugin install analysis-kuromoji
> sudo /usr/share/opensearch/bin/opensearch-plugin install analysis-smartcn
> ```
After installing the CJK plugins, restart OpenSearch to load them:
> ``` sh
> sudo systemctl restart opensearch
> ```
Then enable the [EnableCJKAnalyzers](/administration-guide/configure/environment-configuration-settings#enable-cjk-analyzers) configuration setting. See [Enabling Chinese, Japanese, and Korean Search](/administration-guide/configure/enabling-chinese-japanese-korean-search) for additional CJK search configuration options.
<Important>
If you enable CJK analyzers on a server with existing indexed content, you must purge and rebuild the search index in **System Console \> Environment \> Elasticsearch** for the CJK analyzers to take effect on existing posts.
</Important>
## Terraform (Docker) Example
``` sh
provider "docker" {
host = "unix:///var/run/docker.sock"
}
resource "docker_image" "opensearch" {
name = "opensearchproject/opensearch:2.9.0"
}
resource "docker_container" "opensearch" {
name = "opensearch"
image = docker_image.opensearch.latest
ports {
internal = 9200
external = 9200
}
ports {
internal = 9600
external = 9600
}
env = [
"cluster.name=mattermost-cluster",
"network.host=0.0.0.0",
"discovery.type=single-node", # remove for multi-node
]
restart = "unless-stopped"
}
resource "null_resource" "install_icu_plugin" {
depends_on = [docker_container.opensearch]
provisioner "local-exec" {
command = "docker exec opensearch /usr/share/opensearch/bin/opensearch-plugin install analysis-icu && docker restart opensearch"
}
}
```
</TabItem>
<TabItem value="aws-opensearch-console-setup" label="AWS OpenSearch Console Setup">
1. To install AWS OpenSearch, open the **AWS Console \> OpenSearch Service**.
2. Create a domain, where:
> - Domain name: `mattermost-os`
> - Engine version: `OpenSearch 2.x`.
3. Configure the cluster, where:
> - instance type: `r6g.xlarge.search`
> - data nodes: 2
> - master nodes: 2
> - storage: EBS gp3 (1536 GiB, 4608 IOPS, 250 MiB/s)
4. Specify the network for: VPC with 2 subnets, and a security group allowing Mattermost IPs on port `443`.
<Note>
Port 9200 is commonly used for local or on-premise OpenSearch. The AWS OpenSearch domain only supports HTTPS over port 443.
</Note>
5. Configure the access policy (JSON):
> ``` sh
> &#123;
> "Version": "2012-10-17",
> "Statement": [&#123;
> "Effect": "Allow",
> "Principal": &#123; "AWS":
> "arn:aws:iam::123456789012:role/MattermostAppRole" &#125;,
> "Action": "es:*",
> "Resource": "arn:aws:es:us-east-1:123456789012:domain/mattermost-os/*" &#125;]
> &#125;
> ```
6. Configure the following advanced settings (JSON):
> ``` sh
> &#123;
> "action.destructive_requires_name": "false",
> "rest.action.multi.allow_explicit_index": "true",
> "indices.query.bool.max_clause_count": "1024",
> "indices.fielddata.cache.size": "20"
> &#125;
> ```
7. Configure the automated snapshot start hour as 23 (UTC), enforce HTTPS, then review & create.
8. To test, run the following command:
> ``` sh
> curl https://mattermost-os-xxxxxxxxxxx.us-east-1.es.amazonaws.com
> ```
## AWS Terraform Example
> ``` sh
> provider "aws" &#123;
> region = "us-east-1"
> &#125;
>
> resource "aws_iam_role" "os_service_role" &#123;
> name = "OSServiceRole"
> assume_role_policy = &lt;<EOF
> &#123;
> "Version": "2012-10-17",
> "Statement": [&#123;
> "Action": "sts:AssumeRole",
> "Effect": "Allow",
> "Principal": &#123; "Service": "es.amazonaws.com" &#125;
> &#125;]
> &#125;
> EOF
> &#125;
>
> resource "aws_opensearch_domain" "mattermost" &#123;
> domain_name = "mattermost-os"
> engine_version = "OpenSearch_2.9"
> cluster_config &#123;
> instance_type = "r6g.xlarge.search"
> instance_count = 2
> dedicated_master_enabled = true
> dedicated_master_type = "r6g.xlarge.search"
> dedicated_master_count = 2
> zone_awareness_enabled = true
> &#125;
>
> ebs_options &#123;
> ebs_enabled = true
> volume_type = "gp3"
> volume_size = 1536
> iops = 4608
> &#125;
>
> vpc_options &#123;
> subnet_ids = ["subnet-blah1", "subnet-blah2"]
> security_group_ids = ["sg-1234567890"]
> &#125;
>
> advanced_options = &#123;
> "rest.action.multi.allow_explicit_index" = "true"
> "indices.query.bool.max_clause_count" = "1024"
> "indices.fielddata.cache.size" = "20"
> "action.destructive_requires_name" = "false"
> &#125;
>
> access_policies = &lt;<POLICY
> &#123;
> "Version": "2012-10-17",
> "Statement": [&#123;
> "Effect": "Allow",
> "Principal": &#123;
> "AWS": "arn:aws:iam::123456789012:role/MattermostAppRole"
> &#125;,
> "Action": "es:*",
> "Resource": "arn:aws:es:us-east-1:123456789012:domain/mattermost-os/*"
> &#125;]
> &#125;
> POLICY
> service_software_options &#123;
> automated_snapshot_start_hour = 23
> &#125;
>
> domain_endpoint_options &#123;
> enforce_https = true
> &#125;
> &#125;
> ```
</TabItem>
</Tabs>
## Configure Mattermost
Follow these steps to configure Mattermost to use your AWS OpenSearch server and to generate the post index:
1. Go to **System Console \> Environment \> Elasticsearch**.
2. Set **Enable Elasticsearch Indexing** to `true` to enable the other the settings on the page.
3. Ensure **Backend type** is set to `opensearch`.
4. Set the **Server Connection Address** to your Elasticsearch or OpenSearch cluster endpoint.
5. Monitor cluster health: `curl https://mattermost-os-xxxxx.us-east-1.es.amazonaws.com/_cluster/health`
<Inc0_common_configure_mattermost_for_enterprise_search />