OpenSearch: Установка и настройка

OpenSearch: Установка и настройка

Инструкция по установке и первичной настройке #OpenSearch.

Репозиторий

  • Скачать и установить ключ репозитория:
1
curl -fsSL 'https://artifacts.opensearch.org/publickeys/opensearch.pgp' | gpg --dearmor -o '/etc/apt/keyrings/opensearch.gpg'
  • Создать файл репозитория /etc/apt/sources.list.d/opensearch.sources со следующим содержимым:
1
v='2'; . '/etc/os-release' && echo -e "X-Repolib-Name: OpenSearch\nEnabled: yes\nTypes: deb\nURIs: https://artifacts.opensearch.org/releases/bundle/opensearch/${v}.x/apt\nSuites: stable\nComponents: main\nArchitectures: $( dpkg --print-architecture )\nSigned-By: /etc/apt/keyrings/opensearch.gpg\n" | tee '/etc/apt/sources.list.d/opensearch.sources' > '/dev/null'

Установка

  • Установить пакеты:
1
v='2.15.0'; apt update && apt install --yes opensearch=${v} && apt-mark hold opensearch=${v}

Настройка

В этом разделе приведена конфигурация с моими предпочтениями.

Основная конфигурация

  • Сохранить оригинальный файл конфигурации:
1
f='/etc/opensearch/opensearch.yml'; [[ -f "${f}" && ! -f "${f}.orig" ]] && mv "${f}" "${f}.orig"
  • Создать файл основной конфигурации /etc/opensearch/opensearch.yml со следующим содержимым:
opensearch.yml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cluster.name: 'cluster.01'
node.name: 'node.01'
path.data: '/var/lib/opensearch'
path.logs: '/var/log/opensearch'
network.host: 127.0.0.1
http.port: 9200
discovery.type: single-node
action.auto_create_index: false
node.max_local_storage_nodes: 3
plugins.security.disabled: true
plugins.security.ssl.transport.pemcert_filepath: 'esnode.pem'
plugins.security.ssl.transport.pemkey_filepath: 'esnode-key.pem'
plugins.security.ssl.transport.pemtrustedcas_filepath: 'root-ca.pem'
plugins.security.ssl.transport.enforce_hostname_verification: false
plugins.security.ssl.http.enabled: true
plugins.security.ssl.http.pemcert_filepath: 'esnode.pem'
plugins.security.ssl.http.pemkey_filepath: 'esnode-key.pem'
plugins.security.ssl.http.pemtrustedcas_filepath: 'root-ca.pem'
plugins.security.allow_unsafe_democertificates: true
plugins.security.allow_default_init_securityindex: true
plugins.security.authcz.admin_dn: ['CN=kirk,OU=client,O=client,L=test,C=de']
plugins.security.audit.type: internal_opensearch
plugins.security.enable_snapshot_restore_privilege: true
plugins.security.check_snapshot_restore_write_privileges: true
plugins.security.restapi.roles_enabled: [all_access, security_rest_api_access]
plugins.security.system_indices.enabled: true
plugins.security.system_indices.indices: [.plugins-ml-agent, .plugins-ml-config, .plugins-ml-connector,
  .plugins-ml-controller, .plugins-ml-model-group, .plugins-ml-model, .plugins-ml-task,
  .plugins-ml-conversation-meta, .plugins-ml-conversation-interactions, .plugins-ml-memory-meta,
  .plugins-ml-memory-message, .plugins-ml-stop-words, .opendistro-alerting-config,
  .opendistro-alerting-alert*, .opendistro-anomaly-results*, .opendistro-anomaly-detector*,
  .opendistro-anomaly-checkpoints, .opendistro-anomaly-detection-state, .opendistro-reports-*,
  .opensearch-notifications-*, .opensearch-notebooks, .opensearch-observability, .ql-datasources,
  .opendistro-asynchronous-search-response*, .replication-metadata-store, .opensearch-knn-models,
  .geospatial-ip2geo-data*, .plugins-flow-framework-config, .plugins-flow-framework-templates,
  .plugins-flow-framework-state]

Дополнительная конфигурация

  • Создать файл дополнительной конфигурации /etc/opensearch/jvm.options.d/99-jvm.local.options со следующим содержимым:
opensearch.jvm.local.options
1
2
-Xms2g
-Xmx2g