3

I recently got a separate server because I heard that it is a more efficient way to run elastic search and varnish caching. I currently have a web server that runs everything on it. I have a few questions about how to get this setup properly in my magento settings. I'm using Magento 2.1.4

Does the elastic search service have to run on the same server as the mysql database?

Would I put the public ip and port for the separate server in the backend host and port settings? Will I need to do anything else? enter image description here

Since I now have this server, are there any recommendations for how I can vastly improve the speed and performance of my magento 2 website?

2 Answers 2

4

you need to put your worker server ip address, where is your magento installed. not only magento settings but webserver must communicate with Varnish too. make sure you have apache/nginx configured, and better to put Varnish behind.

there is a lot of questions already answered:

i think maybe better to put Varnish behind, so nginx listen in front :80 and :443 ports, and proxy all back to Varnish, where Varnish proxy all back to nginx.

ELK stack can be installed anywhere, you just point to its IP address in Magento extension configuration.

2
  • Do I need to install the elastic search engine on the same machine as the mysql database?
    – DarthVegan
    Apr 6, 2017 at 1:51
  • it can be anywhere, in configuration you need to enter ELK server IP address
    – MagenX
    Apr 6, 2017 at 6:43
1

This solution worked for me. To configure Varnish and Magento on a different server.

Varnish server: xxx.xxx.xxx.xxx port 80

Magento server: yyy.yyy.yyy.yyy port 80

Changes need to be made on the varnish server:

  1. login to varnish server

  2. go to file /etc/varnish/default.vcl

  3. under the "backend default" update

    .host = "yyy.yyy.yyy.yyy";//(use Magento server IP for better network) .port = "80";//(Magento web server port)

  4. Restart the Varnish (systemctl restart varnish)

Note: Kindly use the default VCL that is generated during the varnish installation and don't update it with Magento generated VCL for varnish ( available from Magento Admin)

Changes need to be made on the Magento server:

  1. Log in to the Magento server
  2. Go to the env.php file located in the app/etc directory
  3. Update the values in 'http_cache_hosts' => [ [ 'host' => 'xxx.xxx.xxx.xxx', //(varnish server public ip) 'port' => '80' // ( varnish server port) ] ] Now update your base URL's on the core_config_data table to your varnish public Ip (http://xxx.xxx.xxx.xxx/) flush the Magento caches ( bin/magento ca:fl)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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