在群集Laravel Docker elasticsearch中未找到活动节点
我正在尝试使用elasticsearch来使用laravel和docker来搜索我的页面。在我进行测试运行时,它返回以下错误: 异常:“Elasticsearch\Common\Exceptions\NoNodeAvailableException” 文件:“/var/www/vendor/elasticsearch/elasticsearch/src/elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php” 电话:53 消息:“在群集中找不到活动节点” 我正在遵循中所述的指示。我已经在我的在群集Laravel Docker elasticsearch中未找到活动节点,docker,elasticsearch,laravel-5,Docker,elasticsearch,Laravel 5,我正在尝试使用elasticsearch来使用laravel和docker来搜索我的页面。在我进行测试运行时,它返回以下错误: 异常:“Elasticsearch\Common\Exceptions\NoNodeAvailableException” 文件:“/var/www/vendor/elasticsearch/elasticsearch/src/elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php” 电话:53 消息:“在
composer.json
文件中添加了“elasticquent/elasticquent”:“dev master”
,并在我的app.php
文件中添加了elasticquent\elasticquentelasticsearch'=>elasticquent\ElasticquentElasticsearchFacade::class,
我的模型是这样的:
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Elasticquent\ElasticquentTrait;
class Item extends Model
{
use ElasticquentTrait;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name'
];
/**
* cast dates
*
* @var array
*/
protected $dates = ['created_at', 'updated_at'];
/**
* The elasticsearch settings.
*
* @var array
*/
protected $indexSettings = [
'analysis' => [
'char_filter' => [
'replace' => [
'type' => 'mapping',
'mappings' => [
'&=> and '
],
],
],
'filter' => [
'word_delimiter' => [
'type' => 'word_delimiter',
'split_on_numerics' => false,
'split_on_case_change' => true,
'generate_word_parts' => true,
'generate_number_parts' => true,
'catenate_all' => true,
'preserve_original' => true,
'catenate_numbers' => true,
]
],
'analyzer' => [
'default' => [
'type' => 'custom',
'char_filter' => [
'html_strip',
'replace',
],
'tokenizer' => 'whitespace',
'filter' => [
'lowercase',
'word_delimiter',
],
],
],
],
];
protected $mappingProperties = array(
'id' => array(
'type' => 'integer',
'analyzer' => 'standard'
)
);
function getIndexName()
{
return 'get_product_name';
}
config/elasticquent.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' => ['localhost:9200'],
'retries' => 1,
],
/*
|--------------------------------------------------------------------------
| Default Index Name
|--------------------------------------------------------------------------
|
| This is the index name that Elasticquent will use for all
| Elasticquent models.
*/
'default_index' => 'get_product_name',
);
我正在使用我的Windows终端在docker中运行他们的图像。有人能帮我弄清楚吗?在网上找不到什么好主意。有人对此有想法吗?检查您是否在ES服务器上运行类似ufw的防火墙。有时,人们在访问es群集时使用动态IP地址。然后您必须在ES服务器上检查ufw规则。如果IP地址是动态的并且最近发生了变化,那么这些规则是否仍然符合IP地址