Nav

Creating a Load Balancer for On-premises Platform

This document walks you through the steps of creating a NGINX load balancer for handling the traffic to the nodes where you’ve installed the Anypoint Platform on-Premises Edition. You should manually create this load balancer as part of the installation procedure. Note that you’re free to create this load balancer with any other tool instead of NGINX if you prefer.

  1. Enable stream block in your /etc/nginx/nginx.conf file, by referencing all the config from /etc/nginx/stream.d/*. You can achieve that by adding the following:

stream {
   include /etc/nginx/stream.d/*.conf;
}
  1. Delete the default.conf file from /etc/nginx/conf.d

  2. Create a folder named /etc/nginx/stream.d and in it create a file named onprem.conf

  3. Paste the following content in onprem.conf

server {
   listen 80;
   proxy_pass 0.0.0.0:30080;
}

server {
   listen 443;
   proxy_pass 0.0.0.0:30443;
}

server {
   listen 8889;
   proxy_pass 0.0.0.0:30889;
}

server {
   listen 9500;
   proxy_pass 0.0.0.0:32009;
}

server {
   listen 9501;
   proxy_pass 0.0.0.0:30083;
}

+

If you’re installing the platform on an AWS, you need to enable the default ports on SELinux before starting the NGINX. Run the following commands one by one:

`semanage port -a -t http_port_t  -p tcp 8889`
`semanage port -a -t http_port_t  -p tcp 9500`
`semanage port -a -t http_port_t  -p tcp 9501`
  1. Start NGINX service nginx restart

    If you’re installing the platform on an AWS, you must also run the following command:

    `/usr/sbin/setsebool httpd_can_network_connect true`