[英]elasticsearch php api Elasticsearch\Common\Exceptions\NoNodesAvailableException
I have the following PHP script: 我有以下PHP脚本:
$client = Elasticsearch\ClientBuilder::create()->build();
$params = [
'index' => 'my_index',
'type' => 'My_type',
'id' => 'AVlV2YcFAEkAZoTQQTlH'
];
var_dump( $client->get($params));
When I run the script through the command line using php a.php
it works fine but when I visit the page at http://localhost/a.php when it is running with Apache, I recieve the following error: 当我使用
php a.php
通过命令行运行脚本时,它可以正常工作,但是当我在http://localhost/a.php上与Apache运行时访问该页面时,收到以下错误消息:
Type: Elasticsearch\Common\Exceptions\NoNodesAvailableException
Message: No alive nodes found in your cluster
This is a network(firewall) issue. 这是一个网络(防火墙)问题。
run this command: 运行以下命令:
setsebool -P httpd_can_network_connect on
SELinux doesn't allow httpd daemon to talk to the elastic service. SELinux不允许httpd守护程序与弹性服务通信。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.