我已经下载了Elasticsearch到我的本地,我已经成功地在本地主机上运行了elasticsearch。我目前正在Laravel 5.2上使用elasticquent,当我试图从本地主机('localhost:9200')切换到添加索引时,它提示下面的错误。
Psy Shell v0.7.2 (PHP 5.5.12 ΓÇö cli) by Justin Hileman
>>> App\Products::createIndex($shards = null, $replicas = null);
Elasticsearch\Common\Exceptions\NoNodesAvailableException with message 'No alive
nodes found in your cluster'当我使用localhost时,它运行得很好,并且能够立即创建索引。
这是我的配置文件(config\elasticquent.php)
<?php
return array(
/*
|--------------------------------------------------------------------------
| Custom Elasticsearch Client Configuration
|--------------------------------------------------------------------------
|
| This array will be passed to the Elasticsearch client.
| See configuration options here:
|
| http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html
*/
'config' => [
//'hosts' => ['http://xxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@dori-xx-xxx-1.searchly.com:9300'],
'hosts' => ['localhost:9200'],
'retries' => 1,
],
/*
|--------------------------------------------------------------------------
| Default Index Name
|--------------------------------------------------------------------------
|
| This is the index name that Elasticquent will use for all
| Elasticquent models.
*/
'default_index' => 'bossing_default_index',
);我想知道这是否与集群名称有关,但找不到如何使用elasticquent.php配置文件更改集群名称的文档。请帮帮忙。提前谢谢你。
我的searhbox主机运行得很好。
顺便说一句,这是指向elasticquent:https://github.com/elasticquent/Elasticquent的链接,我目前使用的是elasticsearch 2.3.xx
https://stackoverflow.com/questions/38081082
复制相似问题