nginx、varnish和tomcat的负载均衡(端口号配置)

2018-07-09  本文已影响0人  董大志

本篇文档主要是为了搭配tomcat、varnish及nginx三者之间的端口号的配置,以实现三者之间的负载均衡!!

ubuntu16.04/centos7.4
tomcat7
jdk1.8 nginx-1.5.11
varnish-3.0.4

注:tomcat、varnish及nginx的编译安装及初步配置可参考一下文献!
https://www.jianshu.com/p/00e1ab183b6b
https://www.jianshu.com/p/1b4f69638357
https://www.jianshu.com/p/038084f9e6e3


1.tomcat

/usr/local/tomcatA/conf$ sudo vim server.xml

图片.png

/usr/local/tomcatA/bin$ sudo ./startup.sh

2.varnish

/usr/local/varnish/etc/varnish$ sudo vim default.vcl

图片.png

/usr/local/varnish/sbin$ sudo ./varnishd -f /usr/local/varnish/etc/varnish/default.vcl -T 192.168.3.12:2000 -a 0.0.0.0:81 -s file,/tmp,1000M

3.nginx

图片.png

/usr/local/nginx/sbin$ sudo ./nginx -c /usr/local/nginx/conf/nginx.conf

接下来访问tomcat下面的项目:


图片.png
上一篇 下一篇

猜你喜欢

热点阅读