简体   繁体   English

Glassfish JNDI树链接

[英]Glassfish JNDI Tree Linking

We are using Glassfish v2 (9.1_02) at work. 我们正在使用Glassfish v2(9.1_02)。 Our servers are not set up in a clustered environment. 我们的服务器未在集群环境中设置。

We would like to have one main server as a JNDI server that can serve DataSource objects, and possibly other objects in the future, and link other servers to this one server. 我们希望有一台主服务器作为JNDI服务器,它可以为DataSource对象以及将来可能的其他对象提供服务,并将其他服务器链接到该服务器。 This way, if we change the location of a database or change a password, we do not have to update multiple servers, but instead just one. 这样,如果我们更改数据库的位置或更改密码,则不必更新多个服务器,而只需更新一个。

My questions are: 我的问题是:

  1. Is this even a good idea to do? 这甚至是个好主意吗?
  2. Is it possible to link JNDI trees in Glassfish? 是否可以在Glassfish中链接JNDI树?
  3. How can I accomplish this? 我该怎么做?
  4. Has anyone accomplished this? 有人做到了吗?

Thank you 谢谢

This is not a good idea, a virtual machine shouldn't use a database connection established on another machine. 这不是一个好主意,虚拟机不应使用在另一台计算机上建立的数据库连接。 The overhead would be silly and how could it deal with a failover? 开销将是可笑的,它将如何处理故障转移?

There are much better ways of ensuring all the servers in a cluster start up with the same configuration, it really comes down to what OS you're running on. 有更好的方法来确保集群中的所有服务器以相同的配置启动,这实际上取决于您所运行的操作系统。

You might want to start by looking at an "application fabric" like terracotta. 您可能要先看一个像“兵马俑”这样的“应用程序结构”。 RedHat also has a system (called satellite) used to distribute config files. RedHat还具有用于分发配置文件的系统(称为卫星)。 Other environments have equivalent solutions. 其他环境具有等效的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM