The environment background is docker DNMP installation of ES + PHP
Corresponding docker compose configuration and corresponding port
Port 9200 can also be accessed normally
Code
Then 500 errors are reported, including:
PHP Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:67
Stack trace:
#0 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(87): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection()
#1 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(105): Elasticsearch\Transport->getConnection()
#2 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(275): Elasticsearch\Transport->performRequest('POST', '/my_index/my_ty...', Array, '{"testField":"a...', Array)
#3 /www/localhost/vendor/react/promise/src/FulfilledPromise.php(28): Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array)
#4 /www/localhost/vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Clos in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php on line 67
The reason is that the node cannot be found. The solution is as follows: find your own IP and specify the IP
Then the execution is OK
Read More:
- [Solved] PHP Fatal error: Uncaught Error: Class ‘Redis‘ not found in
- [Solved] WordPress Upgrade PHP 5.6 to 7.x Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- Mac PHP Fatal error: Class ‘Memcache’ not found
- [Solved] Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60
- [Solved] Fatal error: Uncaught Error: Class ‘Imagick‘ not found
- How to Solve PHP Fatal error: Namespace declaration statement has to be the very first statement
- Error during session start; please check your PHP and/or webserver log file and configure your PHP
- How to Solve PHP Error: no package’oniguruma’ found
- Mac installs the php Swoole extension and appears Enable openssl support, require openssl library or fatal error:’openssl/ssl.h’ file not found
- /www/server/php/56/sbin/php-fpm:error while loading shared libraries:libssl.so.1.0. 0:cannot open shared object file:No such file or directory
- PHP use __Sleep() and __wakeup() method serializes the object
- PHP Error Object of class mysqli could not be converted to string in
- How to Hide index.php
- PHP: How to parse MHT file into HTML
- PHP error in Windows: class’ mysqli ‘not found
- [Solved] PHP installation Phalcon expansion error
- php Error: mail() Failed to connect to mailserver at “localhost” port 25
- Laravel-admin php artisan admin:install error reporting problem solution
- PHP encryption 3DES error Call to undefined function: mcrypt_module_open() solution
- [PHP]json_encode Chinese JSON_UNESCAPED_UNICODE returns null in php5.3