stream {
include /etc/nginx/stream.d/*.conf;
}
To Configure a Load Balancer for Anypoint Platform Private Cloud Edition
Anypoint Platform Private Cloud Edition must be run in production environment with multiple servers. To distribute traffic among servers and to restrict access to specific ports, you must install and configure a load balancer.
In a single server development environment, MuleSoft recommends using a load balancer. |
You can configure your load balancer to use any method for distributing client requests, but in most contexts a round robin strategy is ideal. This load balancer should be reachable through an IP address that is accessible to all machines in your network.
Your load balancer must route the following TCP ports:
Load Balancer Port | Instance Port | Internal Usage |
---|---|---|
|
|
HTTP redirects to HTTPs. |
|
|
HTTPS port |
|
|
WebSocket Port for Runtimes to connect |
|
|
Ops Center Access Port |
|
|
Monitoring Tooling Access Port |
In each case, your load balancer must listen on the Load Balancer Port and redirect incoming requests to the Instance Port. Your Anypoint Platform installation includes an internal NGINX server that listens on each of the configured instance ports, then performs the action listed in the Internal Usage column.
Your load balancer should poll the address HTTP:10248/healthz
to run a health check on your platform servers and confirm that they are accessible.
You do not need to configure SSL credentials in your load balancer. You can configure them using Anypoint Runtime Manager. |
To Configure a Load Balancer
-
Enable stream block in your
/etc/nginx/nginx.conf
file, by referencing all the configuration properties defined in/etc/nginx/stream.d/*
. You can achieve that by adding the following: -
Delete the
default.conf
file from/etc/nginx/conf.d
-
Create a folder named
/etc/nginx/stream.d
and in it create a file namedonprem.conf
-
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; }
-
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`
-
Start NGINX:
service nginx restart