title: Config ElasticSearch Magento 2.4 - No alive nodes found in your cluster
body: <p>When trying to search for a product in magento 2.4 returns the following error</p>
  <blockquote>
  <p>Exception #0 (Elasticsearch\Common\Exceptions\NoNodesAvailableException): No alive nodes found in your cluster</p>
  </blockquote>
  <p>Below configuration:</p>
  <ul>
  <li>PHP 7.4.1</li>
  <li>Nginx 1.14</li>
  <li>MySql 8</li>
  <li>ElasticSearch 7.9</li>
  </ul>
  <p>/etc/nginx/conf.d/100-magento2.conf</p>
  <pre><code>upstream fastcgi_backend {
      server   unix:/run/php-fpm/www.sock;
  }
  server {
    listen 80;
    server_name _;
  
    set $MAGE_ROOT /var/www/magento2;
    include /var/www/magento2/nginx.conf.sample;
  
  }
  </code></pre>
  <p>/etc/nginx/conf.d/90-es.conf</p>
  <pre><code>upstream   elasticsearch {
     server 127.0.0.1:9200;
  }
  
  
  server {
     server_name _;
     listen 8080;
     location / {
       limit_except HEAD {
          auth_basic &quot;Restricted&quot;;
          auth_basic_user_file  /etc/nginx/passwd/.esnginx;
       }
       proxy_pass http://127.0.0.1:9200;
       proxy_redirect off;
       proxy_set_header Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  
    location /_aliases {
     auth_basic &quot;Restricted&quot;;
     auth_basic_user_file  /etc/nginx/passwd/.esnginx;
     proxy_pass http://127.0.0.1:9200;
     proxy_redirect off;
     proxy_set_header Host $host;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  
    include /etc/nginx/auth/*.conf;
  }
  </code></pre>
  <p>If try: bin/magento config:show catalog/search/engine<br></p>
  <blockquote>
  <p>Result: elasticsearch7</p>
  </blockquote>
  <p>If try: curl -i localhost:9200/_cluster/health?pretty</p>
  <pre><code>HTTP/1.1 200 OK
  content-type: application/json; charset=UTF-8
  content-length: 461
  
  {
    &quot;cluster_name&quot; : &quot;magento2&quot;,
    &quot;status&quot; : &quot;yellow&quot;,
    &quot;timed_out&quot; : false,
    &quot;number_of_nodes&quot; : 1,
    &quot;number_of_data_nodes&quot; : 1,
    &quot;active_primary_shards&quot; : 3,
    &quot;active_shards&quot; : 3,
    &quot;relocating_shards&quot; : 0,
    &quot;initializing_shards&quot; : 0,
    &quot;unassigned_shards&quot; : 3,
    &quot;delayed_unassigned_shards&quot; : 0,
    &quot;number_of_pending_tasks&quot; : 0,
    &quot;number_of_in_flight_fetch&quot; : 0,
    &quot;task_max_waiting_in_queue_millis&quot; : 0,
    &quot;active_shards_percent_as_number&quot; : 50.0
  }
  </code></pre>
  <p>And if try in web:<br>
  <a href="https://i.stack.imgur.com/NCDvB.png" rel="nofollow noreferrer">Configuration by web</a></p>
  <p>elasticsearch.yml:
  <a href="https://i.stack.imgur.com/ZEfHk.png" rel="nofollow noreferrer">elasticsearch.yml</a></p>