# Installing OpenSearch ## Prerequisites and Setup * uses Docker; which is why i installed Docker and wrote the [[Docker]] wiki yesterday * [source](https://opensearch.org/docs/latest/getting-started/quickstart/) * `sudo swapoff -a` * disables memory-paging and swapping * `sudo vi /etc/sysctl.conf` * actually it's `/etc/sysctl.d/10-map-count.conf` * `vm.max_map_count=262144` * Set max map count to 262144 * `sudo sysctl -p` * reload kernel parameters ## Install Steps * `curl -O https://raw.githubusercontent.com/opensearch-project/documentation-website/2.19/assets/examples/docker-compose.yml` * download the example docker-compose (which is a functional OpenSearch cluster) * `export OPENSEARCH_INITIAL_ADMIN_PASSWORD=` * **NOTE** without this value the opensearch nodes will refuse to start! * **ALSO NOTE** OpenSearch has requirements for this password! * 8+ chars of at least 1 UPPER-CASE, 1 lower-case, 1 digit, and 1 symbol * and there are more undocumented rules (probably no sequences); just use a password generator * `docker compose up -d` * start the docker-compose cluster as background process (`-d` = detached) * will download about 12 containers (two of which are 968MB and 350MB); takes a while first time ## Testing Steps * `curl https://localhost:9200 -ku admin:` * response should confirm that the install worked * http://localhost:5601/ should respond with dashboards and such * change admin-password if you like at this point ## Shooting Trouble * `[ConnectionError]: getaddrinfo ENOTFOUND opensearch-node1` * check the logs of the opensearch-node1 container; likely it refused to start because the admin password didn't pass checks * `docker compose down` to get rid of the containers * `export OPENSEARCH_INITIAL_ADMIN_PASSWORD=""` * `docker compose up -d` * hopefully the password was sufficient to pass checks