1

I'm trying to connect my Magento to AWS elasticsearch service but I can't get a successfull connection.

Magento is running on an AWS EC2 instance which the IP address is allowed on Elasticsearch access policy. ES is version 6.8, and Magento 2.3.1.

In

stores configuration > Catalog > Catalog > Catalog Search

I've tryed to configure it with the given endpoint in ES service admin panel on AWS, with ports 9200, 9300, 443, 80 and could not connect

Configuration example

My Elasticsearch doesn't have an user and pass to set HTTP auth.

Does anyone have made this integration and can help me out?

Thanks!

1

I was able to make the connection by making Nginx changes. I created a configuration file for nginx to proxy messages to my AWS ES.

So in my /etc/nginx/conf.d/ a .conf file with the following content:

server {
    listen 8080;
    location / {
            proxy_pass https://myAwsElasticsearchServiceEndpoint.com;
    }
}

Then in

"stores configuration > Catalog > Catalog > Catalog Search"

I configured:

A successfull connection was made, and running reindex I could comprove that data was sent to AWS ES.

If someone knows a better way or why this way is not good please let me know!

Thanks!

  • not sure why you need to proxy external connection... – MagenX Oct 8 '19 at 20:06
0

My AWS Elasticsearch Cluster is in AWS VPC and so is my AWS EC2 Magento Instance.

The AWS Security Group has HTTP (80) and HTTPS (443) ports allowed as Inbound Rules associated with the AWS Elasticsearch Cluster.

I used the following configurations:

  • I can confirm using 2.3 and AWS elastic search 6.0 and deployed in the same VPC as the ec2 instance was successful with no need for a reverse proxy – asherrard Jul 24 '20 at 21:56
0

I also wasn't able to connect to AWS Elasticsearch when Magento 2 runs at another hoster.

Using the described solution from above worked, although the configuratio in Magento 2 backend is like this:

  • Elasticsearch Server Hostname: 127.0.0.1 - it connects to your local server, do not put the AWS ES endpoint here
  • ...

P.S. For those asking why using a proxy is a good thing, check Magento dev docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.