If you need to install docker first, check - viewtopic.php?f=35&t=772
First, decide which version you want to install, 2.x or 3.x.
For OpenSearch 2.x version do the following:
Code: Select all
# download the official docker-compose file
wget https://raw.githubusercontent.com/opensearch-project/opensearch-build/refs/heads/main/docker/release/dockercomposefiles/docker-compose-2.x.yml
mv docker-compose-2.x.yml docker-compose.ymlCode: Select all
# download the official docker-compose file
wget https://raw.githubusercontent.com/opensearch-project/opensearch-build/refs/heads/main/docker/release/dockercomposefiles/docker-compose-3.x.yml
mv docker-compose-3.x.yml docker-compose.ymlCode: Select all
export OPENSEARCH_INITIAL_ADMIN_PASSWORD='some_Pa55word'Code: Select all
docker-compose up--
To switch from HTTPS to HTTP, add the following line to the `environment:` block for both nodes (`opensearch-node1` and `opensearch-node2`) in the `docker-compose.yml` file:
Code: Select all
- plugins.security.ssl.http.enabled=falseCode: Select all
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]'Code: Select all
OPENSEARCH_HOSTS: '["http://opensearch-node1:9200","http://opensearch-node2:9200"]'
To disable authentication, add the following line to the `environment:` block for both nodes (`opensearch-node1` and `opensearch-node2`):
Code: Select all
- DISABLE_SECURITY_PLUGIN=trueCode: Select all
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
- plugins.security.ssl.http.enabled=falseCode: Select all
- DISABLE_SECURITY_DASHBOARDS_PLUGIN=trueAfter each modification to the `docker-compose.yml` file, run:
Code: Select all
docker-compose down
docker-compose up -dCode: Select all
curl --insecure -u admin:$OPENSEARCH_INITIAL_ADMIN_PASSWORD https://localhost:9200/?prettyAdditionaly, if you need SSL, for desired domain, use this .stpl:
Code: Select all
server {
listen %ip%:%proxy_ssl_port% ssl;
http2 on;
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
location / {
proxy_pass http://localhost:9202/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location @fallback {
proxy_pass https://%ip%:%web_ssl_port%;
}
disable_symlinks if_not_owner from=%docroot%;
include %home%/%user%/conf/web/snginx.%domain%.conf*;
}