Apache的集群突然时不时的报出以下错误:

Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

直接访问Apache的Http服务发现可以正常访问,但是访问背后的应用就报错,直接访问应用,发现有的节点已经宕掉了,但是其他节点仍然存活,为什么会这样呢?检查了一下Apache的Connector的配置:

sticky_session=
sticky_session_force=

发现问题出在这里,对于sticky_session:

Specifies whether requests with SESSION ID's should be routed back to the same Tomcat worker. If sticky_session is set to True or 1 sessions are sticky, otherwise sticky_session is set to False. Set sticky_session to False when Tomcat is using a Session Manager which can persist session data across multiple instances of Tomcat.
The sticky_session setting can be overwritten using the Apache httpd environment variable JK_STICKY_IGNORE and the worker map extension for sticky_ignore. This has been added in version 1.2..

不用多讲,就是粘性session,如果第一次请求由某个节点服务,那后续的请求都会交予该节点服务。

sticky_session_force:

Specifies whether requests with SESSION ID's for workers that are in error state should be rejected. If sticky_session_force is set to True or 1 and the worker that matches that SESSION ID is in error state, client will receive 500 (Server Error). If set to False or 0 failover on another worker will be issued with loosing client session. This directive is used only when you set sticky_session=True. 

这个参数的意思是,决定对于处于错误状态的session是否该拒绝服务。如果开启了粘性session,开始请求由节点1服务,后来节点1 宕掉,再次请求时,该请求的session因为节点1宕掉而丢失,这个参数就决定对于这样的请求是否应该拒绝掉。参数为1或者true代表直接拒绝,客户端浏览器就会报上述错误。如果设为0或者false,则apache会将该请求lb至其他存活的节点,但是请求的session信息会丢失。对于一个普通的无状态的网站,session有没有都无所谓,所以将该参数改为0,重启apache即可。

【原创】Apache集群报Service Temporarily Unavailable的解决的更多相关文章

  1. magento错误 Service Temporarily Unavailable magento

    前台访问出现错误 Service Temporarily Unavailable magento 解决方法 Service TemporarilyUnavailable字面意思是此服务暂时无法使用,如 ...

  2. Kubernetes集群中Service的滚动更新

    Kubernetes集群中Service的滚动更新 二月 9, 2017 0 条评论 在移动互联网时代,消费者的消费行为已经“全天候化”,为此,商家的业务系统也要保持7×24小时不间断地提供服务以满足 ...

  3. quartz集群报错but has failed to stop it. This is very likely to create a memory leak.

    quartz集群报错but has failed to stop it. This is very likely to create a memory leak. 在一台配置1核2G内存的阿里云服务器 ...

  4. nginx集群报错“upstream”directive is not allow here 错误

    nginx集群报错“upstream”directive is not allow here 错误 搭建了一个服务器, 采用的是nginx + apache(多个) + php + mysql(两个) ...

  5. dfs.datanode.max.xcievers参数导致hbase集群报错

    2013/08/09 转发自http://bkeep.blog.163.com/blog/static/123414290201272644422987/ [案例]dfs.datanode.max.x ...

  6. 调用具体webservice方法时时报错误:请求因 HTTP 状态 503 失败: Service Temporarily Unavailable

    添加web引用会在相应项目的app.cofig文件中产生如下代码: <sectionGroup name="applicationSettings" type="S ...

  7. redis集群报错

    写入redis集群报错:(error) MOVED 6918 解决方法:redis-cli -c -p 7001 -h 10.0.0.104

  8. 503 Service Temporarily Unavailable

    503 Service Temporarily Unavailable 最近网站刷新后经常出现503 Service Temporarily Unavailable错误,有时有可以,联想到最近在ngi ...

  9. Magento Service Temporarily Unavailable解决方法

    插件升级错误或安装失败时 会出现Service Temporarily Unavailable错误,使网站前台后台都无法显示. 在操作完成的情况下,仍然出现这个错误时可以采用以下方法: 1.删除网站站 ...

随机推荐

  1. Microsoft Edge 首个 Chromium 内核版释出

    翻译功能释出 navigator.userAgent"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, ...

  2. Firefox Quantum:开发者版本 推荐

    为生民,不谋利 欢迎您使用 Firefox 开发者版本.使用此版本可获得最新功能.高速性能,以及您打造开放 Web 所需的开发工具. https://www.mozilla.org/zh-CN/fir ...

  3. 立即执行函数与Function

    js立即执行函数: (function ( ){})( ) 与 (function ( ){}( )) 与new Function()区别? new Function() 还是有区别的,fn = ne ...

  4. C++快速读取大文件

    debug的时候需要等很长时间读模型,查资料发现了两种快速读取大文件的方法. test 1:每次读一个字符串 test 2.3一次读取整个文件 {//test 1 string buf; clock_ ...

  5. thinkphp5-----模板中函数的使用

    1.在模板中使用php函数 在thinkphp的html中,我们经常会遇到一些变量难以直接从php控制端直接处理,这些变量只有在模板中循环输出的时候处理比较合适,这个时候,我们就要在模板中使用函数 1 ...

  6. Django框架详解之template

    模板简介 将页面的设计和python的代码分离开会更干净简洁更容易维护.我们可以使用Django的模板系统来实现这种模式 python的模板:HTML代码+模板语法 模板包括在使用时会被值替换掉的变量 ...

  7. mysql中redo和binlog的区别

    影响MySQL中redo的配置参数: innodb_log_file_size:指定每个redo日志大小,默认值48MB innodb_log_files_in_group:指定日志文件组中redo日 ...

  8. luoguP5055 【模板】可持久化文艺平衡树 可持久化非旋转treap

    好题. Code: #include<bits/stdc++.h> using namespace std; #define setIO(s) freopen(s".in&quo ...

  9. Pyhton学习——Day46

    # 数据库:存储数据的仓库# 数据库更多的是安全.备份# 客户端取服务端的数据实际都是从服务端的内存中抓取数据# 数据库管理系统软件# 数据库管理系统(Database Management Syst ...

  10. Centos7下安装Mongodb

    Mongodb网盘路径:链接:https://pan.baidu.com/s/1rWJCPZ59EAW25ha1UF5czw 密码:u3zq 1.把安装包上传到linux服务器上,解压,然后我们把mo ...