频道栏目
首页 > 资讯 > Linux > 正文

nginx + redis + tomcat 集群配置

17-03-03        来源:[db:作者]  
收藏   我要投稿

nginx + redis + tomcat 集群配置。

1、nginx配置文件

#user nobody;

worker_processes 1;

#error_log logs/error.log;

#error_log logs/error.log notice;

#error_log logs/error.log info;

#pid logs/nginx.pid;

events {

worker_connections 1024;

}

http {

include mime.types;

default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '

# '$status $body_bytes_sent "$http_referer" '

# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;

#tcp_nopush on;

#keepalive_timeout 0;

keepalive_timeout 65;

#gzip on;

upstream myServer {

server 127.0.0.1:8790 weight=1;

server 127.0.0.1:8791 weight=1;

server 127.0.0.1:8792 weight=1;

server 127.0.0.1:8793 weight=1;

}

server {

listen 80;

server_name location;

location / {

proxy_pass http://myServer;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

}

2、tomcat配置session共享

tomcat下的conf目录下的context.xml增加配置

host="127.0.0.1"

port="6379"

database="0"

password="123456"

maxInactiveInterval="60" />

3、tomcat的lib下增加的jar包

commons-pool2-2.4.1.jar

jedis-2.6.2.jar

tomcat-redis-session-manager1.2

相关TAG标签
上一篇:SQL模糊查询
下一篇:不要江山要美人 连人工智能都套路我
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站