Skip to content

Deployment Overview of OpenSearch on Server

Prerequisites and Basic Requirements

To ensure the successful deployment and operation of OpenSearch, the following requirements must be met:

  • Operating System: Ubuntu.

  • Privileges: Root or sudo access is required for installation and Docker management.

  • Docker: The system must have Docker installed to run the application containers.

  • Memory Requirements: Sufficient RAM must be available to accommodate the JVM heap settings (512m per node) and the operating system overhead.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template configured for the hostkey.in domain.

Parameter Value
Prefix opensearch
Domain hostkey.in
Full template opensearch{Server_ID_from_Invapi}.hostkey.in

File and Directory Structure

The deployment utilizes several specific directories for configuration, data persistence, and proxy management:

  • /home/{user}/opensearch-project/: The primary project directory containing the Docker Compose file and application data.

  • /home/{user}/opensearch-project/opensearch-data/: Local volume used for OpenSearch data persistence (owned by UID 1000).

  • /root/nginx/: Contains the Nginx configuration files and the Docker Compose file for the reverse proxy.

  • /data/nginx/user_conf.d/: Stores Nginx virtual host configurations, including SSL settings.

Application installation process

The application is deployed using a combination of package management and Docker Compose:

  1. System Preparation: The system environment is prepared by installing the necessary Docker engine components.

  2. Project Initialization: A project directory is created in the user's home folder (/home/{user}/opensearch-project).

  3. Data Directory Setup: A dedicated data directory is created with specific ownership (UID 1000) to ensure the containerized OpenSearch process has write permissions.

  4. Docker Deployment: The application is launched using a docker-compose.yml file located in the project directory. This file defines the OpenSearch engine and the Dashboards interface.

  5. Proxy Configuration: An Nginx reverse proxy is configured via Docker to handle SSL termination and route traffic from the external domain to the internal dashboards service.

Access Rights and Security

  • Firewall/Ports: The application relies on specific ports for internal communication and external access (see "Available ports for connection").

  • Permissions: Data directories are strictly managed with UID 1000 to prevent permission conflicts between the host and the container.

  • SSL/TLS: Security is enforced via SSL certificates managed by a dedicated Nginx-Certbot container, ensuring encrypted communication over port 443.

Databases

OpenSearch functions as its own distributed search and analytics engine. It does not rely on an external database but manages its own data within the following location:

  • ./opensearch-data (relative to the project directory).

Docker Containers and Their Deployment

The deployment consists of three primary containers:

OpenSearch Node

  • Image: opensearchproject/opensearch:2.17.0

  • Container Name: opensearch-node1

  • Environment Variables:

  • discovery.type=single-node

  • bootstrap.memory_lock=true

  • OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m

  • OPENSEARCH_INITIAL_ADMIN_PASSWORD={password}

  • Volumes: ./opensearch-data:/usr/share/opensearch/data

  • Ports: 9200:9200, 9600:9600

  • Restart Policy: Default (managed by Docker Compose)

OpenSearch Dashboards

  • Image: opensearchproject/opensearch-dashboards:2.17.0

  • Container Name: opensearch-dashboards

  • Environment Variables:

  • OPENSEARCH_HOSTS=["https://opensearch-node1:9200"]

  • Ports: 5601:5601

  • Network: opensearch-net

Nginx Proxy (Certbot)

  • Image: jonasal/nginx-certbot:latest

  • Environment Variables:

  • [email protected]

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • Network Mode: host

Application Update Instructions

To update the OpenSearch application, navigate to the project directory and pull the latest images:

cd /home/{user}/opensearch-project
docker compose pull && docker compose up -d

Location of configuration files and data

Component Path/Location
OpenSearch Data /home/{user}/opensearch-project/opensearch-data
Docker Compose (App) /home/{user}/opensearch-project/docker-compose.yml
Nginx Configs /data/nginx/user_conf.d/
Nginx Compose /root/nginx/compose.yml

Available ports for connection

Service Port Access Type
OpenSearch API 9200 Internal/Local
OpenSearch Dashboards (Internal) 5601 Internal
Nginx Proxy (HTTPS) 443 External

Starting and Stopping the application

The application is managed via Docker Compose. Use the following commands from the project directory (/home/{user}/opensearch-project):

  • Start the application:

    docker compose up -d
    

  • Stop the application:

    docker compose down
    

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×