上传nginx安装包
编译安装
./configure --with-stream --without-http_rewrite_module
make
make install

 

默认安装在cd /usr/local
设置nginx.conf
stream {
upstream vertica-cluster {
server 1:1111 weight=1;
server 2:1111 weight=1;
server 3:1111 weight=2;
server 4:1111 weight=2;
server 5:1111 weight=2;
server 6:1111 weight=3;
}
 
server {
listen 7:1111;
proxy_pass vertica-cluster;
}

 

 
启动
./nginx
设置开机自启
echo `date`
process=`ps -ef|grep nginx|grep -v grep|wc -l`
echo $process
if [ $process -le 0 ];then
nohup /usr/local/nginx/sbin/nginx &
/var/soft/sendEmail-v1.56/sendEmail -f 11\@11.com -t j1\@c1.com -s 10.1.1.1 -u nginx_restarted -xu 11 -xp 11
23 -m nginx_restarted
fi

 

posted on 2018-01-15 15:22  洛丹伦的雪  阅读(122)  评论(0编辑  收藏  举报