L7 Load Balancing with the Data Access Gateway
You can use nginx
for L7 load balancing of clients that use the
Data Access Gateway. This topic describes how to install, configure, and run
nginx
, and how to set your client connection string to connect to the
load balancing service.
Prerequisites
Procedure
-
Install the
nginx
service on the server you have identified:sudo yum install nginx
sudo apt install nginx
sudo zypper install nginx
-
Configure the
nginx
service by setting the following parameters in the configuration file at/etc/nginx/nginx.conf
: -
Restart the
nginx
service:sudo service nginx restart
What to do next
Setting Your Client Connection String
Assume you have the following
nginx
configuration settings and you
have installed nginx
on node1.cluster.com
:user mapr;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request"'
'$status $body_bytes_sent "$http_referer"'
'"$http_user_agent"';
upstream servers {
server node1.cluster.com:5678;
server node2.cluster.com:5678;
}
server {
listen 80 ssl http2;
listen [::]:80;
ssl_certificate /opt/mapr/conf/ssl_keystore.pem;
ssl_certificate_key /opt/mapr/conf/ssl_keystore.pem;
ssl_password_file /root/passwd;
access_log logs/access.log main;
location / {
grpc_pass grpcs://servers;
}
}
}
You can use the following client connection string with this sample configuration:
node1.cluster.com:80?auth=basic;user=mapr;password=mapr;ssl=true;sslCA=/opt/mapr/conf/ssl_truststore.pem;sslTargetNameOverride=node1.cluster.com