Tomcat缓存Single Sign On系统的旧dns条目 [英] Tomcat caches old dns entry of Single Sign On system‏

查看:49
本文介绍了Tomcat缓存Single Sign On系统的旧dns条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Tomcat 6.0.14(安装在RedHat Linux 5.5中,并带有Java 6 Update 13)与SSO(单点登录)系统集成在一起.

I have Tomcat 6.0.14 (installed in RedHat Linux 5.5 and with Java 6 update 13) integrated with a SSO (Single Sign On) system.

当SSO故障转移到另一个数据中心(并且SSO的IP地址更改)时,Tomcat将继续坚持SSO系统的旧DNS条目.

When SSO fail overs to a different data center (and SSO's IP address changes) the Tomcat continues to stick to the old DNS entry of the SSO system.

然后,我必须重新启动Tomcat容器,以便它选择SSO系统的新DNS.每当SSO系统故障转移到其他数据中心时,我都必须重新启动Tomcat.

I then have to restart the Tomcat container so that it picks the new DNS of the SSO system. I have to restart the Tomcat every time SSO system fails over to different data center.

是否可以将Tomcat配置为在SSO故障转移时不重新启动而刷新DNS?

Is there a way to configure Tomcat to refresh DNS with out restarting when SSO fails over?

推荐答案

这里的问题不是特定于Tomcat的,而是特定于虚拟机的.特别是,请参阅 InetAddress 的文档..此答案提供了解决方案,但为了完整性,我将提供一些选择:

The problem here isn't Tomcat specific, but rather specific to the virtual machine. In particular, see the documentation for InetAddress. This answer provides the solution, but I'll give some options for completeness:

似乎有三个选择:

  1. 编辑在 $ JRE_HOME/lib/security 中找到的 java.security 文件,并将 networkaddress.cache.ttl 更改为而不是-1(默认值或多或少)是明智的选择.

  1. Edit the java.security file found in $JRE_HOME/lib/security and change the networkaddress.cache.ttl to something sensible instead of -1 (the default more or less).

修改启动Tomcat的命令以更改设置,即在参数 -Dsun.net.inetaddr.ttl = xxx 处,其中 xxx 较为合理值.

Modify the command that launches Tomcat to change the setting, i.e. at the parameter -Dsun.net.inetaddr.ttl=xxx where xxx is some sensible value.

通过运行以下命令在您的应用程序中对其进行更改: java.security.Security.setProperty("networkaddress.cache.ttl","xxx");

Change it within your app by running: java.security.Security.setProperty("networkaddress.cache.ttl" , "xxx");

这篇关于Tomcat缓存Single Sign On系统的旧dns条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆