title: Elasticsearch PHP client throwing exception "No alive nodes found in your cluster"
body: <p>I am trying to do a scan and scroll operation on an index as shown in the <a href="https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_search_operations.html#_scan_scroll">example</a> :</p>
  
  <pre><code>$client = ClientBuilder::create()-&gt;setHosts([MYESHOST])-&gt;build();
  $params = [
      "search_type" =&gt; "scan",    // use search_type=scan
      "scroll" =&gt; "30s",          // how long between scroll requests. should be small!
      "size" =&gt; 50,               // how many results *per shard* you want back
      "index" =&gt; "my_index",
      "body" =&gt; [
          "query" =&gt; [
              "match_all" =&gt; []
          ]
      ]
  ];
  
  $docs = $client-&gt;search($params);   // Execute the search
  $scroll_id = $docs['_scroll_id'];   // The response will contain no results, just a _scroll_id
  
  // Now we loop until the scroll "cursors" are exhausted
  while (\true) {
  
      // Execute a Scroll request
      $response = $client-&gt;scroll([
              "scroll_id" =&gt; $scroll_id,  //...using our previously obtained _scroll_id
              "scroll" =&gt; "30s"           // and the same timeout window
          ]
      );
  
      // Check to see if we got any search hits from the scroll
      if (count($response['hits']['hits']) &gt; 0) {
          // If yes, Do Work Here
  
          // Get new scroll_id
          // Must always refresh your _scroll_id!  It can change sometimes
          $scroll_id = $response['_scroll_id'];
      } else {
          // No results, scroll cursor is empty.  You've exported all the data
          break;
      }
  }
  </code></pre>
  
  <p>The first <code>$client-&gt;search($params)</code> API call executes fine and I am able to get back the scroll id. But <code>$client-&gt;scroll()</code> API fails and I am getting the exception : <strong>"Elasticsearch\Common\Exceptions\NoNodesAvailableException No alive nodes found in your cluster"</strong></p>
  
  <p>I am using Elasticsearch 1.7.1 and PHP 5.6.11</p>
  
  <p>Please help</p>