Magento 2 and ElasticSearch errors. Connection Failed. Test again?
i need some help with configuring my elastic search on magento 2.2.3 and i'm using ES 2.3.
I login and configure here: Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.
It's on a remote aws server and i know it's configured on port 443 so i changed the port to 443 rather than 9200 and i've changed the Elasticsearch Server Hostname to the correct endpoint.
- telnet from admin to ES works
as does curl
- so not a network / firewall iss
- Elasticsearch Index Prefix is correct
- cluster name is correct
After that i followed these instructions here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg-upload-data.html
- I was able to upload a new search document and then I was able to retrieve it as well. So once again the networking between the two is good.
Is there a php dependency that i'm missing or a third party magento plugin that needs to be installed to assist? Please help. Thanks in advance.
magento2.2.3 curl elasticsearch
add a comment |
i need some help with configuring my elastic search on magento 2.2.3 and i'm using ES 2.3.
I login and configure here: Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.
It's on a remote aws server and i know it's configured on port 443 so i changed the port to 443 rather than 9200 and i've changed the Elasticsearch Server Hostname to the correct endpoint.
- telnet from admin to ES works
as does curl
- so not a network / firewall iss
- Elasticsearch Index Prefix is correct
- cluster name is correct
After that i followed these instructions here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg-upload-data.html
- I was able to upload a new search document and then I was able to retrieve it as well. So once again the networking between the two is good.
Is there a php dependency that i'm missing or a third party magento plugin that needs to be installed to assist? Please help. Thanks in advance.
magento2.2.3 curl elasticsearch
add a comment |
i need some help with configuring my elastic search on magento 2.2.3 and i'm using ES 2.3.
I login and configure here: Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.
It's on a remote aws server and i know it's configured on port 443 so i changed the port to 443 rather than 9200 and i've changed the Elasticsearch Server Hostname to the correct endpoint.
- telnet from admin to ES works
as does curl
- so not a network / firewall iss
- Elasticsearch Index Prefix is correct
- cluster name is correct
After that i followed these instructions here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg-upload-data.html
- I was able to upload a new search document and then I was able to retrieve it as well. So once again the networking between the two is good.
Is there a php dependency that i'm missing or a third party magento plugin that needs to be installed to assist? Please help. Thanks in advance.
magento2.2.3 curl elasticsearch
i need some help with configuring my elastic search on magento 2.2.3 and i'm using ES 2.3.
I login and configure here: Click Stores > Settings > Configuration > Catalog > Catalog > Catalog Search.
It's on a remote aws server and i know it's configured on port 443 so i changed the port to 443 rather than 9200 and i've changed the Elasticsearch Server Hostname to the correct endpoint.
- telnet from admin to ES works
as does curl
- so not a network / firewall iss
- Elasticsearch Index Prefix is correct
- cluster name is correct
After that i followed these instructions here: https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-gsg-upload-data.html
- I was able to upload a new search document and then I was able to retrieve it as well. So once again the networking between the two is good.
Is there a php dependency that i'm missing or a third party magento plugin that needs to be installed to assist? Please help. Thanks in advance.
magento2.2.3 curl elasticsearch
magento2.2.3 curl elasticsearch
asked May 24 '18 at 17:37
SupplementSupplement
2117
2117
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
After going through the standard magento docs and aws docs we realized it wasn't connecting successfully. We believe it was because magento is sending non-SSL packets to the ElasticSearch server but ES is only listening for (443) SSL. Changing what Nginx was listening for and to proxy AWS Elasticsearch seemed to fix the problem. This may only be a temp. solution. It would be good to talk to magento and see what they recommend.
If anyone else has any input than that would be great too. Unfortunately it appears in my magento account I can no longer submit tickets so reaching out to magento has become obsolete.
/var/www/html/vendor/magento/module-elasticsearch
/**
* @param array $options
* @return array
*/
private function buildConfig($options = )
{
$host = preg_replace('/http[s]?:///i', '', $options['hostname']);
$protocol = parse_url($options['hostname'], PHP_URL_SCHEME);
if (!$protocol) {
$protocol = 'http';
}
if (!empty($options['port'])) {
$host .= ':' . $options['port'];
}
if (!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) {
$host = sprintf('%s://%s:%s@%s', $protocol, $options['username'], $options['password'], $host);
}
$options['hosts'] = [$host];
return $options;
}
If anyone is interested I can post the Nginx configurations too.
add a comment |
Unfortunately I also had this problem, I figured the best solution was to use Nginx to proxy HTTP requests internally through to AWS ElasticSearch. The config is:
server {
server_name localhost;
listen 8080;
location / {
proxy_pass https://your-amazon-vpc-url-here.es.amazonaws.com;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Within Magento2 then I set host as localhost
and port as 8080
- works fine.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f227420%2fmagento-2-and-elasticsearch-errors-connection-failed-test-again%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
After going through the standard magento docs and aws docs we realized it wasn't connecting successfully. We believe it was because magento is sending non-SSL packets to the ElasticSearch server but ES is only listening for (443) SSL. Changing what Nginx was listening for and to proxy AWS Elasticsearch seemed to fix the problem. This may only be a temp. solution. It would be good to talk to magento and see what they recommend.
If anyone else has any input than that would be great too. Unfortunately it appears in my magento account I can no longer submit tickets so reaching out to magento has become obsolete.
/var/www/html/vendor/magento/module-elasticsearch
/**
* @param array $options
* @return array
*/
private function buildConfig($options = )
{
$host = preg_replace('/http[s]?:///i', '', $options['hostname']);
$protocol = parse_url($options['hostname'], PHP_URL_SCHEME);
if (!$protocol) {
$protocol = 'http';
}
if (!empty($options['port'])) {
$host .= ':' . $options['port'];
}
if (!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) {
$host = sprintf('%s://%s:%s@%s', $protocol, $options['username'], $options['password'], $host);
}
$options['hosts'] = [$host];
return $options;
}
If anyone is interested I can post the Nginx configurations too.
add a comment |
After going through the standard magento docs and aws docs we realized it wasn't connecting successfully. We believe it was because magento is sending non-SSL packets to the ElasticSearch server but ES is only listening for (443) SSL. Changing what Nginx was listening for and to proxy AWS Elasticsearch seemed to fix the problem. This may only be a temp. solution. It would be good to talk to magento and see what they recommend.
If anyone else has any input than that would be great too. Unfortunately it appears in my magento account I can no longer submit tickets so reaching out to magento has become obsolete.
/var/www/html/vendor/magento/module-elasticsearch
/**
* @param array $options
* @return array
*/
private function buildConfig($options = )
{
$host = preg_replace('/http[s]?:///i', '', $options['hostname']);
$protocol = parse_url($options['hostname'], PHP_URL_SCHEME);
if (!$protocol) {
$protocol = 'http';
}
if (!empty($options['port'])) {
$host .= ':' . $options['port'];
}
if (!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) {
$host = sprintf('%s://%s:%s@%s', $protocol, $options['username'], $options['password'], $host);
}
$options['hosts'] = [$host];
return $options;
}
If anyone is interested I can post the Nginx configurations too.
add a comment |
After going through the standard magento docs and aws docs we realized it wasn't connecting successfully. We believe it was because magento is sending non-SSL packets to the ElasticSearch server but ES is only listening for (443) SSL. Changing what Nginx was listening for and to proxy AWS Elasticsearch seemed to fix the problem. This may only be a temp. solution. It would be good to talk to magento and see what they recommend.
If anyone else has any input than that would be great too. Unfortunately it appears in my magento account I can no longer submit tickets so reaching out to magento has become obsolete.
/var/www/html/vendor/magento/module-elasticsearch
/**
* @param array $options
* @return array
*/
private function buildConfig($options = )
{
$host = preg_replace('/http[s]?:///i', '', $options['hostname']);
$protocol = parse_url($options['hostname'], PHP_URL_SCHEME);
if (!$protocol) {
$protocol = 'http';
}
if (!empty($options['port'])) {
$host .= ':' . $options['port'];
}
if (!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) {
$host = sprintf('%s://%s:%s@%s', $protocol, $options['username'], $options['password'], $host);
}
$options['hosts'] = [$host];
return $options;
}
If anyone is interested I can post the Nginx configurations too.
After going through the standard magento docs and aws docs we realized it wasn't connecting successfully. We believe it was because magento is sending non-SSL packets to the ElasticSearch server but ES is only listening for (443) SSL. Changing what Nginx was listening for and to proxy AWS Elasticsearch seemed to fix the problem. This may only be a temp. solution. It would be good to talk to magento and see what they recommend.
If anyone else has any input than that would be great too. Unfortunately it appears in my magento account I can no longer submit tickets so reaching out to magento has become obsolete.
/var/www/html/vendor/magento/module-elasticsearch
/**
* @param array $options
* @return array
*/
private function buildConfig($options = )
{
$host = preg_replace('/http[s]?:///i', '', $options['hostname']);
$protocol = parse_url($options['hostname'], PHP_URL_SCHEME);
if (!$protocol) {
$protocol = 'http';
}
if (!empty($options['port'])) {
$host .= ':' . $options['port'];
}
if (!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) {
$host = sprintf('%s://%s:%s@%s', $protocol, $options['username'], $options['password'], $host);
}
$options['hosts'] = [$host];
return $options;
}
If anyone is interested I can post the Nginx configurations too.
answered May 25 '18 at 14:40
SupplementSupplement
2117
2117
add a comment |
add a comment |
Unfortunately I also had this problem, I figured the best solution was to use Nginx to proxy HTTP requests internally through to AWS ElasticSearch. The config is:
server {
server_name localhost;
listen 8080;
location / {
proxy_pass https://your-amazon-vpc-url-here.es.amazonaws.com;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Within Magento2 then I set host as localhost
and port as 8080
- works fine.
New contributor
add a comment |
Unfortunately I also had this problem, I figured the best solution was to use Nginx to proxy HTTP requests internally through to AWS ElasticSearch. The config is:
server {
server_name localhost;
listen 8080;
location / {
proxy_pass https://your-amazon-vpc-url-here.es.amazonaws.com;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Within Magento2 then I set host as localhost
and port as 8080
- works fine.
New contributor
add a comment |
Unfortunately I also had this problem, I figured the best solution was to use Nginx to proxy HTTP requests internally through to AWS ElasticSearch. The config is:
server {
server_name localhost;
listen 8080;
location / {
proxy_pass https://your-amazon-vpc-url-here.es.amazonaws.com;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Within Magento2 then I set host as localhost
and port as 8080
- works fine.
New contributor
Unfortunately I also had this problem, I figured the best solution was to use Nginx to proxy HTTP requests internally through to AWS ElasticSearch. The config is:
server {
server_name localhost;
listen 8080;
location / {
proxy_pass https://your-amazon-vpc-url-here.es.amazonaws.com;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Within Magento2 then I set host as localhost
and port as 8080
- works fine.
New contributor
New contributor
answered 9 mins ago
Hunter JamesHunter James
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f227420%2fmagento-2-and-elasticsearch-errors-connection-failed-test-again%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown