To work correctly, the nginx balancer must be built together with the sticky module, which ensures the binding of a certain user session to a specific BI server. Consider build order in Ubuntu 18.04.
Download and extract the sticky module files at: https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/src/master/.
Download nginx:
Set dependencies required for nginx to work:
Generate and execute a command to configure a build. In the --add-module key specify the path to the sticky installation files obtained in the first step:
./configure --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads --add-module=<path to sticky files>
Run the nginx build and installation:
The nginx uses settings from the nginx.conf file located in the /etc/nginx/ folder. The example of the file structure required to work with BI servers is given in the Creating Cluster of BI Servers>Configure the Balancer to Work with BI Servers subsection. For details about directives used in the configuration file, see the developer documentation at https://nginx.org/en/docs/.
To run nginx, execute the command:
If it is required to run nginx as a background service, execute the following operations:
Create the file /lib/systemd/system/nginx.service.
Add the service startup options to it:
Create the /var/lib/nginx directory:
sudo mkdir -p /var/lib/nginx
Execute the commands to start the service:
See also: