2017-03-02 135 views
0

我使用elasticsearch 5.2.2 Laravel 5.4,我得到以下錯誤,當我瀏覽StaticNoPingConnectionPool.php線51 http://pr3.app:8000腓Elasticsearch錯誤

NoNodesAvailableException「在集羣中沒有發現活節點」:

在集羣中沒有發現活節點

我的配置:

  • 在composer.json中,我添加了"elasticsearch/elasticsearch": "~5.0""require"

  • 然後我運行命令composer update

  • 爲了測試Elasticsearch,我寫了一首歌routes/web.php

    Route::get('/', function() { 
        $es = Elasticsearch\ClientBuilder::create() 
         ->setHosts(['pr3.app:9200']) 
         ->build(); 
    
        $indexed = $es->index([ 
         'index' => 'people', 
         'type' => 'persons', 
         'body' => [ 
          'firstName' => 'John', 
          'lastName' => 'Doe', 
          'gender' => 'male', 
         ], 
        ]); 
    }); 
    
  • 流浪啓動並工作正常以下。 Elasticsearch也。 當我瀏覽http://pr3.app:9200,我可以看到以下內容:

{ "name": "FAkNvtq", "cluster_name": "elasticsearch", "cluster_uuid": "M5pNi9p0TF2udk7DNwcFZQ", "version": { "number": "5.2.2", "build_hash": "f9d9b74", "build_date": "2017-02-24T17:26:45.835Z", "build_snapshot": false, "lucene_version": "6.4.1" }, "tagline": "You Know, for Search" }

當我瀏覽http://pr3.app:9200/_search,我能看到我使用郵差創建的所有文件。

我是否在配置中缺少某些東西來進行ealsticsearch與Laravel的合作?

回答

1

我用laragon而不是宅基地和wamp。

謝謝你沒有答案:(