Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

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

80

30080

HTTP redirects to HTTPs.

443

30443

HTTPS port

8889

30889

WebSocket Port for Runtimes to connect

9500

32009

Ops Center Access Port

9501

30083

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

  1. 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:

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

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

  4. Paste the following content in onprem.conf

    
                
             
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    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;
    }
  5. 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`
  6. Start NGINX:

    service nginx restart