安装之前的准备
安装gcc |
sudo apt-get build-dep gcc |
安装openssl1.1.0e |
wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz |
安装pcre8.40 |
wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz |
安装zlib1.2.11 |
wget https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz |
2
安装
Nginx1.13.7 |
wget http://nginx.org/download/nginx-1.13.7.tar.gz |
执行下面命令进行编译
./configure --prefix=/usr/local/nginx --with-stream --with-stream_ssl_module \
--sbin-path=/home/nginx/nginx \
--conf-path=/home/nginx/nginx.conf \
--pid-path=/home/nginx/nginx.pid \
--with-http_ssl_module \
--with-pcre=/home/pcre-8.40 \
--with-zlib=/home/zlib-1.2.11 \
--with-openssl=/home/openssl-1.1.0e
安装注意事项
stream模块默认没有编译到nginx, 编译nginx时候 ./configure –with-stream 即可
3.
stream{
upstream pg{
server 192.168.0.184:5432;
server 192.168.0.185:5432;
}
server{
listen 1111;
proxy_pass pg;
}
}
4.
通过虚拟机部署三台Linux服务,在post1部署nginx环境,在postgres1和postgres2部署postgres-xl,实现post1负载postgres1和postgres2。