OpenSearch Cluster Installation: Difference between revisions
DrEdWilliams (talk | contribs) (Created page with "Do this on each cluster node === Create Opensearch User === Debian/Ubuntu: adduser --system -uid 968 --shell /bin/bash --gecos 'OpenSearch User' --group --disabled-passw...") Tag: visualeditor |
DrEdWilliams (talk | contribs) Tag: visualeditor |
||
| Line 1: | Line 1: | ||
Do this on each cluster node | == Preparation == | ||
Do this on each cluster node (unless otherwise noted | |||
=== Create Opensearch User === | === Create Opensearch User === | ||
Debian/Ubuntu: | Debian/Ubuntu: | ||
adduser --system -uid 968 --shell /bin/bash --gecos 'OpenSearch User' --group --disabled-password --home /opt/opensearch opensearch | sudo adduser --system -uid 968 --shell /bin/bash --gecos 'OpenSearch User' --group --disabled-password --home /opt/opensearch opensearch | ||
Fedora: | Fedora: | ||
adduser --system --uid 968 --shell /bin/bash --home-dir /opt/opensearch -m opensearch | sudo adduser --system --uid 968 --shell /bin/bash --home-dir /opt/opensearch -m opensearch | ||
Then add your normal user to the group: | |||
sudo usermod -aG opensearch ewilliam | |||
=== Set vm.max_map_count === | === Set vm.max_map_count === | ||
Create <code>/etc/sysctl.d/vm.maxmap_count</code> (as root) and add | Create <code>/etc/sysctl.d/vm.maxmap_count</code> (as root) and add the following line: | ||
vm.max_map_count=262144 | vm.max_map_count=262144 | ||
Run the following commands as root: | Run the following commands as root: | ||
| Line 18: | Line 21: | ||
apt install -y openjdk-11-jdk | apt install -y openjdk-11-jdk | ||
== Install Opensearch Tarball == | |||
Change to the opensearch user (from root): | Change to the opensearch user (from root): | ||
su - opensearch | su - opensearch | ||
cd ~ | cd ~ | ||
Run the following commands as opensearch user: | Run the following commands as opensearch user (from the opensearch home directory <code>/opt/opensearch</code>): | ||
wget <nowiki>https://artifacts.opensearch.org/releases/bundle/opensearch/1.0.0/opensearch-1.0.0-linux-x64.tar.gz</nowiki> | wget <nowiki>https://artifacts.opensearch.org/releases/bundle/opensearch/1.0.0/opensearch-1.0.0-linux-x64.tar.gz</nowiki> | ||
tar -xvzf opensearch-1.0.0-linux-x64.tar.gz | tar -xvzf opensearch-1.0.0-linux-x64.tar.gz | ||
rm opensearch-1.0.0-linux-x64.tar.gz | rm opensearch-1.0.0-linux-x64.tar.gz | ||
Create the systemd unit file (since the tarball install doesn't provide one: | |||
== Configure OpenSearch == | |||
Configuration varies depending on the type of node, but these are the places that need to be touched. | |||
=== jvm.options === | |||
Set the heap size: | |||
* 4G for master and cold data nodes | * 4G for master and cold data nodes | ||
* | * 16G for hot data nodes | ||
In general, it shouldn't be more than 50% of available memory | In general, it shouldn't be more than 50% of available memory | ||
On | === config.yml === | ||
'''On the initial master node only''', configure <code>/opt/opensearch/opensearch-1.1.0/plugins/opensearch-security/securityconfig/config.yml</code> to allow certificate authentication. Enable both '''http''' and '''transport''' under <code>clientcert_auth_domain</code> | |||
=== opensearch.yml: === | |||
* <code>cluster.name</code> | * <code>cluster.name</code> | ||
* <code>node.name</code>- can be the hostname, but doesn't have to be | * <code>node.name</code>- can be the hostname, but doesn't have to be | ||
* <code>path.data</code> | * <code>path.data</code> - data nodes only -- must be unique to the node | ||
* <code>path.logs</code> | * <code>path.logs</code> - must be unique to the node | ||
* <code>network.host</code> -- host's IP | * <code>network.host</code> -- host's IP where all traffic will be received | ||
* <code>http.port</code> -- leave it as the default (<code>9200</code>) but uncomment it to lock it in | * <code>http.port</code> -- leave it as the default (<code>9200</code>) but uncomment it to lock it in | ||
* <code>discovery.seed_hosts</code> -- IP addresses of all the masters | * <code>discovery.seed_hosts</code> -- IP addresses of all the masters (same for all nodes) | ||
* <code>cluster.initial_master_nodes</code> -- put the master node names here (not the hostnames) | * <code>cluster.initial_master_nodes</code> -- put the master node names here (not the hostnames) -- same for all nodes | ||
* <code>node.[master|data|ingest|remote]</code> - set the type of the node | * <code>node.[master|data|ingest|remote]</code> - set the type of the node (specify all four) | ||
* <code>node.attr.temp</code> - (data nodes only) defines data storage tiers (<code>hot</code>/<code>warm</code>/<code>cold</code>) | * <code>node.attr.temp</code> - (data nodes only) defines data storage tiers (<code>hot</code>/<code>warm</code>/<code>cold</code>) | ||
Revision as of 13:28, 7 November 2021
Preparation
Do this on each cluster node (unless otherwise noted
Create Opensearch User
Debian/Ubuntu:
sudo adduser --system -uid 968 --shell /bin/bash --gecos 'OpenSearch User' --group --disabled-password --home /opt/opensearch opensearch
Fedora:
sudo adduser --system --uid 968 --shell /bin/bash --home-dir /opt/opensearch -m opensearch
Then add your normal user to the group:
sudo usermod -aG opensearch ewilliam
Set vm.max_map_count
Create /etc/sysctl.d/vm.maxmap_count (as root) and add the following line:
vm.max_map_count=262144
Run the following commands as root:
sysctl --system
Install Java 11 (optional)
The OpenSearch distro comes with Java 8 integrated into the packages. If this won't work for some reason, run the following commands as root:
apt update apt install -y openjdk-11-jdk
Install Opensearch Tarball
Change to the opensearch user (from root):
su - opensearch cd ~
Run the following commands as opensearch user (from the opensearch home directory /opt/opensearch):
wget https://artifacts.opensearch.org/releases/bundle/opensearch/1.0.0/opensearch-1.0.0-linux-x64.tar.gz tar -xvzf opensearch-1.0.0-linux-x64.tar.gz rm opensearch-1.0.0-linux-x64.tar.gz
Create the systemd unit file (since the tarball install doesn't provide one:
Configure OpenSearch
Configuration varies depending on the type of node, but these are the places that need to be touched.
jvm.options
Set the heap size:
- 4G for master and cold data nodes
- 16G for hot data nodes
In general, it shouldn't be more than 50% of available memory
config.yml
On the initial master node only, configure /opt/opensearch/opensearch-1.1.0/plugins/opensearch-security/securityconfig/config.yml to allow certificate authentication. Enable both http and transport under clientcert_auth_domain
opensearch.yml:
cluster.namenode.name- can be the hostname, but doesn't have to bepath.data- data nodes only -- must be unique to the nodepath.logs- must be unique to the nodenetwork.host-- host's IP where all traffic will be receivedhttp.port-- leave it as the default (9200) but uncomment it to lock it indiscovery.seed_hosts-- IP addresses of all the masters (same for all nodes)cluster.initial_master_nodes-- put the master node names here (not the hostnames) -- same for all nodesnode.[master|data|ingest|remote]- set the type of the node (specify all four)node.attr.temp- (data nodes only) defines data storage tiers (hot/warm/cold)