This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
opensearch:os_installation_linux [2023/02/01 00:06] – removed - external edit (Unknown date) 127.0.0.1 | opensearch:os_installation_linux [2023/02/25 21:44] (current) – typo: hush.sh - hash.sh olaf | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Opensearch 8.x Installation on Linux ==== | ||
+ | ---- | ||
+ | === Configure APT and install required tools === | ||
+ | |||
+ | Import PGP key of the repository and create the repository entry | ||
+ | <code bash> | ||
+ | sudo apt update && sudo upgrade -y | ||
+ | sudo apt install sudo vim curl gpg unzip cifs-utils -y | ||
+ | |||
+ | wget -qO - https:// | ||
+ | echo "deb [signed-by=/ | ||
+ | |||
+ | sudo apt update | ||
+ | </ | ||
+ | |||
+ | === Install Opensearch === | ||
+ | |||
+ | Update the APT database and install the latest version of Opensearch\\ | ||
+ | <code bash> | ||
+ | |||
+ | === Or install a specific Opensearch version === | ||
+ | |||
+ | List available versions\\ | ||
+ | <code bash> | ||
+ | |||
+ | Install a version from the list returned by "apt list opensearch" | ||
+ | <code bash> | ||
+ | |||
+ | == Adjust settings in opensearch.yml == | ||
+ | |||
+ | Change / | ||
+ | <code yaml> | ||
+ | cluster.name: | ||
+ | network.host: | ||
+ | discovery.type: | ||
+ | plugins.security.ssl.transport.pemcert_filepath: | ||
+ | plugins.security.ssl.transport.pemkey_filepath: | ||
+ | plugins.security.ssl.transport.pemtrustedcas_filepath: | ||
+ | plugins.security.ssl.transport.enforce_hostname_verification: | ||
+ | plugins.security.ssl.http.enabled: | ||
+ | plugins.security.ssl.http.pemcert_filepath: | ||
+ | plugins.security.ssl.http.pemkey_filepath: | ||
+ | plugins.security.ssl.http.pemtrustedcas_filepath: | ||
+ | plugins.security.allow_unsafe_democertificates: | ||
+ | plugins.security.allow_default_init_securityindex: | ||
+ | # The empty line after the parameters for admin_dn is important: without authentication fails | ||
+ | plugins.security.authcz.admin_dn: | ||
+ | - CN=admin, | ||
+ | |||
+ | # The empty line after the parameters for nodes_dn is important: without authentication fails | ||
+ | plugins.security.nodes_dn: | ||
+ | - CN=node-01, | ||
+ | |||
+ | plugins.security.audit.type: | ||
+ | plugins.security.enable_snapshot_restore_privilege: | ||
+ | plugins.security.check_snapshot_restore_write_privileges: | ||
+ | plugins.security.restapi.roles_enabled: | ||
+ | plugins.security.system_indices.enabled: | ||
+ | plugins.security.system_indices.indices: | ||
+ | node.max_local_storage_nodes: | ||
+ | </ | ||
+ | |||
+ | Continue with [[opensearch: | ||
+ | |||
+ | ==== Configure users ==== | ||
+ | Users can be configured in / | ||
+ | Change to the tool directory and run hash.sh (the tool warns it's depricated - but they did without plans for what's next ...) | ||
+ | <code bash> | ||
+ | cd / | ||
+ | export OPENSEARCH_JAVA_HOME=/ | ||
+ | ./hash.sh | ||
+ | </ | ||
+ | Enter the password and save the hash that the tool returns.\\ | ||
+ | Generate the hash for the password for the admin user and for the kibanaserver account.\\ | ||
+ | |||
+ | Open internal_users.yml. | ||
+ | <code bash>vi / | ||
+ | |||
+ | Remove all demo users except for admin and replace the hash with the output provided by hash.sh in a previous step. The file should look similar to the following example:\\ | ||
+ | (Use the hashes you generated: you don't know the passwords used to generate them ...)\\ | ||
+ | <code yaml> | ||
+ | --- | ||
+ | # This is the internal user database | ||
+ | # The hash value is a bcrypt hash and can be generated with plugin/ | ||
+ | |||
+ | _meta: | ||
+ | type: " | ||
+ | config_version: | ||
+ | |||
+ | # Define your internal users here (use the hashes you generated: you don't know the passwords used to generate them ...) | ||
+ | |||
+ | admin: | ||
+ | hash: " | ||
+ | reserved: true | ||
+ | backend_roles: | ||
+ | - " | ||
+ | description: | ||
+ | dashboardsserver: | ||
+ | hash: " | ||
+ | reserved: true | ||
+ | backend_roles: | ||
+ | description: | ||
+ | </ | ||
+ | |||
+ | Now the system contains a basic configuration | ||
+ | |||
+ | === Enable Opensearch service and start it === | ||
+ | <code bash> | ||
+ | systemctl daemon-reload | ||
+ | systemctl enable opensearch | ||
+ | systemctl start opensearch | ||
+ | |||
+ | systemctl status opensearch | ||
+ | </ | ||
+ | The last command should show: | ||
+ | |||
+ | < | ||
+ | ●opensearch.service - OpenSearch | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | The log is / | ||
+ | <code bash> | ||
+ | |||
+ | === Inject the users === | ||
+ | ==== This will overwrite the security configuration! ==== | ||
+ | |||
+ | <code bash> | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | === Test the installation === | ||
+ | <code bash> | ||
+ | |||
+ | ==== Done. Opensearch is installed ==== | ||
+ | |||
+ | Now you might want to continue with [[opensearch: | ||
+ | |||
+ | |||