You can use nginx for L7 load balancing of clients that use the MapR
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.
Setting Your Client Connection String
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
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 http2;
listen [::]:80;
access_log logs/access.log main;
location / {
grpc_pass grpc://servers;
}
}
}
You can use the following client connection string with this sample configuration:
node1.cluster.com:80?auth=basic;user=mapr;password=mapr;ssl=false