Skip to content

Magento 2.4.6 OpenSearch installation – Could not validate a connection to the OpenSearch. No alive nodes found in your cluster

Pulling my hair out the last few days trying to configure Magento on a new server using OpenSearch instead of ElasticSearch and can’t get it to connect.

OpenSearch latest (2.9.0) is up and running. No problems, dashboard and everything working. Curl responding etc. However the same error “Could not validate a connection to the OpenSearch. No alive nodes found in your cluster” appears each time.

I CAN get it to work by disabling security on the nodes by adding plugins.security.disabled: true to the /usr/share/opensearch/config/opensearch.yml, however this disables the dashboard login.

I assume this should be a simple fix, however the collective knowledge of the internet, Adobe tutorials, the same question asked before…nobody seems to have come up with a coherent answer or tutorial on exactly how to connect the two things.

The server running Magento 2.4.6, PHP 8.2, Opensearch latest 2.9.0, CWP Pro installed (ports 9200 & 9600 open on firewall).

curl -XGET –insecure -u ‘admin:admin’ ‘https://localhost:9200’ returns

{
  "name" : "axxamarket-node1",
  "cluster_name" : "axxamarket-cluster",
  "cluster_uuid" : "PWEvt_ugTE2u9sTXYfegyQ",
  "version" : {
    "distribution" : "opensearch",
    "number" : "2.9.0",
    "build_type" : "tar",
    "build_hash" : "1164221ee2b8ba3560f0ff492309867beea28433",
    "build_date" : "2023-07-18T21:23:29.367080729Z",
    "build_snapshot" : false,
    "lucene_version" : "9.7.0",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

However in the admin area….

No alive nodes found in your cluster

The content of the docker-compose.yml file…

version: '3'
services:
  opensearch-node1:
    image: opensearchproject/opensearch:latest
    container_name: axxamarket-node1
    environment:
      - cluster.name=axxamarket-cluster
      - node.name=axxamarket-node1
      - discovery.seed_hosts=axxamarket-node1,axxamarket-node2
      - cluster.initial_cluster_manager_nodes=axxamarket-node1,axxamarket-node2
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - "OPENSEARCH_JAVA_OPTS=-Xms10g -Xmx10g" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
        hard: 65536
    volumes:
      - opensearch-data1:/usr/share/opensearch/data
    ports:
      - 9200:9200
      - 9600:9600 # required for Performance Analyzer
    networks:
      - opensearch-net
  opensearch-node2:
    image: opensearchproject/opensearch:latest
    container_name: axxamarket-node2
    environment:
      - cluster.name=axxamarket-cluster
      - node.name=axxamarket-node2
      - discovery.seed_hosts=axxamarket-node1,axxamarket-node2
      - cluster.initial_cluster_manager_nodes=axxamarket-node1,axxamarket-node2
      - bootstrap.memory_lock=true
      - "OPENSEARCH_JAVA_OPTS=-Xms10g -Xmx10g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - opensearch-data2:/usr/share/opensearch/data
    networks:
      - opensearch-net
  opensearch-dashboards:
    image: opensearchproject/opensearch-dashboards:latest
    container_name: axxamarket-dashboards
    ports:
      - 5601:5601
    expose:
      - "5601"
    environment:
      OPENSEARCH_HOSTS: '["https://axxamarket-node1:9200","https://axxamarket-node2:9200"]'
    networks:
      - opensearch-net

volumes:
  opensearch-data1:
  opensearch-data2:

networks:
  opensearch-net:

This should be an easily findable tutorial on the setup however it appears even though Magento 2 has moved (technically) to OpenSearch entirely, the web is still full of ElasticSearch information and nobody is talking about this. Even Adobe themselves.

Any help appreciated!!