Start Opensearch server¶
Prerequisites¶
Install docker
Install docker compose (if not already installed)
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-composesudo chmod +x /usr/local/bin/docker-compose
Instructions¶
1. Set admin password as environment variable¶
OpenSearch version 2.12 and later require a custom admin password to be set. Following these guidelines, set the admin password as an environment variable to be used by the docker-compose-opensearch.yml file like export OPENSEARCH_INITIAL_ADMIN_PASSWORD=_some_admin_password in the terminal before starting the docker containers.
2. Start the cluster¶
docker-compose -f docker-compose-opensearch.yml up
Troubleshooting¶
“java.nio.file.FileSystemNotFoundException: null” error¶
Make sure to grant read permissions to your local data volume folders
sudo chown -R instance_user:instance_user ./opensearch-data1sudo chown -R instance_user:instance_user ./opensearch-data2Replace
instance_userwith the login user (i.e. ec2-user, ssm-user, or your local user name)
Try increasing the virtual max memory map count
sudo sysctl -w vm.max_map_count=262144
OpenSearch Dashboards container errors¶
Make sure to grant read permission to the
opensearch_dashboards.ymlfilesudo chown -R instance_user:instance_user ./opensearch_dashboards.ymlReplace
instance_userwith the login user (i.e. ec2-user, ssm-user, or your local user name)