当尝试在magento 2.4中搜索产品时,返回以下错误
异常#0(elasticsearch\common\exceptions\nonodesavailableexception):在集群中找不到活动节点
以下配置:
php 7.4.1版
nginx 1.14型
mysql 8版
ElasticSearch7.9
/etc/nginx/conf.d/100-magento2.conf文件
upstream fastcgi_backend {
server unix:/run/php-fpm/www.sock;
}
server {
listen 80;
server_name _;
set $MAGE_ROOT /var/www/magento2;
include /var/www/magento2/nginx.conf.sample;
}
/etc/nginx/conf.d/90-es.conf文件
upstream elasticsearch {
server 127.0.0.1:9200;
}
server {
server_name _;
listen 8080;
location / {
limit_except HEAD {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/passwd/.esnginx;
}
proxy_pass http://127.0.0.1:9200;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /_aliases {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/passwd/.esnginx;
proxy_pass http://127.0.0.1:9200;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
include /etc/nginx/auth/*.conf;
}
如果尝试:bin/magentoconfig:show catalog/search/engine
结果:elasticsearch7
如果尝试:curl-ilocalhost:9200/_cluster/health?pretty
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 461
{
"cluster_name" : "magento2",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 3,
"active_shards" : 3,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 3,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 50.0
}
如果在网上试一试:
按web配置
elasticsearch.yml:ElasticSearch.yml
暂无答案!
目前还没有任何答案,快来回答吧!