环境背景为docker dnmp 安装 ES+PHP
对应docker-compose配置及对应端口
也可正常访问9200端口
代码
然后出现了500报错,报错内容:
PHP Fatal error: Uncaught ElasticsearchCommonExceptionsNoNodesAvailableException: 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): ElasticsearchConnectionPoolStaticNoPingConnectionPool->nextConnection() #1 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(105): ElasticsearchTransport->getConnection() #2 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(275): ElasticsearchTransport->performRequest('POST', '/my_index/my_ty...', Array, '{"testField":"a...', Array) #3 /www/localhost/vendor/react/promise/src/FulfilledPromise.php(28): ElasticsearchConnectionsConnection->ElasticsearchConnections{closure}(Array) #4 /www/localhost/vendor/ezimuel/ringphp/src/Future/CompletedFuturevalue.php(55): ReactPromiseFulfilledPromise->then(Object(Clos in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php on line 67
然后执行就OK了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)