我已经将Elasticsearch下载到本地,我已经成功地在本地主机上运行elasticsearch。我目前在Laravel 5.2上使用elasticquent,当我尝试从本地主机('localhost:9200')切换并添加一个索引时,它会在下面提示一个错误。NoNodesAvailableException带有消息'没有在您的群集中找到活动节点' - Laravel 5.2和Heroku搜索框添加
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'
当我使用本地主机时,它运行良好,并且能够立即创建索引。
这是我的配置文件(配置\ 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:[email protected]: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
我没有想过使用端口80,我将对此进行测试,今晚,我会回来为upda TE。希望这能起作用,因为我正在努力将我的模型映射到elasticsearch。谢啦。 –