gpt4 book ai didi

elasticsearch - Magento 2.4无法验证与Elasticsearch的连接。在群集中找不到事件的节点

转载 作者:行者123 更新时间:2023-12-03 02:11:05 25 4
gpt4 key购买 nike

我正在尝试将Magento 2.3商店升级到2.4。尝试这样做时,当我尝试运行bin/magento setup:upgrade时收到以下错误:Could not validate a connection to Elasticsearch. No alive nodes found in your cluster这是我到目前为止所拥有的。
我正在运行nginx,这是配置文件:

upstream panam_backend {
server php74:9000;
}

server {
listen 80;
server_name panam.localhost;
set $MAGE_ROOT /var/www/html/panam.localhost;

listen 443 ssl http2;
ssl_certificate /var/www/html/panam.localhost/key/panam.localhost.crt;
ssl_certificate_key /var/www/html/panam.localhost/key/panam.localhost.key;

root $MAGE_ROOT/pub;

index index.php;
autoindex off;
charset UTF-8;
error_page 404 403 = /errors/404.php;
#add_header "X-UA-Compatible" "IE=Edge";

# PHP entry point for setup application
location ~* ^/setup($|/) {
root $MAGE_ROOT;
location ~ ^/setup/index.php {
fastcgi_pass panam_backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ ^/setup/(?!pub/). {
deny all;
}

location ~ ^/setup/pub/ {
add_header X-Frame-Options "SAMEORIGIN";
}
}

# PHP entry point for update application
location ~* ^/update($|/) {
root $MAGE_ROOT;

location ~ ^/update/index.php {
fastcgi_split_path_info ^(/update/index.php)(/.+)$;
fastcgi_pass panam_backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}

# Deny everything but index.php
location ~ ^/update/(?!pub/). {
deny all;
}

location ~ ^/update/pub/ {
add_header X-Frame-Options "SAMEORIGIN";
}
}

location / {
try_files $uri $uri/ /index.php?$args;
}

location /pub/ {
location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) {
deny all;
}
alias $MAGE_ROOT/pub/;
add_header X-Frame-Options "SAMEORIGIN";
}

location /static/ {
# Uncomment the following line in production mode
# expires max;

# Remove signature of the static files that is used to overcome the browser cache
location ~ ^/static/version {
rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}

location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
expires +1y;

if (!-f $request_filename) {
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
}
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
add_header Cache-Control "no-store";
add_header X-Frame-Options "SAMEORIGIN";
expires off;

if (!-f $request_filename) {
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
}
if (!-f $request_filename) {
rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
add_header X-Frame-Options "SAMEORIGIN";
}

location /media/ {
try_files $uri $uri/ /get.php?$args;

location ~ ^/media/theme_customization/.*\.xml {
deny all;
}

location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
expires +1y;
try_files $uri $uri/ /get.php?$args;
}
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
add_header Cache-Control "no-store";
add_header X-Frame-Options "SAMEORIGIN";
expires off;
try_files $uri $uri/ /get.php?$args;
}
add_header X-Frame-Options "SAMEORIGIN";
}

location /media/customer/ {
deny all;
}

location /media/downloadable/ {
deny all;
}

location /media/import/ {
deny all;
}

# PHP entry point for main application
location ~ (index|get|static|report|404|503)\.php$ {
try_files $uri =404;
fastcgi_pass panam_backend;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

}

location /_cluster/health {
proxy_pass http://192.168.77.75:9250/_cluster/health;
}

gzip on;
gzip_disable "msie6";

gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/xml+rss
image/svg+xml;
gzip_vary on;

# Banned locations (only reached if the earlier PHP entry point regexes don't match)
location ~* (\.php$|\.htaccess$|\.git) {
deny all;
}

}
#
## Optional override of deployment mode. We recommend you use the
## command 'bin/magento deploy:mode:set' to switch modes instead.
##
## set $MAGE_MODE default; # or production or developer
##
## If you set MAGE_MODE in server config, you must pass the variable into the
## PHP entry point blocks, which are indicated below. You can pass
## it in using:
##
## fastcgi_param MAGE_MODE $MAGE_MODE;
##
## In production mode, you should uncomment the 'expires' directive in the /static/ location block
这是env.php文件:
<?php
return [
'cache_types' => [
'config' => 1,
'layout' => 1,
'block_html' => 1,
'collections' => 1,
'reflection' => 1,
'db_ddl' => 1,
'eav' => 1,
'customer_notification' => 1,
'target_rule' => 1,
'full_page' => 1,
'config_integration' => 1,
'config_integration_api' => 1,
'translate' => 1,
'config_webservice' => 1,
'compiled_config' => 1,
'vertex' => 1,
'google_product' => 0
],
'db' => [
'connection' => [
'default' => [
'dbname' => 'panam',
'host' => 'db',
'username' => 'root',
'password' => '',
'model' => 'mysql4',
'engine' => 'innodb',
'initStatements' => 'SET NAMES utf8;',
'active' => '1',
'profiler' => '1'
]
],
'table_prefix' => ''
],
'cache' => [
'frontend' => [
'default' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => 'redis',
'database' => '0',
'port' => '6379'
]
],
'page_cache' => [
'backend' => 'Cm_Cache_Backend_Redis',
'backend_options' => [
'server' => 'redis',
'port' => '6379',
'database' => '1',
'compress_data' => '0'
]
]
]
],
'MAGE_MODE' => 'developer',
'backend' => [
'frontName' => 'admin'
],
'crypt' => [
'key' => 'abfd843e41c08030189ad4ebaf1191f0'
],
'resource' => [
'default_setup' => [
'connection' => 'default'
]
],
'x-frame-options' => 'SAMEORIGIN',
'session' => [
'save' => 'redis',
'redis' => [
'host' => 'redis',
'port' => '6379',
'password' => '',
'timeout' => '2.5',
'persistent_identifier' => '',
'database' => '2',
'compression_threshold' => '2048',
'compression_library' => 'gzip',
'log_level' => '1',
'max_concurrency' => '6',
'break_after_frontend' => '5',
'break_after_adminhtml' => '30',
'first_lifetime' => '600',
'bot_first_lifetime' => '60',
'bot_lifetime' => '7200',
'disable_locking' => '0',
'min_lifetime' => '60',
'max_lifetime' => '2592000'
]
],
'install' => [
'date' => 'Fri, 06 Apr 2018 22:04:26 +0000'
],
'system' => [
'default' => [
'dev' => [
'debug' => [
'debug_logging' => '0'
]
],
'smile_elasticsuite_core_base_settings' => [
'es_client' => [
'servers' => '192.168.77.75:9250',
'enable_https_mode' => '0',
'enable_http_auth' => '0',
'http_auth_user' => '',
'http_auth_pwd' => ''
]
]
]
]
];
这是主机上 curl -XGET 'http://192.168.77.75:9250'的输出:
{
"name" : "ebrownserver",
"cluster_name" : "7.6",
"cluster_uuid" : "wWppBNI9SR29XtyhIZ-LnQ",
"version" : {
"number" : "7.6.2",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
"build_date" : "2020-03-26T06:34:37.794943Z",
"build_snapshot" : false,
"lucene_version" : "8.4.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
我已经重新启动了nginx和elasticsearch很多次了,但这没有帮助。
而且,就我的配置而言,nginx是在主机上设置的,而elasticsearch是在网络上的单独服务器上。我不知道这是否会改变任何东西,但是这就是现在的设置方式。
另外,elasticsearch曾经在主机上连接到主机上的Docker容器之前就开始引起很多问题。 docker容器的ip地址与当前使用的ip地址不同,因此可能正在发生尝试使用旧ip地址的缓存问题?不知道,只是把它扔在那里。
让我知道您是否需要更多信息。

最佳答案

如果您在单独的容器中运行elasticsearch,那么localhost是错误的主机名,则需要使用ES容器的主机名。

关于elasticsearch - Magento 2.4无法验证与Elasticsearch的连接。在群集中找不到事件的节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64674132/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com